This repo contains the files that you need to start a new Neo4j documentation project.
-
npm
To view the built site, launch a local server:
-
npm start -
In a browser tab, go to
localhost:8000
When you run npm start, the project is monitored for updates to asciidoc files.
If a change to an asciidoc file is detected the site is automatically rebuilt.
If you are creating new documentation from scratch, creating all the asciidoc files can be time-consuming. This repo contains a script that you can use to save time by generating skeleton asciidoc files from your navigation.
To use the script, first create your navigation file, or files if your doc set has more than one component. To use the script, all navigation files should have the filename content-nav.adoc.
Then, to create the asciidoc source files, run npm run adoc-gen.
For every file that is included as a list item entry in a content-nav.adoc file, an asciidoc file is created in the location specified.
For example, if modules/ROOT/content-nav.adoc includes * xref:installation/introduction.adoc[], a file is created at modules/ROOT/pages/installation/introduction.adoc.
The file contents consist of a comment to indicate that the file was generated by the script, and a top level title element. If title text is specified in the entry in the navigation file, that value will be used for the title in the generated file. If no title text is specified, the default title text is taken from the filename, formatted with sentence capitalization.
Update the following files to configure your project:
-
antora.yml -
preview.yml -
publish.yml
Update the following values:
name-
Replace
docs-templatewith the name of the project as it will appear in the URL https://neo4j.com/docs/<PROJECT_NAME>`, for example 'getting-started', 'cypher-manual'. title-
Provide the title of the manual, for example Getting Started Guide, Cypher Manual. This value is displayed in the breadcrumbs above each page.
version-
Provide the version number or name for the content that is generated from the branch containing this
antora.ymlfile.
Optionally, you can also add the following attributes:
display_version-
Use this attribute when you want the version that is displayed in your content and in the UI to be different from the version that appears in the URL. For example, you might want to use /2.0/ in URLs, but display the version as
2.0-betain the version selector drop-down. prerelease-
if you publish multiple versions of this project, you can mark a version as being a prerelease, by adding
prerelease: true. The content is published alongside the other versions, and will still be displayed in the version selector, but is not included when Antora is calculating the current (or 'latest') version of any docs content. The version that is considered to be current is used in our build and publish pipeline in several ways: to resolve links between pages; to generate a sitemap for the current documentation; to ensure each published page specifies the correct canonical URL. For more information about versions in Antora, see Antora // Docs → Identify a Prerelease Version
Antora uses a playbook to determine what content is included in a site, and the appearance of that content.
In our projects, we use preview.yml as the default playbook name for local builds and PR verification builds.
Update the start_page attribute to match the value of the name attribute in your antora.yml file.
site: start_page: docs-template:ROOT:index.adoc
In our projects, we use publish.yml as the default playbook name for builds that generate publishable HTML output.
Note the key differences between preview.yml and publish.yml:
-
In
preview.yml, in content sources, the only branch listed isHEAD, which is the working branch whenever you are making changes to source files. Inpublish.yml, multiple branches can be listed, to generate HTML for multiple versions of the content. -
The
neo4j-base-uriandneo4j-docs-base-uriattributes are different in the two playbooks, so that when you use thelink:macro to link to neo4j.com URLs that are not part of the docset you are building, the links resolve correctly in local preview and in the published documentation.
Make the same update the start_page attribute as in preview.yml.
If your repo is public, you can add a Raise an issue link to your pages to encourage external contributors, and to provide a quick way for users to suggest changes.
Update the following attribute in your playbook:
asciidoc:
attributes:
page-origin-private: false