Introduction


Follow these guidelines to ensure consistent formatting of all external documentation.


Section Headings

Asciidoctor makes all section headings into anchors.


The syntax for an internal link to an anchor is <<_anchor_title,link text>>.

The syntax for the anchor itself (often a section heading, but not required to be one): [[_anchor_title]]anchor text.
Ensure section titles have a blank line preceding them or they will not render correctly.

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. 


Paragraphs

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 _anchor_title to find internal links. 

Links

External Links

When including external URLs in documentation, to avoid displaying the entire URL, use this following Asciidoctor format:

http://google.com[link text]

Internal Links

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>>

Anchors

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

Special Formatting Conventions

ElementConventionExampleComments
Titles of documentsnormal

File typesnormala pdf file
File names / file paths / URIs / URLsmonospace/etc/security
Error messagessentence case, quoted

Names of Organizations or Companiesnormal... the Apache Foundation
email addressesmonospace

Names of products and versionsnormal

Sample usernames / passwordsmonospace

Ports used in a sentencenormal

IP addresses / portsmonospace

Input or parametersmonospace

references to line numbers (in code samples)normal
avoid if possible
Inline code quotesmonospace

Code Blocksmonospace
See code block table for other formatting conventions
Button names / Menu Names / Icon Namesbold

Application names(referenced in a sentence)normal

Application tab (in instruction sequences)bold
bold anything "clickable"





Writing About Procedures

Maintain consistency when writing instructions for procedures. 

Admin Console Procedures

Start any installation or configuration procedures done through the admin console in the same way.

Command Console Procedures

Intrigue Procedures

Writing Explanations

Formatting Tables & Diagrams

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. 

Tables

Tables can be formatted in a few ways, but to maintain consistency, these conventions should be followed.

.Dot Title
[cols="1,3,1" options="header"]
|===
 |cell 1
|cell 2
|cell 3
 |cell 4
|cell 5
|cell 6

|===

.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.

Diagrams


[ditaa,diagram-file-name,png]
....
+--------+
|Object 1|
|cDEF    |
+--------+
....


Formatting Code Blocks

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. 


.[[anchor]]Caption or Description Line
[source,language,linenums]
----
// code ....
----