Appendix B: AsciiDoc Markup Language.
This appendix provides further examples of the styles used to develop The Open Group Standards in the AsciiDoc markup language.
Additional resources including a writer’s guide, user manual, and syntax reference manual are available at https://asciidoctor.org/.
B.1. Sample Heading at Level 2
Sample Text
B.1.1. Sample Heading at Level 3
B.1.1.1. Sample Heading at Level 4
Sample Unnumbered Heading
B.2. IDs
The following conventions should be used when assigning AsciiDoc IDs for chapters, tables, and figures. The recommended ID convention follows the recommended AsciiDoc Custom ID and Reference Text syntax of Asciidoctor also auto-generates section IDs, so creating a separate ID for each section is not strictly necessary. However, use of custom IDs defines a stable anchor for linking to a section using a cross reference (xref), which will both help future authors and the editing process. manually defining custom IDs for sections is recommended. |
Content Type | ID Convention | Example | Notes |
---|---|---|---|
Chapter title |
|
|
Only occurs once at the top of a file |
Figures and Images |
[ |
|
|
Section |
|
|
Use for referencable sections at any level |
Example |
|
|
|
Tables |
|
|
B.3. Code Blocks and Literal Text
Example with text prefixed by whitespace:
Sample code example Sample code example
Using a line delimiter (----):
Would produce:
Sample code example Sample code example The code is displayed literally as <pre> text
B.4. Lists
Bullet list:
-
Sample bullet list item
Numbered list:
-
Sample numbered list item
Variable list:
- Variable List item
-
Text to go with the item.
-
A list with a paragraph of content, which may be wrapped, even using a hanging indent
Additional paragraphs or blocks are adjoined by putting a list continuation on a line adjacent to both blocks.
B.5. Tables
Table Column Heading | Table Column Heading | Table Column Heading |
---|---|---|
Table text |
Table text |
Table text |
Heading 1 | Heading 2 | Heading 3 |
---|---|---|
Table text |
Table text |
Table text |
Heading 1 | Heading 2 | Heading 3 |
---|---|---|
Table text |
Table text |
The Open Group Standards are designed for:
|
B.6. Note Blocks
This is a simple note block. |
A note block can contain complex content.
Another paragraph. |
B.7. Indexing Terms
This text has an indexed term.
This text has a term that is indexed.
This text has another example.
This text has guidance on indexing.
King Arthur was to carry Excalibur.
B.8. Figures
B.9. Web Links
https://www.opengroup.org – automatic!
B.10. Quotations
Never do today what you can put off 'til tomorrow
Four score and seven years ago our fathers brought forth on this continent a new nation …
Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. …
Address delivered at the dedication of the Cemetery at Gettysburg
B.11. Cross-References
The section on providing quotation guidance above describes how to insert quotations into a document.
This is a link back to the earlier figure, Figure 70.
B.12. Advanced Cross-referencing
B.12.1. Overview
One key benefit of using the publication framework that The Open Group has adopted is that it allows cross linking both within a document and across different documents. In this template we keep the examples fairly simple and use the Antora format by default, that uses a source-to-source linking syntax allowing the author to specify where in the original source material to link to, with the system figuring how to actually link the published content. This means when cross linking outside an adoc file you need to know the filename where the target reference resides.
This kind of cross-linking is referred to as an xref
after the
Asciidoc directive that specifies the destination or target of a link.
There are a number of ways you can specify the xref target, depending on
exactly what you are trying to link to. However, there are a few cases
that you will use frequently - there are some examples below, and fully
covered in the official online documentation under
Xref Macros and Page
Links.
While the xref directive specifies the from end of the link, it is helpful to have a high-level understanding of the target - where you are linking to. In general, you need to know:
-
The component name of the project you are linking to - this is the name attribute in antora.yml, and usually set by the editors e.g.,
name: the-open-group-standard-template
-
The name of the module containing the file you want to reference - this is likely to be project dependent, so you will need to understand the structure of the document you are linking to, the typical convention we use is '00-front-matter' for front matter material such as the Preface, '01-doc' for content pages, and '99-appendices' for the appendices and index
-
The name of the Asciidoc file containing the material you want to refer to, e.g,
chap03.adoc
-
An optional anchor for a topic somewhere inside that Asciidoc file, e.g.,
[#content_framework]
or- these anchors can be both defined by the authors, and are also auto-generated from section headings
With these target destinations in mind, you can construct an xref of the form:
xref:component:module:file-coordinate-of-target-page§adoc#anchor[optional link text]
B.12.2. Example
An example of this would be if you wanted to make a reference in the Preface of this template to the chapters of this document.
This content is The Open Group Standard Template, which has the project name the-open-group-standard-template
(set in the top level antora.yml file). The Introduction chapter
is in the file named chap01.adoc
within the module 01-doc
, and the specific
reference is at an anchor called #Introduction
. (Authors are encouraged to
give meaningful names to their anchors.
So, with this information in mind, your reference would look like:
xref:component:module:name-of-target-page§adoc#anchor[optional link text] xref:the-open-group-standard-template:01-doc:chap01§adoc#Introduction[Introduction]
You can also drop the component name when referencing within the document itself. So, use the abbreviated form:
xref:01-doc:chap01§adoc#Introduction[Introduction]
B.13. Inline Rationale
B.14. Inline Citations to References
B.15. Diagrams in AsciiDoc
Asciidoctor Diagram is a set of Asciidoctor extensions that enable you to add diagrams, which you describe using plain text, to your AsciiDoc document.
The extensions support the AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite, and WaveDrom syntax.
For more details, see https://asciidoctor.org/docs/asciidoctor-diagram/.
+-------------+ | Asciidoctor |-------+ | diagram | | +-------------+ | PNG out ^ | | ditaa in | | v +--------+ +--------+----+ /---------------\ | | --+ Asciidoctor +--> | | | Text | +-------------+ | Beautiful | |Document| | !magic! | | Output | | {d}| | | | | +---+----+ +-------------+ \---------------/ : ^ | Lots of work | +-----------------------------------+
class BlockProcessor class DiagramBlock class DitaaBlock class PlantUmlBlock BlockProcessor <|-- DiagramBlock DiagramBlock <|-- DitaaBlock DiagramBlock <|-- PlantUmlBlock
B.16. Curly Quotes
This is an example of "`double curly quotes`".
This renders as:
This is an example of “double curly quotes”.
If you run curly quotes up against Italics, they may not render. In that case use a zero-width space character.
(_You should be able to contrast the main differences between "`waterfall`" and "`Agile`"{zwsp}_)
Without the zero-width space, this renders incorrectly as:
(You should be able to contrast the main differences between “waterfall” and "`Agile`")
With the zero-width space we get:
(You should be able to contrast the main differences between “waterfall” and “Agile”)
The following could be used for a long quotation:
"`{zwsp} _...{nbsp}the best team leaders are those that take on the leadership role 100% all of the time_ {zwsp}`"
Which renders as:
“ … the best team leaders are those that take on the leadership role 100% all of the time. ”