- Clone the repo
git clone ssh://[email protected]/pseudobabble/docgen.git
- Add a PNG header with transparent background named
docs-header.png
, replacingdocs-header.placeholder
.
- Install
pandoc
and the requred LaTeX packages:
sudo apt install pandoc texlive-fonts-recommended texlive-latex-recommended
- Make the script executable
chmod +x generate_documentation_pdf.sh
- Run against markdown docs
./generate_documentation_pdf.sh "<<TARGET_MARKDOWN_FILE>>" "<<DOC_TITLE>>" "<<PRODUCT_AND_VERSION>>"
Example: (Path quoting avoids issues with spaces in filenames)
./generate_documentation_pdf.sh "../some_docs/Markdown Docs.md" "Document Title" "product_name 1.1.0-alpha.0""
Since pandoc
and LaTeX
don't always play nicely with MacOS, a Dockerfile is provided.
- Change to repo directory
cd docgen
- Build the image
docker build -t docgen -f ubuntu.Dockerfile .
- Run against markdown docs
docker run --user `id -u`:`id -g` -v /the/directory/containing/the/documentation/markdown:/the/directory/containing/the/documentation/markdown docgen "/the/directory/containing/the/documentation/markdown/the_markdown_documentation.md" "<<DOC_TITLE>>" "<<PRODUCT_AND_VERSION>>"
There is a bash script, docker-docgen.sh
, which wraps the main docker command and takes the same arguments as the bare-metal script:
chmod +x docker-docgen.sh
./docker-docgen.sh "../some_docs/Markdown Docs.md" "Document Title" "product_name 1.1.0-alpha.0""
- Optionally obtain <<DOC_TITLE>> from the
.md
filename or document title - Handle tables