A detailed reference for the structure and composition of Quarkus documentation.
Quarkus doc sources are built and synced to the Quarkus.io website at release time.
-
Documentation for Quarkus core and most extensions is located in the
docs
module of the Quarkus GitHub repository. -
Docs for Quarkiverse or other third-party extensions are pulled directly from those repositories.
The Asciidoc files can be found in the src/main/asciidoc
directory within the docs module.
Create new documentation files using the appropriate template for the content type:
- Concepts
-
Use
docs/src/main/asciidoc/_templates/template-concepts.adoc
- How-To Guides
-
Use
docs/src/main/asciidoc/_templates/template-howto.adoc
- Reference
-
Use
docs/src/main/asciidoc/_templates/template-reference.adoc
- Tutorials
-
Use
docs/src/main/asciidoc/_templates/template-tutorial.adoc
- Configuration references
-
Javadoc comments discovered in MicroProfile Config source files are used to generate config reference documentation. These generated files are found in
target/asciidoc/generated/config/
(from the project root). - Asciidoc output as HTML
-
A locally-rendered result of asciidoc processing (which is similar, but not identical, to that used to generate website documentation) is found in
docs/target/generated-docs/
Regardless of content type, ensure that the main title and any headings in your document are:
-
Goal-oriented and use the language and keywords of the audience
-
Descriptive and avoid filler words
-
Between 3-12 words and 50-80 characters per line to optimize findability in search engines
-
In sentence case capitalization style
Your titles and headings must also follow the specific guidance for the Quarkus content types, as outlined in the following table:
Content type | Should … | Good example | Bad example |
---|---|---|---|
Concept |
|
Security and authentication mechanisms in Quarkus |
Discovering Reactive SQL Clients In Quarkus |
How-To Guide |
|
Secure your Quarkus application with WebAuthn authentication |
Applying WebAuthn Authentication In Quarkus |
Reference |
|
Hibernate Reactive API configuration properties |
Reference guide for Configuring Hibernate Reactive API Configuration Properties |
Tutorial |
|
Create a Quarkus application in JVM mode by using the quick start example |
Creating an App |
To make things easier to discover, Quarkus docs are stored in a fairly flat structure. The bulk of the file name should be some representation of its title. Use all lowercase letters, separate words with hyphens, and don’t use symbols or special characters.
- Prefix
-
Use a common prefix to group related documents, e.g. all of the documents related to writing Quarkus docs are prefixed with
doc-
. - Suffix
-
The file name should reflect the type of document:
-
Concept documents should end in
-concepts.adoc
-
How-to guides should end in
-howto.adoc
-
References should end in
-reference.adoc
-
Tutorials should end in
-tutorial.adoc
-
Write clear, concise, and consistent technical information in US English. Write for a global audience with localization, translation, inclusivity, and diversity in mind. Try to use the following grammar styles:
Shorter sentences are much easier to read and translate. Try to use less than 32 words per sentence.
Add a short description that helps your audience to quickly find and understand the purpose and intent of the page.
Try to write the abstract by using the following guidelines:
-
User oriented: Contains terms and keywords that are familiar to users.
-
Concise: Avoids self-referential expressions and filler words, for example, "This document..", "This tutorial..", or "The following.."
-
Brief: Is no more than three sentences long.
Important
|
The first sentence of the abstract must explain the value and some benefit of the content in less than 27 words because this automatically displays on the Quarkus guides homepage. |
Quarkus docs use Asciidoc syntax. The following links provide background on Asciidoc syntax and general conventions.
Text in paragraphs, lists, and tables should be broken into pieces that are easier to review[1]. Start a new line at the end of each sentence, and split sentences themselves at natural breaks between clauses.
Use :toc: preamble
in the document header to insert an automatically generated TOC after the abstract (or preamble) to the document.
For example, this document has the following in its header:
[id="reference-doc-quarkus-documentation"]
= Quarkus documentation reference
include::attributes.adoc[]
:toc: preamble
Section titles should be written in sentence case, rather than title case.
All documents should start with a Title (a = Level 0
heading), and should
be broken into subsections as appropriate
(== Level 1
to ====== Level 5
)
without skipping any levels.
Tip
|
Deep nesting (
See Quarkus documentation concepts for more information about content types and organization. |
In general, prefer using url macros to using bare or automatic links. Provide human-readable text for the link, especially if it is included in the middle of other text.
Note
|
A URL Macro link with attributes
The URL macro also supports additional attributes that may be relevant, like opening a link in a different window. https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/[Asciidoc Syntax Quick Reference,window=_blank,opts=nofollow] The above source produces this link: Asciidoc Syntax Quick Reference. |
Quarkus documentation is built from source in a few different environments. We use attributes in our cross-references to ensure our docs can be built across these environments.
Attribute | Description |
---|---|
|
Relative path to directory containing collected example source files |
|
Relative path to documentation adoc files (e.g. doc-concepts.adoc) |
|
Relative path to source examples for documentation guides |
|
Relative path to generated configuration |
|
Relative path to directory containing images |
|
Relative path to directory containing partial/reusable content ( |
When cross-referencing content, always use the inter-document xref:
syntax and supply a human-readable label to your link.
xref:{doc-guides}/doc-concepts.adoc[Quarkus Documentation concepts] (1)
-
The cross reference starts with
xref:
, uses a cross-reference source attribute({doc-guides}
), and provides a readable description:[Quarkus Documentation concepts]
.
There are many ways to include source code and examples in documentation.
The simplest is to write it directly in the file, like this:
[source,java]
----
System.out.println("Hello, World!");
----
In documents like tutorials, you may want to reference source code that is built and tested regularly.
The Quarkus documentation module build will copy source files enumerated in *-examples/yaml
files into a flattened structure in the target/asciidoc/examples
directory (from the project root).
examples:
- source: path/to/source/file/SomeClassFile.java (1)
target: prefix-simplified-unique-filename.java (2)
-
define the path of source to be copied
-
define the simplified target file name to use when copying the file into the
target/asciidoc/examples
directory. We recommend using the same prefix as the related/consuming documentation in the file name.
Content copied in this way is referenced using the {code-examples}
source attribute. If a copied file contains the literal string {{source}}
, that literal value is replaced with the path of the source file.
-
The source file to be copied is:
integration-tests/micrometer-prometheus/src/main/java/documentation/example/telemetry/micrometer/tutorial/ExampleResource.java
-
The target file name we want to use in docs is:
telemetry-micrometer-tutorial-example-resource.java
. -
The source and target file names are declared in
docs/src/main/asciidoc/telemetry-examples.yaml
:examples: - source: integration-tests/micrometer-prometheus/src/main/java/io/quarkus/doc/micrometer/ExampleResource.java target: telemetry-micrometer-tutorial-example-resource.java
-
Snippets from this source file are then included using the following path:
{code-examples}/telemetry-micrometer-tutorial-example-resource.java
. -
The source file contains the following comment:
// Source: {{source}}
-
The copied file contains this comment instead:
// Source: integration-tests/micrometer-prometheus/src/main/java/io/quarkus/doc/micrometer/ExampleResource.java
The following variables externalize key information that can change over time. References
to such information should use the variable inside of curly brackets, {}
.
The complete list of externalized variables for use is given in the following table:
Property Name | Value | Description |
---|---|---|
|
|
The current version of the project. |
|
|
The location of the project home page. |
|
|
The location of the project GitHub organization. |
|
|
Quarkus GitHub URL common base prefix. |
|
|
Quarkus URL for git clone referenced by the documentation. |
|
|
Quarkus URL to main source archive. |
|
|
Quarkus URL to main blob source tree; used for referencing source files. |
|
|
Quarkus URL to main source tree root; used for referencing directories. |
|
|
Quarkus URL to the issues page. |
|
|
Quarkus URL to set of container images delivered for Quarkus. |
|
|
URL of our chat. |
|
|
Email used to subscribe to our mailing list. |
|
|
Mailing list index page. |
|
|
Quickstarts URL common base prefix. |
|
|
Quickstarts URL for git clone referenced by the documentation. |
|
|
Quickstarts URL to main source archive. |
|
|
Quickstarts URL to main blob source tree; used for referencing source files. |
|
|
Quickstarts URL to main source tree root; used for referencing directories. |
|
|
Recommended GraalVM version to use. |
|
|
The full flavor of GraalVM to use e.g. |