Skip to content

Commit 48195d6

Browse files
authored
Merge pull request #76375 from skrthomas/tagging-update
adding disclaimer to tagged region includes
2 parents da8f943 + 2574289 commit 48195d6

File tree

1 file changed

+50
-10
lines changed

1 file changed

+50
-10
lines changed

contributing_to_docs/doc_guidelines.adoc

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -419,16 +419,6 @@ include::modules/module-filename.adoc[leveloffset=+1] <1>
419419
----
420420
<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.
421421

422-
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.
423-
424-
.Tagged module include syntax
425-
[source,text]
426-
====
427-
\include::modules/module-with-tags-filename.adoc[leveloffset=+1,tag=TagName]
428-
====
429-
430-
You can filter out the regions defined by a `tag` attribute by using link:https://docs.asciidoctor.org/asciidoc/latest/directives/include-tagged-regions/#tag-filtering[expressions] in place of or in conjunction with the tag name. If you add tag defined conditional content to a module with no existing tags, you must update existing includes of the file you are changing to exclude your content.
431-
432422
[IMPORTANT]
433423
====
434424
Including link:https://docs.asciidoctor.org/asciidoc/latest/directives/include-lines/[lines by content ranges] can lead to content errors when the included file is subsequently updated and is not permitted.
@@ -446,6 +436,56 @@ When using the "Prerequisites", "Next steps", or "Additional resources" headings
446436
Only use `.` formatting (`.Additional resources`) to follow a module in an assembly. Because you cannot use the xrefs in modules, this functions as a _trailing include_ at the assembly level, where the `.` formatting of the `include` statement indicates that the resource applies specifically to the module and not to the assembly.
447437
====
448438

439+
=== Including by tags
440+
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.
441+
442+
* In assembly files, use the `tags` (plural) attribute when there is more than one tag specified. Use the `tag` (singular) attribute when there is only one tag. For example:
443+
+
444+
.Singular tagged module include syntax
445+
[source,text]
446+
====
447+
\include::modules/module-with-tag-filename.adoc[leveloffset=+1,tag=TagName]
448+
====
449+
+
450+
.Plural tagged module include syntax
451+
[source,text]
452+
====
453+
\include::modules/module-with-tags-filename.adoc[leveloffset=+1,tags=TagName;Mode1;!Mode2]
454+
====
455+
456+
* In the module files, use `//` before the tag directives in asciidoc text and a `#` before tag directives in YAML. For example:
457+
+
458+
.Included file tag directives
459+
[source,text]
460+
----
461+
// tag::TagName[]
462+
== Tagging regions
463+
464+
Tags are useful when you want to identify specific regions of a file to include. You can then select the lines between the boundaries of the include tag/end directives to include using the tags attribute.
465+
466+
In the included file, the tag directives (e.g., tag::<tag_name>[] and end::<tag_name>[]) must follow a word boundary and precede a space character or the end of line. The tag name must not be empty and must consist exclusively of non-space characters.
467+
468+
.Example CR
469+
[source,yaml]
470+
--
471+
spec:
472+
# tag::Mode1[]
473+
mode: openshift
474+
# end::Mode1[]
475+
# tag::Mode2[]
476+
mode: openshift-network
477+
# end::Mode2[]
478+
--
479+
// end::TagName[]
480+
----
481+
+
482+
[WARNING]
483+
====
484+
The use of a wildcard (`*`) is not fully supported by PV1. Verify that access.redhat.com builds and docs.openshift.com builds are including or excluding content as expected if you try to use them.
485+
====
486+
487+
You can filter out the regions defined by a `tag` attribute by using link:https://docs.asciidoctor.org/asciidoc/latest/directives/include-tagged-regions/#tag-filtering[expressions] in place of or in conjunction with the tag name. If you add tag defined conditional content to a module with no existing tags, you must update existing includes of the file you are changing to exclude your content.
488+
449489
== Writing concepts
450490
A _concept_ contains information to support the tasks that users want to do and
451491
must not include task information like commands or numbered steps. In most

0 commit comments

Comments
 (0)