Skip to content

Commit dd778a2

Browse files
authored
Merge pull request #73514 from dfitzmau/more-info-xref-guideline
more-info-xref-guideline: Updating the doc_guidelines.adoc with for m…
2 parents 2291f22 + 175c2c4 commit dd778a2

File tree

1 file changed

+87
-11
lines changed

1 file changed

+87
-11
lines changed

contributing_to_docs/doc_guidelines.adoc

Lines changed: 87 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ An `include` directive must always be on its own line.
364364

365365
.Standard module include syntax
366366
[source,text]
367-
====
368-
\include::modules/module-filename.adoc[leveloffset=+1] <1>
369-
====
370-
<1> [leveloffset=] link:https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/#manipulate-heading-levels-with-leveloffset[is relative], and changes the header level of included content.
367+
----
368+
include::modules/module-filename.adoc[leveloffset=+1] <1>
369+
----
370+
<1> `[leveloffset=]` link:https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/#manipulate-heading-levels-with-leveloffset[is relative], and changes the header level of included content.
371371

372372
You can use `tag` attributes to link:https://docs.asciidoctor.org/asciidoc/latest/directives/include-tagged-regions[define regions of a file and include by tag instead of the whole file.] This enables you to make conditional modifications to existing modules instead of duplicating content. When creating a tag, use a tag name that makes it easy to understand where the content defined will be included.
373373

@@ -743,21 +743,86 @@ Replace all public IP addresses with an address from the following blocks. These
743743
There might be advanced networking examples that require specific IP addresses, or cloud provider-specific examples that require a public IP address. Contact a subject matter expert if you need assistance with replacing IP addresses.
744744
====
745745

746+
[id="links-conditionals-assemblies"]
746747
== Links, hyperlinks, and cross references
747748
Links can be used to cross-reference internal assemblies or send readers to external information resources for further reading.
748749

749-
In OpenShift docs:
750+
In OpenShift Container Platform docs:
750751

751-
* All links to internal content is created using `xref` and **must have an anchor ID**.
752+
* All links to internal content is created by using an `xref`, and each `xref` **must have an anchor ID**.
752753
* Only use `xref` in assemblies, not in modules.
753-
* All links to external websites are created using `link`.
754-
* Links between different 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 need to be in distro-specific files or conditionalized to apply to the relevant distros.
754+
* All links to external websites are created by using the `link` attribute.
755+
* 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.
755756

756757
[IMPORTANT]
757758
====
758-
Do not split link paths across lines when wrapping text. This will cause issues with the doc builds.
759+
Do not split link paths across lines when wrapping text. This will cause issues with the documentation builds.
760+
====
761+
762+
[id="lead-in-link-sentences"]
763+
=== Lead-in link sentences
764+
765+
Using a lead-in link sentence that adheres to guidelines maintains consistency across OpenShift Container Platform documentation.
766+
767+
==== Lead-in link sentence style for non-xref situations
768+
769+
For situations where you cannot use the `xref` attribute, such as referencing a module within a module, ensure that you adhere to the following guidance for lead-in link sentences.
770+
771+
* Use the following format when pointing to a section in the same document:
772+
+
773+
[source,text,subs="+quotes"]
774+
----
775+
For more information, see "<section_name>".
776+
----
777+
778+
* Wrap the `<section_name>` string in quotation marks. The section name can be the title of a module or an assembly.
779+
780+
* Do not state "in the Additional Resources section" or other variants. Mentioning the `<section_name>` is enough to prompt a documentation user to find the section in the same document.
781+
782+
==== Lead-in link sentence style for the xref attribute
783+
784+
For situations where you can use the `xref` attribute, adhere to the following guidance:
785+
786+
* When pointing to a section (module) that exists in the same document (assembly), create an _Additional resources_ section in the assembly file and then place the `xref` as a bulleted item under the _Additional resources_ section. For example:
787+
+
788+
[source,text]
789+
----
790+
[role="_additional-resources"]
791+
.Additional resources
792+
* xref:../../../installing/installing_vsphere/installation-config-parameters-vsphere.adoc#installation-config-parameters-vsphere[Installation configuration parameters]
793+
----
794+
795+
* When pointing to a link in a section (module) that exists in another OpenShift Container Platform document (assembly), use the following format:
796+
+
797+
[source,text]
798+
----
799+
For more information on <topic>, see xref:<path_to_file>["<section_name>"] in _<document_name>_.
800+
----
801+
802+
Note the quotation marks around `<section_name>` and the italics around `<document_name>`.
803+
804+
For more information about using `xref`, see xref:links-conditionals-assemblies[Links, hyperlinks, and cross references].
805+
806+
==== Lead-in link sentence style for the link attribute
807+
808+
For situations where you can use the `link` attribute, adhere to the following guidance:
809+
810+
* When pointing to a link that exists external to Red Hat's customer portal documentation, add the `link` attribute, and use the `<document_heading_name> (<document_source>)` format. For example:
811+
+
812+
[source,text]
813+
----
814+
See link:https://aws.amazon.com/about-aws/global-infrastructure/localzones/features/[AWS Local Zones features] (AWS documentation).
815+
----
816+
817+
[NOTE]
818+
====
819+
Certain Red Hat resources, such as Knowledgebase articles, exist in a separate server location to Red Hat customer portal documentation. For these resources, use the `link` attribute format.
820+
821+
For more information, see link:https://redhat-documentation.github.io/supplementary-style-guide/#rh-kb-links[Links to Red Hat Knowledgebase articles] (Red Hat supplementary style guide for product documentation).
759822
====
760823

824+
For more information about using `link`, see xref:links-conditionals-assemblies[Links, hyperlinks, and cross references].
825+
761826
=== Example URLs
762827
To provide an example URL path that you do not want to render as a hyperlink, use this format:
763828

@@ -1785,14 +1850,15 @@ Do not use a password format that matches the format of a real password. Documen
17851850
|myapp
17861851
|===
17871852

1853+
[id="additional-resources-sections"]
17881854
=== Additional resources sections
17891855

17901856
The following guidelines apply to all "Additional resources" sections:
17911857

17921858
* You must include the `[role="_additional-resources"]` attribute declaration before the section heading.
17931859
* You must not include paragraphs in the section. Use an unordered list.
17941860
* The links and xrefs in the unordered list must contain minimal-length, human-readable text between the square brackets. This text is often the title of the linked page.
1795-
* You must not include text outside of the square brackets.
1861+
* You must not include text outside of the square brackets. Text outside the brackets does not effectively render in an additional resources section box for a document on the Customer Portal.
17961862

17971863
Additionally, in an assembly, use `==` formatting for the section heading (`== Additional resources`). Use of this heading syntax at the assembly level indicates that the sections relate to the whole assembly. For example:
17981864

@@ -1815,6 +1881,16 @@ Only use `.` formatting (`.Additional resources`) in a module or to follow a mod
18151881
* xref:../configuration/product-settings.adoc#installation-parameters_product-settings[Product installation configuration parameters]
18161882
----
18171883

1884+
You can add link, hyperlinks, and cross references in either the _Additional resources_ section or the _Next steps_ section, but know the following differences:
1885+
1886+
Additional resources - module level:: Requires the `.Additional resources` section heading. The listed resources link to other material closely related to the contents of the module. Focus on including the most relevant resources for the user, not a full list of possibly related resources.
1887+
1888+
Additional resources - assembly level:: Requires the `== Additional resources` section heading with a unique anchor ID. If a resource applies to all of the modules in a user story, consider listing the resource in the _Additional resources_ section of the assembly file.
1889+
1890+
Next steps:: Provide links to resources that contain instructions that might be useful to the user after they complete a module or assembly. Do not use the _Next steps_ section to provide detailed instructions to documentation users.
1891+
1892+
For more information about section types, see link:https://redhat-documentation.github.io/modular-docs/#assembly-guidelines["Assembly guidelines"] in the _Modular documentation reference guide_.
1893+
18181894
== Admonitions
18191895
Admonitions such as notes and warnings are formatted as shown:
18201896

@@ -2152,7 +2228,7 @@ a|
21522228

21532229
|Table style operators
21542230

2155-
|A style operator styles the content of a table cell or a table column, depending on where you set the operator. Using the literal (`l`) operator in a column might impact the documentation platform's copy and paste functionality. For example, when you paste copied code block content to a location, the first styled literal value in an assembly is pasted instead of the intended code block. To avoid this issue, use the monospace (`m`) style operator. When using any style operator in a table, check all copy and paste functions that follow the defined style operator work correctly for all code blocks in an assembly.
2231+
|A style operator styles the content of a table cell or a table column, depending on where you set the operator. Using the literal (`l`) operator in a column might impact the documentation platform's copy and paste functionality. For example, when you paste copied code block content to a location, the first styled literal value in an assembly is pasted instead of the intended code block. When using any style operator in a table, check all copy and paste functions that follow the defined style operator work correctly for all code blocks in an assembly.
21562232

21572233
See link:https://docs.asciidoctor.org/asciidoc/latest/tables/format-cell-content/[Cell styles and their operators] (Asciidoctor Documentation)
21582234

0 commit comments

Comments
 (0)