Skip to content

Commit 7acd18c

Browse files
committed
OSDOCS-9770 - Proposed changes to including content using tags.
1 parent bf8dc87 commit 7acd18c

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

contributing_to_docs/doc_guidelines.adoc

+32-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"]
@@ -357,7 +357,37 @@ The following examples include IDs that are unique to the "Configuring alert not
357357
----
358358

359359
== Writing assemblies
360-
An _assembly_ is a collection of modules that describes how to accomplish a user story.
360+
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.
361+
362+
An `include` directive must always be on its own line.
363+
364+
.Standard module include syntax
365+
[source,text]
366+
====
367+
\include::modules/module-filename.adoc[leveloffset=+1] <1>
368+
====
369+
<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.
370+
371+
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.
372+
373+
.Tagged module include syntax
374+
[source,text]
375+
====
376+
\include::modules/module-with-tags-filename.adoc[leveloffset=+1,tag=TagName]
377+
====
378+
379+
You can filter out the regions defined by a `tag` attribute, by using `!*` in place of 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.
380+
381+
.Include lines not tagged syntax
382+
[source,text]
383+
====
384+
\include::modules/module-with-tags-filename.adoc[leveloffset=+1,tag=!*]
385+
====
386+
.
387+
[IMPORTANT]
388+
====
389+
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.
390+
====
361391

362392
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].
363393

@@ -400,11 +430,6 @@ When needed, use `.Prerequisites`, `.Next steps`, or `.Additional resources` syn
400430
== Writing text snippets
401431
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.
402432

403-
[IMPORTANT]
404-
====
405-
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.
406-
====
407-
408433
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:
409434

410435
* Admonitions that appear in multiple modules.

0 commit comments

Comments
 (0)