Skip to main content

build

The build command is for generating documentation.

Option: format

npx erdia build --format html -o dist/

You can use the format option to generate documents in any format you want. Currently, you need to create a document in HTML format to view multiple versions at single document.

formatdescription
htmlgenerate html document
mdgenerate markdown document
pdfgenerate pdf document
imagegenerate image, only ER diagram

Options

optionaliasrequireddefaultdescription
--versiondisplay version
--helpdisplay help
--data-source-path-drequireddefine the path to TypeORM data source file
--output-odefine the directory to output file
--config-cdefine the path to to configuration file
--components-t'table', 'er'define the output component to builded documents
select one in table, er or both
--project-name'app'define whether project name will come from the package.json name field or database name
select one in app, db
--database-pathdefine the directory to store erdiadb.json
--template-pathdefine the directory to ETA templates
--skip-image-in-htmlfalseenabling the this option will skip attaching the ER diagram image file to the html document. Alpine linux need extra working for puppeteer. In this case you can skip image build stage using this option.
--format'html'define the output format to builded documents
select one in html, md, pdf, image
--version-from'package.json'define whether document version will come from the package.json version field or specific file, timestamp
select one in package.json, file, timestamp
--version-pathIf the versionFrom option set file, read the file from this path
--theme'dark'define the mermaid.js plugin theme. see https://mermaid-js.github.io/mermaid/#/Setup?id=theme
select one in default, dark, forest, dark, neutral, null
--route-base-pathdefine the route base path. The route base path is used as the base path for navbar anchor when generating HTML documents
--titledefine what will be written in the HTML document title tag
--prettier-configdefine the path to the prettier configuration file
--puppeteer-configdefine the path to the puppeteer configuration file
--width'100%'define the ER diagram width. The width is defined by the HTML document css attribute width
--viewport-width1280define the viewport width to puppeteer. The width is defined by the HTML document css attribute width
--viewport-height1440define the viewport height to puppeteer. The width is defined by the HTML document css attribute height
--image-format'svg'define the format to image file
select one in png, svg
--background-color'white'define the background color to html documents
eg. transparent, red, '#F0F0F0'.