neo4j / docs-graphql

GraphQL docs
5 stars 7 forks source link

= Neo4j GraphQL Library

This repo contains the documentation for the Neo4j GraphQL Library.

== Prereqs

== Installation

To install the required packages:


npm i

== Generating HTML output

To convert asciidoc source to HTML:


npm run build

== Viewing HTML output

To view the built site, launch a local server:

  1. npm start
  2. In a browser tab, go to localhost:8000

== Live preview

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.

== Generating asciidoc source files

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.

== Configuring your project

You'll need to update the following for your project

=== antora.yml

Optionally, you can add the following attributes:

=== preview.yml

Antora uses a link:https://docs.antora.org/antora/latest/playbook/[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.

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

Update the information for the sitemap extension:


antora: extensions:

The link:https://www.npmjs.com/package/@neo4j-antora/antora-modify-sitemaps[`antora-modify-sitemaps] Antora extension generates sitemaps for Neo4j docs that include information about the current release only, and makes sure those sitemaps are included in the right output folder when the HTML is built. In this example, a sitemap file would be generated at _build/site/docs-template/1.0/sitemap.xml_. Change the value ofsitemap_versionto the 'current' release version of your project. For example, Neo4j manuals such as the Getting Started Guide or Cypher Manual use 4.4 as their current version, so for those manuals this is set assitemap_version: '4.4`.

=== [Optional] Add an 'Edit this page' link

If your repo is public, you can add an Edit this page 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

=== [Optional] Add a 'preview' note to each page

When we publish preview content to either development or production environments, we prepend an admonition to every page to make it clear that this is preview content, for example, as in link:https://neo4j.com/docs/graph-data-science/2.0-preview/[Graph Data Science 2.0-preview].

You can use the link:https://www.npmjs.com/package/@neo4j-antora/antora-add-notes[antora-add-notes] extension to add content to your pages. Follow the Usage instructions in the package documentation.