neo4j-documentation / docs-refresh

3 stars 17 forks source link
hacktoberfest

= Neo4j Developer Guides & Static Content

image:https://github.com/neo4j-documentation/docs-refresh/workflows/Publish/badge.svg[Publish] image:https://api.netlify.com/api/v1/badges/da8383ae-5291-433a-a7c8-354b69f1b06b/deploy-status[Netlify Status,link=https://app.netlify.com/sites/docs-neo4j/deploys]

This repository contains several Antora playbooks for building developer resources at:

== Installation

In order to build the content,

[source,sh] npm i

The npm install command will install link:https://docs.antora.org/antora/2.3/cli/[Antora CLI^], which is then used to build the content defined in the Antora Playbooks (*.yml files in the project root).

== Build

To build the content, run the build command:

[source,sh] npm run build

== Preview

You can run a local server to preview the built content by running:

[source,sh] npm start

This will launch a server at http://localhost:8000/

== Publishing

Any changes to the master branch will trigger an automatic rebuild of all content using Github Actions. The action runs the npm run build command which builds the following playbooks using the Antora CLI:

The HTML files built by the build command are uploaded to the static-content.neo4j.com S3 Bucket, where it is synced hourly with the link:neo4j.com[] server. The cronjob runs on the hour, every hour so it may take up to an hour for the content to become live.

NOTE: In addition, we are using Netlify to deploy a preview of the site at: https://docs-neo4j.netlify.app/

== Theme Specifics

For more information on specific theme features, clone the link:https://github.com/neo4j-documentation/documentation-starter[Documentation Starter] and run npm start.

== Migrating from the old Developer Guides

=== Variables, Attributes, etc

Instead of defining variables in a text file (think versions.txt), these are now defined under asciidoc and attributes in either the playbook (eg developer.yml) or inside antora.yml in the content repo.

.developer.yml playbook [source,yaml]

asciidoc: attributes: page-theme: developer page-cdn: /static/assets

.antora.yml in content repo [source,yaml]

asciidoc: attributes: img: https://dist.neo4j.com/wp-content/uploads/ theme: developer neo4j-ogm-version: 3.1.6 spring-data-neo4j-version: 5.1.3.RELEASE neo4j-stable-version: 4.0.3 bolt-driver-version: 1.7.0 java-driver-version: 4.0.1

=== Page Level

[source,adoc]

:level: Beginner [role=expertise] {level}

Becomes:

[source,adoc]

:level: Beginner [role=expertise {level}] {level}

=== Renamed Attributes

[%header,cols=2*] |=== | Old Name | New Name

| slug | Not required | icons | Not required | section | Not required | section-link | Not required | setanchors | Not required | toc | Not required | toc-title | Not required | setanchors | Not required | toclevels | Not required | toc-placement | Not required | northwind | Not required | level | Create an additional attribute called :page-level: |===