Skip to content

Commit 37d4fe2

Browse files
authored
Merge pull request #72091 from libander/include-by-tag-suggestion
OSDOCS-9770 - [Meta] - Proposed change to including content using tags.
2 parents a6c1839 + 52fd781 commit 37d4fe2

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

contributing_to_docs/doc_guidelines.adoc

+26-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ It is not necessary to update existing content to unwrap lines, but you can remo
2828
+
2929
[TIP]
3030
====
31-
In the Atom editor, you can use `Ctrl`+`J` to undo hard wrapping on a paragraph.
31+
In the Pulsar editor, you can use `Ctrl`+`J` to undo hard wrapping on a paragraph.
3232
====
3333

3434
[id="assembly-file-metadata"]
@@ -358,7 +358,31 @@ The following examples include IDs that are unique to the "Configuring alert not
358358
----
359359

360360
== Writing assemblies
361-
An _assembly_ is a collection of modules that describes how to accomplish a user story.
361+
An _assembly_ is a collection of modules that describes how to accomplish a user story. Module content is added to an assembly using the `include` directive. The `include` directive includes contents from another file in the current document. Files can be modules or snippets formatted in AsciiDoc, or another text format such as YAML.
362+
363+
An `include` directive must always be on its own line.
364+
365+
.Standard module include syntax
366+
[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.
371+
372+
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.
373+
374+
.Tagged module include syntax
375+
[source,text]
376+
====
377+
\include::modules/module-with-tags-filename.adoc[leveloffset=+1,tag=TagName]
378+
====
379+
380+
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.
381+
382+
[IMPORTANT]
383+
====
384+
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.
385+
====
362386

363387
Avoid link:https://redhat-documentation.github.io/modular-docs/#nesting-assemblies[nesting assemblies] in other assembly files. You can create more complicated document structures by modifying the link:https://github.com/openshift/openshift-docs/tree/main/_topic_maps[topic maps].
364388

@@ -401,11 +425,6 @@ When needed, use `.Prerequisites`, `.Next steps`, or `.Additional resources` syn
401425
== Writing text snippets
402426
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.
403427

404-
[IMPORTANT]
405-
====
406-
Only include entire snippets in an assembly or module. 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.
407-
====
408-
409428
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:
410429

411430
* Admonitions that appear in multiple modules.

0 commit comments

Comments
 (0)