Standard Document Structure
All standard AsciiDoc documents exist in the pages directory of a module.
Filenames
AsciiDoc documents should be saved as .adoc
files, with the following filename restrictions:
-
All lowercase letters.
-
Words separated by hyphens (
-
). -
No symbols or special characters.
The file’s name is used to create its page URL. Changing a file’s name will break cross references (xrefs) and incoming links to the page from external websites. |
Internal File Structure
A Couchbase AsciiDoc document file should contain the following components:
- A Header
-
Contains the document title and document attributes. Some attributes are required. See Document Title and Header.
- A Body
-
Contains the written content, other than the title, that displays when a user visits the page on our documentation site. See Document Body.
Document Title and Header
Put the title of your AsciiDoc document on the first line of the file.
Mark the title with one equals sign (=
), followed by a blank space, and then the title text.
Every AsciiDoc file stored in a pages directory must have a document title. |
On the second line and any following lines, you can add document attributes. Each attribute must be entered on its own line, as shown:
= The Title of My Document :page-topic-type: concept :description: This is the description of my page! It's short and sweet. :url-query-tut: https://query-tutorial.couchbase.com/tutorial/#1 [abstract] {description} This is the body of my document. Let's get started with N1QL!
You must include the following document attributes for every AsciiDoc file stored in a pages directory:
Attribute | Description | Allowed Values |
---|---|---|
|
The page topic type sets the content type for a page and automatically adds a corresponding badge. These badges help users quickly identify the kind of content they’re going to find on a page. |
|
|
The page description is used for SEO and provides a brief description of the page, which is displayed using the |
Enter a quick description of the content on the page. Emphasize what the user would want to know at a glance. Try to keep it to 1-2 sentences. |
A single blank line signals the end of the header. The document body starts on the next line that has text.
You can include your own custom document attributes, or make use of some of these other useful attributes, based on your page’s content:
Attribute | Description | Allowed Values | ||
---|---|---|---|---|
|
Use the Set the For example, the following would become a valid image include: image::name-of-image.png[] |
Try to keep your images inside the |
||
|
Use the |
Any applicable keyword, separated by commas ( |
||
|
Use the
|
A valid cross reference to a page. For a page in the same module: For a page in a different module: For a page in another repository: When linking to a repository that has a version, you must specify which version in that repository redirects to your current page. |
||
|
If you’re writing content that only applies to a specific edition of Couchbase Server, usually the Enterprise Edition, use the |
|
||
|
Sets the UI layout to assign to a page.
By default, pages use the |
For the list of all available templates, see the docs-ui repository. |
||
|
Include the Set the attribute to Set the attribute to For an example of |
|
||
|
Allows this page to be included inside another page as a partial file.
You only need to set this attribute on a page that you add to the |
|
||
|
Assign a role to a page to change the default CSS or add new CSS styles to the entire page. The exact behavior depends on the assigned role. The |
|
||
|
If you’re writing content that only applies to a beta or specific software version, use the |
Any valid software name and version. For example, |
||
Use the |
|
|||
|
Unset the If You can always override these automatic IDs by assigning your own. |
|
||
|
To add the tabs feature to your page and allow tabbed content blocks, you must set the You can find an example of tabbed content in the Server documentation. |
|
||
|
Controls the generated text for cross references in a document, when linking to block content that has a caption set. For more information, see the AsiiDoc documentation. |
|
Document Body
Write your document body using appropriate AsciiDoc syntax.
Consider making use of:
Ventilated Prose
Write in ventilated prose, putting a single sentence on a single line in your AsciiDoc file. Insert paragraph breaks by adding an empty line between sentences:
This is Sentence 1. This sentence will display as part of the same paragraph as Sentence 1. This is proper ventilated prose. This sentence will start a new paragraph.
Ventilated prose makes reviewing pull request and changes easier for reviewers and maintainers.
Headings
Break up your text into sections using headings. Good heading structure makes scanning your documentation easier for readers.
The number of equals signs (=
) equals the depth of the heading.
Heading 2 titles (indicated by 2 equals signs (==
)) display in the On This Page sidebar on a page.
You can change the depth of headings displayed on the On This Page sidebar with the :page-toclevels: attribute.
You must nest section headings in order. Do not put an Heading 4 section inside a Heading 2 section, without a Heading 3 section in between:
== Heading 2 Section Title (H2) === Heading 3 Section Title (H3) ==== Heading 4 Section Title (H4)
Vale will flag headings that are not properly ordered inside your document.
You also cannot apply any inline formatting to headings.