Sign inSign up

avtodev/open-rpc-docs-builder

By avtodev

•Updated over 6 years ago

React application to build documentation from OpenRPC schema

Image
0

9.7K

avtodev/open-rpc-docs-builder repository overview

Logo

⁠OpenRPC documentation builder

Build Build Test Status Docker Pulls Issues License

This tool build documentation from OpenRPC⁠ schema. It based on OpenRPC docs-react⁠ component and create-react-app⁠.

You must put open-rpc schema into /app/src/schema/openrpc.json file, then run yarn run build.

Also you can put any additional files into public directory, all files from public will be moved into build directory with built documentation.

⁠Environment variables

Tool support all environment variables from create-react-app⁠

⁠Additional variables
NamePossible valuesDefaultDescription
REACT_APP_THEMEdark, lightlightApplication theme

⁠Examples

All supported docker tags can be found here⁠.

⁠Build using volumes

Run into your shell (your open-rpc schema must be located in ./path/to/your/openrpc.json):

$ mkdir ./public # create directory for generated assets

$ docker run \
    --rm \
    --user "$(id -u):$(id -g)" \
    -v $(pwd)/path/to/your/openrpc.json:/app/src/schema/openrpc.json:ro \
    -v $(pwd)/public:/app/build:rw \
    avtodev/open-rpc-docs-builder:1.2 \
    yarn run build

And then watch into ./public directory.

⁠Docker usage example
FROM avtodev/open-rpc-docs-builder:1.2 AS builder

# Copy openrpc.json file into `/app/src/schemas` derictory
COPY --chown=node ./openrpc.json /app/src/schemas/openrpc.json
# You can copy additional json-schema files into public directory
COPY --chown=node ./schemas/json-schema /app/public/schema

RUN yarn run build

# Optional you can copy built documentation into any other container (eg.: nginx)
FROM alpine:latest

COPY --from=builder /app/build /public

⁠Releasing

New versions publishing is very simple - just update dependencies version(s) in ./package.json file (or make any another changes) and "publish" new release using repo releases page. This action will trigger docker images (re)building (eg.: release v1.2.3 will create or update docker images with tags 1.2 and 1.2.3).

Release version (and git tag, of course) MUST starts with v prefix (eg.: v0.0.1 or v1.2.3) and follows semantic versioning rules

Do not forget to update docker image version tag in "usage example" above

⁠License

MIT. Use anywhere for your pleasure.

Tag summary

Content type

Image

Digest

Size

197.4 MB

Last updated

over 6 years ago

docker pull avtodev/open-rpc-docs-builder:1.3