đź“ť reaction-docs
is the new static documentation generator for all Reaction Commerce projects.
- Node, 6.x and above
- Yarn
- Docker
- Docusaurus, for static-site documentation generation
- Markdown for Docs
- React for components
- highlight.js for JavaScript, HTML, CSS, shell syntax highlighting
- Prism.js for JSX, GraphQL syntax highlighting
- Algolia DocSearch
- ESLint configured with Reaction Commerce eslint config
- LiveReload during development
- Docker
git clone git@github.com:reactioncommerce/reaction-docs.git
cd reaction-docs
bin/setup
docker-compose up
Open localhost:4000
- Add a new Markdown file in
public-docs
. - At the start of the file, add the required frontmatter:
---
id: doc2
title: document number 2
---
- Add the Markdown file to the table of contents, at
website/sidebars.json
- The server uses LiveReload, so as soon as you save, you should see the changes at
localhost:4000
.
For more Markdown features, including autogenerated table of contents, refer to Docusaurus docs.
Save the image in website/static/assets and reference it like this:
![](/assets/admin-dashboard.png "Reaction Dashboard")
Reference other articles by their filename:
Refer to the [FAQs](faqs.md) article
Supports js
, jsx
, graphql
, html
, sh
, git
, yaml
and more.
The Header, Footer, index page and version pages are developed in React and CSS within the website/core
and website/static
directories. Site configuration details are managed in website/siteConfig.js
.
docker-compose up -d && docker-compose logs -f
docker-compose run --rm web yarn lint
docker-compose run --rm web yarn lint:fix:eslint
docker-compose run --rm web [...]
will run any command inside a Docker container and then remove the container.
docker-compose run --rm web yarn install \
&& docker-compose down --rmi local \
&& docker-compose build \
&& docker-compose up
Tests are stubbed out for now.
Add a new version
docker-compose run --rm web yarn run version <version>
Rename an existing version to a new name
docker-compose run --rm web yarn run rename-version <currentVersion> <newVersion>
See Versioning guide for more.
- Add a new version
docker-compose run --rm web yarn run version <version-number>
- Restart the container:
docker-compose down && docker-compose up
-
Run locally to confirm the version number has been changed on
localhost:4000
, and the previous version has been added tolocalhost:4000/versions
list. -
If all things look good, push the branch up to make a pull request.
-
Merge to
master
to auto-deploy
Merging to staging
will trigger a CircleCI build to https://reaction-docs-staging.reactioncommerce.com/
Merging to master
will trigger a CircleCI build to http://reaction-docs-production.netlify.com