git: 0d4fa21eab - main - [fdp-primer]: Clarify link macros usage

From: Fernando Apesteguía <fernape_at_FreeBSD.org>
Date: Sat, 07 Sep 2024 18:12:32 UTC
The branch main has been updated by fernape:

URL: https://cgit.FreeBSD.org/doc/commit/?id=0d4fa21eab62ef797e1a93d0203e474d1d7c8088

commit 0d4fa21eab62ef797e1a93d0203e474d1d7c8088
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2024-08-29 16:59:19 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2024-09-07 18:11:20 +0000

    [fdp-primer]: Clarify link macros usage
    
    Put some order in what macros to use when.
    
    Follow-up for e6e9a81269
    
    Differential Revision: https://reviews.freebsd.org/D46481
---
 .../fdp-primer/asciidoctor-primer/_index.adoc      | 39 +++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/documentation/content/en/books/fdp-primer/asciidoctor-primer/_index.adoc b/documentation/content/en/books/fdp-primer/asciidoctor-primer/_index.adoc
index 55ebe5b6dd..12b3f4421f 100644
--- a/documentation/content/en/books/fdp-primer/asciidoctor-primer/_index.adoc
+++ b/documentation/content/en/books/fdp-primer/asciidoctor-primer/_index.adoc
@@ -219,7 +219,7 @@ However, it is a good practice to do this anyway to ensure that Asciidoctor rend
 ====
 
 [[asciidoctor-links-internal]]
-=== Internal link
+=== Links to another book or article
 
 To point to another book or article the Asciidoctor variables should be used.
 For example, if we are in the `cups` article and we want to point to `ipsec-must` these steps should be used.
@@ -240,6 +240,43 @@ And this would be rendered as.
 +
 extref:{ipsec-must}[IPSec-Must article]
 
+[NOTE]
+====
+The `extref` macro is defined as an extension.
+It is designed to render the correct link across the different outputs
+====
+
+=== Links to the same file or to another file in the same book
+
+Books are structured in different directories to keep a sane layout.
+To create a link from one subdirectory of a book to another subdirectory of the
+same book, use the `crossref` macro:
+....
+crossref:doc-build[documentation-makefile]
+....
+And this would be rendered as
+
+crossref:doc-build[documentation-makefile, This link]
+
+[NOTE]
+====
+The `crossref` macro is defined as an extension.
+It is designed to render the correct link across the different outputs
+====
+
+[NOTE]
+====
+Use the `crossref` macro for intra-document links too.
+Although it might be inconvenient to write the name of the current document,
+it ensures the correct link is renderedacross the different outputs
+====
+
+[WARNING]
+====
+Do not use neither the `xref` macro nor its shortcut `<<` `>>`.
+They do not work well in all output formats.
+====
+
 [[asciidoctor-images-icons]]
 == Images and Icons