Skip to content

Latest commit

 

History

History
118 lines (90 loc) · 4.57 KB

AsciiDocTemplateReporter.md

File metadata and controls

118 lines (90 loc) · 4.57 KB

AsciiDoc template reporters

The AsciiDoc template reporters create reports using a combination of Apache Freemarker templates and AsciiDoc with AsciidoctorJ as Java interface and AsciidoctorJ PDF as PDF file generator for the PDF Template Reporter. For each Freemarker template provided using the options described below a separate intermediate file is created that can be processed by AsciidoctorJ. If no options are provided, the "disclosure_document" template is used, and if security vulnerability information is available also the "vulnerability_report" template.

General report options

  • template.id: A comma-separated list of IDs of templates provided by ORT. Currently, the "disclosure_document" and "vulnerability_report" templates are available.
  • template.path: A comma-separated list of paths to template files provided by the user.

Supported formats

AsciiDoc

Use the AdocTemplateReporter to create AsciiDoc files from a Freemarker template. This template can be passed to the report command using --report-option (or -O) with the template.id option.

cli/build/install/ort/bin/ort report
  -i [scanner-output-dir]/scanner-result.yml
  -o [reporter-output-dir]
  -f AdocTemplate
  --report-option AdocTemplate=template.id=[template-id]

PDF

After the intermediate AsciiDoc files are generated, they are processed by AsciidoctorJ or to be more precise by its PDF implementation AsciidoctorJ PDF. A PDF theme can be handed over to AsciidoctorJ PDF in which properties like fonts or images displayed in the PDF can be adjusted; see the Theme Guide. The path to this theme can be set in the options as described below. Note that only one theme can be set that is used for all given templates. If no theme is given, or the given path to the theme file does not exist, an in-built theme of AsciidoctorJ PDF is used.

cli/build/install/ort/bin/ort report
  -i [scanner-output-dir]/scanner-result.yml
  -o [reporter-output-dir]
  -f PdfTemplate
  --report-option PdfTemplate=template.id=[template-id]
  --report-option PdfTemplate=pdf.theme.file=pdf-theme.yml

If you want to add your own custom fonts in the AsciiDoc PDF theme file using a relative path, you need to add the directory in which the fonts are located as a report-specific option like

--report-option PdfTemplate=pdf.fonts.dir=path/to/fonts/

where path/to/fonts is the relative path to the font directory from the base execution directory.

PdfTemplate report options

  • pdf.theme.file: A path to an AsciiDoc PDF theme file. Only used with the "pdf" backend.
  • pdf.fonts.dir: A path to a directory containing custom fonts. Only used with the "pdf" backend.

HTML

Create an HTML report from the Freemarker template using Asciidoctor's HTML converter.

cli/build/install/ort/bin/ort report
  -i [scanner-output-dir]/scanner-result.yml
  -o [reporter-output-dir]
  -f HtmlTemplate
  --report-option HtmlTemplate=template.id=[template-id]

XHTML

Create an XHTML report from the Freemarker template using Asciidoctor's XTML converter.

cli/build/install/ort/bin/ort report
  -i [scanner-output-dir]/scanner-result.yml
  -o [reporter-output-dir]
  -f XhtmlTemplate
  --report-option XhtmlTemplate=template.id=[template-id]

DocBook

Create a DocBook report from the Freemarker template using Asciidoctor's DocBook converter.

cli/build/install/ort/bin/ort report
  -i [scanner-output-dir]/scanner-result.yml
  -o [reporter-output-dir]
  -f DocBookTemplate
  --report-option DocBookTemplate=template.id=[template-id]

Man page

Create a ManPage report from the Freemarker template using Asciidoctor's ManPage converter.

cli/build/install/ort/bin/ort report
  -i [scanner-output-dir]/scanner-result.yml
  -o [reporter-output-dir]
  -f ManPageTemplate
  --report-option DocBookTemplate=template.id=[template-id]