This is a step-by-step guide to writing a new page in Antora. In this guide, I will add a page named example.adoc
to the GraphStudio documentation.
Video walk-through:
Fork the repository at https://github.com/lennessyy/tg-gui, and clone it in your local environment.
Check out the branch you want to work in. Since you are working in a fork, choose the branch that corresponds to the version you are creating documentation for.
Create the document in the pages
directory of the module you are working in.
For example, since I plan to add the page in the GraphStudio module, my file is created at gui/modules/graphstudio/pages/example.adoc
.
nav.adoc
is the navigation file for a module.
You need to register your page on the navigation file in order for it to show up in the left site navigation.
-
If the file is at the root of the
pages
directory, then you only need to provide the filename. -
If it is nested in another directory, you need to provide a relative path to the file from the root of the
pages
directory.
Add the images you will be using in the document to the images
folder of the same module. In my example, this will be the graphstudios/images
folder.
Refer to Asciidoc Documentation to learn more about AsciiDoc syntax.
Note
|
One thing to note is that it takes two carriage returns to start a new paragraph in Asciidoc. This allows you to start every sentence on a new line, and you can spot sentences that are too long. |
To add images in a document, use the image macro(image::
or image:
, followed by the name of the image, followed up square brackets). You do not need to specify any relative path
image::friday-meme.png[] (1) Here is an image image:friday-meme.png[] for work on a Friday. (2)
-
Two colons for a block image
-
One colon for inline images
You can build a local preview of the doc site. Usually this is not necessary since you can already view the rendered output with an IDE plugin, but for the first few times of contributing, this might help you feel more comfortable about your commits.
Clone the repository at https://github.com/lennessyy/doc-site.
Change the url and branches in the antora-playbook.yml
file to your local git repo.
Caution
|
If created a new Git branch that you are using to preview, make sure that the antora.yml file at the root of your source repository do not have duplicate version names between all the branches you are using to build the site.
|