Skip to main content

Template

ERDIA generate all documents using ETA template. By modifying the template, you can customize any document. This document describes how to customize documents.

Eject Template

At first, eject template. Template ejecting can do eject command.

npx erdia eject

If the eject command ends successfully, you'll see that various templates have been ejected into the template directory.

HTML Template

The html directory is a template for generating HTML documents. The html/document.eta and html/mermaid.eta files do entry points for the document. The document.eta template is for generating entity specifications. The mermaid.eta template is for generating ER diagrams. If you choose not to generate an entity specification document, the html/mermaid.eta file becomes the index.html file.

The default template file uses bootstrap5 to generate the documentation. It also includes multiple versions of the documentation and indicates in the documentation what is different from the previous version.

Entity version select widget

Markdown Template

The markdown directory is a template for generating Markdown documents. Markdown documents are not split into two document like HTML document: only one document is created, and the document entry point is markdown/document.eta.

PDF Tempalte

The pdf directory is a template for generating PDF documents. A PDF document generates an HTML document and then uses puppeteer to turn it into a PDF file. PDF documents are not split into two documents like HTML document: only one document is created and the document entry point is pdf/document.eta.

PDF format entity specification document

Image Template

The image directory is a template for generating image documents. image format can only extract ER diagrams. After generating the HTML document, extract the mermaid.js diagram image created in the HTML document to an image file using puppeteer. Only svg and png formats are available for image files. The document entry point is image/document.eta.

Image format ER diagram