Skip to content

Commit

Permalink
Change documentation platform from Docz to Docoff
Browse files Browse the repository at this point in the history
  • Loading branch information
mbohal committed Dec 20, 2022
1 parent 4c1c758 commit 1c14695
Show file tree
Hide file tree
Showing 125 changed files with 25,950 additions and 71,669 deletions.
1 change: 0 additions & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
defaults
not ie > 1
not ie_mob > 1
maintained node versions
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/.docz
/dist
/docs
/node_modules
lib-stats.development.html
lib-stats.html
/site
/src/docs/_assets/generated/*
!.gitkeep
9 changes: 5 additions & 4 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

{
"default": true,
"MD033": false, // Allow inline JSX.
"MD024": false, // Allow duplicate headings
"line-length": {
"code_block_line_length": 120,
"tables": false
},
"no-inline-html": false // Allow inline JSX.
"tables": false,
"code_blocks": false
}
}
58 changes: 26 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,32 @@ In the first place, thank you for your interest in contributing! 🙏

## Development

To build the project:
Dependencies:

1. Install local npm packages: `npm install`
2. Run the build: `npm run build`
* [Docker](https://www.docker.com)
* [NodeJS](https://nodejs.org)

To run the dev server:
### Build the project:

1. Install local npm packages: `npm install`
2. Run the dev server (usually on `http://localhost:3000`): `npm start`
1. Install local npm dependencies: `npm ci`
2. Build: `npm run build`

OR

1. Install local npm dependencies: `npm ci`
2. Build JS: `npm run lib:build`
3. Build MkDocs: `docker compose run --rm --service-ports mkdocs bash -c "sh /root/init-container.sh /workspace && su node -c 'mkdocs build'"`

### Run the dev server:

1. Install local npm dependencies: `npm ci`
2. Start dev server: `npm start`

OR

1. Install local npm dependencies: `npm ci`
2. Trigger JS rebuild: `npm lib:start`
3. Start MkDocs (in another terminal): `docker compose run --rm --service-ports mkdocs bash -c "sh /root/init-container.sh /workspace && su node -c 'mkdocs serve'"`

## Git Workflow

Expand Down Expand Up @@ -108,30 +125,7 @@ To keep React UI consistent and predictable the following guidelines should be o

## Documenting

We use [Docz](https://docz.site) (powered by [Gatsby](https://www.gatsbyjs.com))
as the documentation platform. The documentation itself is written in
[MDX](https://mdxjs.com) format — a human-readable blend of the popular Markdown
and JSX syntax.

Run `npm start` to run the docs in development mode, and open
`http://localhost:3000` in your browser to see the docs in live-reload mode.

A few things to note:

- In order to get component props parsed and rendered by Docz, it's crucial to
**import the component into an MDX file right from its source file** — parsing
a re-exported component (typically via `index.js`) isn't currently supported.

- If you don't want Gatsby to collect **anonymous statistics**, you may want to
disable [Gatsby telemetry](https://www.gatsbyjs.com/docs/telemetry/) by
running `npx gatsby telemetry --disable`.

- If you see the Not found page after having **changed the configuration of Docz
or Gatsby in the live-reload mode,** you may either restart the Docz
development server (`ctrl + c` and `npm start`), or try to edit an MDX file
which makes the Docz rebuild, too.
We use combination of [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/)
and [Docoff](https://github.com/react-ui-org/docoff) as the documentation platform.

- To **make your authoring experience better,** we recommend to make sure your
IDE understands the MDX syntax and is able to help you wrap lines in MD and
MDX files automatically (Jetbrains IDE's and VSCode support both features
out-of-the-box or through a plugin).
Do see their respective documentation for details.
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3"
services:
mkdocs:
build: docker/mkdocs
ports:
- 8000:8000
volumes:
- .:/workspace:z
8 changes: 8 additions & 0 deletions docker/mkdocs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:16

RUN apt-get update && apt-get install -y python3-pip
RUN pip3 install 'mkdocs-material>=8.0.0,<9.0.0'
RUN mkdir /workspace

COPY ./init-container.sh /root/init-container.sh
WORKDIR /workspace
10 changes: 10 additions & 0 deletions docker/mkdocs/init-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

# This script is to be executed when the docker container is started

# Set UID of user `node` on guest to match the UID of the user on the host machine
usermod -u $(stat -c "%u" $1) node
# Set GID of group `node` on guest to match the GID of the users primary group on the host machine
groupmod -g $(stat -c "%g" $1) node

chown -R node /workspace
250 changes: 0 additions & 250 deletions doczrc.js

This file was deleted.

Loading

0 comments on commit 1c14695

Please sign in to comment.