stargate / docs

Documentation for Stargate
Apache License 2.0
15 stars 24 forks source link

= Stargate documentation

This repo contains the source files for the Stargate documentation.

The docs are written in AsciiDoc and use Antora to generate the output.

The Stargate docs are organized into two Antora components:

== How do you contribute?

. Fork the https://github.com/stargate/docs[stargate/docs] github repository. . If you have previously cloned the repo, switch to the main branch and do a git pull to get the latest changes. . Create a working branch in your fork with git checkout -b <working-branch>. Use a branch with a description or issue number. . Make your edits to the existing topics. Add your new topic to the appropriate location in the docs-src directory`. . Update the appropriate navigation menu (nav.adoc) for your new topic. . Create your pull request at https://github.com/stargate/docs/pulls[stargate/docs/pulls]. . Assign @polandll as a reviewer for quick turnaround.

== Generating and viewing the HTML output locally

If you wish to build locally to check a docset build, use build-locally.sh.

There are two options (dev-stargate, stargate). One builds the API references in addition to the documentation. Run the command with:

[source, shell, subs="attributes+"]

./build-locally.sh stargate

The script will check for dependencies and install or update any software required for the build.

Open build/site/<docset>, such as build/site/stargate, in a web browser to view the output.

== Repo Dependencies

The build-locally.sh script should take care of installations required to build the docs. However, if you get a message that you need to install NodeJS, run the following commands (Mac OSX):

[source, shell, subs="attributes+"]

brew install node npm install

== Dependencies in package.json

There are some key dependencies for building the documentation with Antora.

[source, plaintext]

"dependencies": { "@antora/cli": "^3.0.1", "@antora/site-generator-default": "^3.0.1", "@redocly/cli": "1.0.0-beta.102", "async": "3.2.4", "mobx": "^6.3.12", "react": "^16.8.4", "react-dom": "^16.8.4", "redoc": "^2.0.0-rc.70", "redoc-cli": "^0.13.14", "rxjs": "7.0.1", "styled-components": "^5.1.1" }

@antora/cli and @antora/site-generator-default are requirements to build with Antora. redoc and redoc-cli are requirements to build the 3-panel API references. @redocly/cli is a requirement for the OpenAPI linter that is used to validate the OpenAPI YAML specification files used to build the 3-panel API references.

[IMPORTANT]

It has been reported that the GraphQL functionality will not work if node-fetch is greater than version 2.6.1. You will need to downgrade that package before building if you encounter errors.

== Viewing the current published HTML output

The current development version of the docs are generated and published at https://stargate.github.io/docs/.

The .github/workflows/antora.yml GitHub action will generate and publish the development docs on pushes to the main branch. Development docs use the playbooks/site-local-<docset>.yaml Antora site configuration file.

== Publishing to the Stargate website

Pushing a tag starting with v will trigger the .github/workflows/publish.yaml action that generates the docs and publishes them to the stargate/website repo in the gh-pages branch. The output will be put in the docs directory. Live docs use the site-publish.yaml Antora site configuration file.

The Deploy to GitHub Pages action uses a repo secret in order to push the changes to stargate/website. To use a different secret:

. https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line#creating-a-token[Create a personal access token]. . https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets[Add it to stargate/docs as a repo secret]. . Update the name of the secret in publish.yaml.

== Reporting bugs

File a https://github.com/stargate/docs/issues[GitHub issue].