Follow these guidelines to ensure consistent formatting of all external documentation. |
Asciidoctor makes all section headings into anchors.
== Installing
== Installing <feature_name>
<<_anchor_title,link text>>.
[[_anchor_title]]anchor text.
Each topic should be in it's own .adoc file with appropriate header settings. For document reuse, start each file's heading sections at level two (== Title
). The jbake template will adjust the level to the appropriate setting in the target document.
To help with editability, each sentence should be on a new line. Asciidoctor renders them as a single paragraph, until a blank line signals a new paragraph. This makes it easier to browse and make corrections. A possible exception is within tables or lists where it may affect the readability of the table syntax.
When a section title is changed, external and internal links will be be broken. Do a search for the |
When including external URLs in documentation, to avoid displaying the entire URL, use this following Asciidoctor format:
http://google.com[link text]
EXPERIMENTAL - This section refers to new functionality created in version 2.14.0
Special formatting is used to create links within and between pages of documentation. Links can send user to a separate section of the current document or another page in the documentation library. These are the conventions of creating those links
<<{target-prefix}anchor_text,Display Text>>
<< >>
.Section headings create automated anchors based on the text of the header with a leading underscore and spaces replaced with underscores.
== Section Heading
becomes
_section_heading
Manual anchors can also be created to link to any arbitrary spot in the text and should follow the same conventions in most cases. Asciidoctor anchors have a syntax as follows:
[[_manual_anchor]]Anchor Text
Element | Convention | Example | Comments |
---|---|---|---|
Titles of documents | normal | ||
File types | normal | a pdf file | |
File names / file paths / URIs / URLs | monospace | /etc/security | |
Error messages | sentence case, quoted | ||
Names of Organizations or Companies | normal | ... the Apache Foundation | |
email addresses | monospace | ||
Names of products and versions | normal | ||
Sample usernames / passwords | monospace | ||
Ports used in a sentence | normal | ||
IP addresses / ports | monospace | ||
Input or parameters | monospace | ||
references to line numbers (in code samples) | normal | avoid if possible | |
Inline code quotes | monospace | ||
Code Blocks | monospace | See code block table for other formatting conventions | |
Button names / Menu Names / Icon Names | bold | ||
Application names(referenced in a sentence) | normal | ||
Application tab (in instruction sequences) | bold | bold anything "clickable" | |
Maintain consistency when writing instructions for procedures.
Start any installation or configuration procedures done through the admin console in the same way.
Introduce the table or diagram to explain the information described in the table. Links should be to the section containing the table, or to an anchor added to the introduction, instead of directly to the block.
.
with no space: .Caption Text
.${branding}
substitutions, as they may not resolve correctly within the diagram in custom distributions.cDEF
, c369
, and
cCCC
.c5F5
, cF55
, c555
Tables can be formatted in a few ways, but to maintain consistency, these conventions should be followed.
.Dot Title
[cols="3"]
, in practice, this syntax often has problems with dropping table rows[cols="1,3,1" options="header"]
|===
|cell 1
|cell 2
|cell 3
|cell 4
|cell 5
|cell 6
|===
a
character before the |
that starts the cell. .Table title [cols="1,3,1" options="header"] |=== |Header 1 |Header 2 |Header 3 |cell 1 |cell 2 a|cell 3 * list item 1 * list item 2 |=== |
Table delimiters can be dangerous, if one is deleted or a stray is left in the documentation, it will essentially try to put all content that follows into a single table cell, which loses all formatting and often will cause a build to fail on pdf generation. |
Not all formatting is available within table cells. Bulleted lists and callouts do not get converted when inside a table cell, but can be approximated with line breaks. |
[ditaa,diagram-file-name,png] .... +--------+ |Object 1| |cDEF | +--------+ .... |
Short blocks of code, system attributes and properties, and file names/extensions/directories should be surrounded by backticks to render as monospace
. Longer code samples should be set off in code blocks as follows. Adding an anchor is optional, but encouraged. Anchors should be unique to not conflict with anchors in other sections.
Make a code block for anything longer than a single line. Short snippets of less than one line can be formatted monospace
inline.
Introduce the code block and the context for it. Links should be to the section containing the code block, or to an anchor added to the introduction, instead of directly to the block.
.
with no space: .Caption Text
.[source, java]
linenums
[source, javascript, linenums]
.[[anchor]]Caption or Description Line [source,language,linenums] ---- // code .... ---- |