Skip to content

Commit 64cd421

Browse files
authored
Merge pull request #89394 from ShaunaDiaz/OSDOCS-13518
OSDOCS-13518: adds clarification on xrefs for snippets
2 parents f9ef970 + c4ccd40 commit 64cd421

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

contributing_to_docs/doc_guidelines.adoc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,19 +490,31 @@ A _procedure_ contains the steps that users follow to complete a single process
490490

491491
Use a gerund in the procedure title, such as "Creating".
492492

493+
[IMPORTANT]
494+
====
495+
Modules cannot contain xrefs. If you _must_ use a link in your module, use the `link` attribute type and treat it as an external reference.
496+
497+
Use version attributes for the maintainability of xrefs and links whenever you can.
498+
====
499+
493500
For more information about writing procedures, see the
494501
link:https://redhat-documentation.github.io/modular-docs/#con-creating-procedure-modules_writing-mod-docs[_Red Hat modular docs reference guide_] and the link:https://raw.githubusercontent.com/redhat-documentation/modular-docs/master/modular-docs-manual/files/TEMPLATE_PROCEDURE_doing-one-procedure.adoc[procedure template].
495502

496503
[NOTE]
497504
====
498-
When needed, use `.Prerequisites`, `.Next steps`, or `.Additional resources` syntax to suppress TOC formatting within a module. Do not use `==` syntax for these headings in modules. Because you cannot use the xrefs in modules, if you need to include a link under one of these headings, place the entire subsection in the assembly instead.
505+
When needed, use the _<.section_title>_ syntax suppress TOC formatting within a module, for example, `.Prerequisites`, `.Procedure`, `.Next steps`, or `.Additional resources`. Do not use the heading-level syntax, such as `==`, for these headings in modules.
499506
====
500507

501508
[id="writing-text-snippets"]
502509
== Writing text snippets
503510
A _text snippet_ is an optional component that lets you reuse content in multiple modules and assemblies. Text snippets are not a substitute for modules but instead are a more granular form of content reuse. While a module is content that a reader can understand on its own (like an article) or as part of a larger body of work (like an assembly), a text snippet is not self-contained and is not intended to be published or cross referenced on its own.
504511

505-
In the context of modules and assemblies, text snippets do not include headings or anchor IDs. Text snippets also cannot contain xrefs. This type of component is text only. Examples include the following:
512+
[IMPORTANT]
513+
====
514+
Like modules, text snippets cannot contain xrefs. If you _must_ use a link in your snippet, use the `link` attribute type and treat it as an external reference. It is recommended to use version attributes for maintainability of the link.
515+
====
516+
517+
In the context of modules and assemblies, text snippets do not include headings or anchor IDs. Examples include the following:
506518

507519
* Admonitions that appear in multiple modules.
508520
* An introductory paragraph that appears in multiple assemblies.
@@ -827,7 +839,7 @@ Links can be used to cross-reference internal assemblies or send readers to exte
827839
In OpenShift Container Platform docs:
828840

829841
* All links to internal content is created by using an `xref`, and each `xref` **must have an anchor ID**.
830-
* Only use `xref` in assemblies, not in modules.
842+
* Only use `xref` in assemblies, not in modules or snippets.
831843
* All links to external websites are created by using the `link` attribute.
832844
* Links between different distributions, or _distros_, such as from ROSA to OpenShift Container Platform, are external links and not cross-references. These external links use `link` instead of `xref` and must be in distro-specific files or a conditionalized state to apply to the relevant distros.
833845

0 commit comments

Comments
 (0)