Export Templates on the Portal

Documentation portal readers can export articles to PDF and DOCX using custom templates. How to prepare a template is described in PDF and DOCX. The administrator adds the finished template to the portal.

Reading portal

Copy the template file to the server at this path:

  • PDF — [ROOT_PATH]/.workspace/assets/pdf/

  • DOCX — [ROOT_PATH]/.workspace/assets/word/

  • ROOT_PATH — the folder set in the variable of the same name in docportal-docker-compose.yaml. If the variable is not set, it is the gramax folder next to docportal-docker-compose.yaml.

  • When installed with Helm, use the portal persistent storage instead of ROOT_PATH — it is the /app/data folder in the container. For details, see Deploy with Helm.

  • If .workspace, assets, pdf, or word folders do not exist at this path, create them manually.

After that, readers can select the template when exporting on the portal. For more on ROOT_PATH, see Deploy on your own server.

Static site

Pass the template path when building the site: --pdf-templates for PDF, --docx-templates for DOCX.

gramax-cli build --pdf-templates [template path] gramax-cli build --docx-templates [template path]

For details, see Deploying as a static website.