Roave / DocbookTool

:books: Docbook Tool for static documentation generation from Markdown files
52 stars 4 forks source link

Roave Docbook Tool

Static HTML and PDF generator tool for generating documentation from Markdown files.

Running with Docker

A Docker image is provided with all the pre-built tools. You will need to map several volumes into the container:

Additionally, you can provide environment variables to override the default paths used, or to enable the Confluence functionality.

# Will build the test fixtures and put in a folder called "build"
docker run \
  -v $(pwd)/test/fixture/docbook:/docs-src/book \
  -v $(pwd)/test/fixture/templates:/docs-src/templates \
  -v $(pwd)/test/fixture/feature:/docs-src/features \
  -v $(pwd)/build:/docs-package \
  --rm ghcr.io/roave/docbooktool:latest

# Will build your stuff - replace host paths as appropriate
docker run \
  -v $(pwd)/docs/book:/docs-src/book \
  -v $(pwd)/docs/templates:/docs-src/templates \
  -v $(pwd)/features:/docs-src/features \
  -v $(pwd)/build:/docs-package \
  --rm ghcr.io/roave/docbooktool:latest

# Will generate HTML, PDF, and update any configured Confluence pages
docker run \
  -v $(pwd)/docs/book:/docs-src/book \
  -v $(pwd)/docs/templates:/docs-src/templates \
  -v $(pwd)/features:/docs-src/features \
  -v $(pwd)/build:/docs-package \
  -e DOCBOOK_TOOL_CONFLUENCE_URL=https://confluence.mycompany.com \
  -e DOCBOOK_TOOL_CONFLUENCE_AUTH_TOKEN="<auth token>" \
  --rm ghcr.io/roave/docbooktool:latest --html --pdf --confluence

Usage

bin/docbook-tool [--html] [--pdf] [--confluence]

For example, this command would generate only the HTML documentation:

$ DOCBOOK_TOOL_CONTENT_PATH=/path/to/myproject/docs/book \
> DOCBOOK_TOOL_TEMPLATE_PATH=/path/to/myproject/docs/template \
> DOCBOOK_TOOL_OUTPUT_HTML_FILE=/path/to/myproject/build/docs.html \
> bin/docbook-tool --html
[2021-01-28T12:28:41.000628+00:00] cli.INFO: Writing HTML output to /path/to/myproject/build/docs.html [] []
$

Formatting

We have limited support for YAML front matter:

Additionally, we have a special Markdown syntax:

Example showing all syntax can be seen in test/fixture/docbook/test.md.

Environment variables