From 445902e8548c47d2bd6129e9ffe15f3b2a4f3d8b Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Mon, 26 Apr 2021 22:28:39 +0200 Subject: [PATCH] Update documentation --- source/plugins/core/README.md | 15 +++++++++++++++ source/templates/markdown/README.md | 21 +++++++++++++++++---- source/templates/markdown/example.md | 2 +- source/templates/markdown/example.pdf.md | 13 +++++++++++++ 4 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 source/templates/markdown/example.pdf.md diff --git a/source/plugins/core/README.md b/source/plugins/core/README.md index 2a5510e2..626b700c 100644 --- a/source/plugins/core/README.md +++ b/source/plugins/core/README.md @@ -239,6 +239,21 @@ It could then be processed for other usages. config_output: png ``` +### 🖨️ Convert output to PDF + +It is possible to convert output to PDF when using a markdown template by setting `config_output` to `markdown-pdf`. + +#### ℹ️ Examples workflows + +```yaml +- uses: lowlighter/metrics@latest + with: + # ... other options + markdown: template.md + markdown_cache: .cache + config_output: markdown-pdf +``` + ### 🐳 Faster execution with prebuilt docker images If you're using the official release `lowlighter/metrics` as a GitHub Action (either a specific version, `@latest` or `@master`), it'll pull a prebuilt docker container image from [GitHub Container Registry](https://github.com/users/lowlighter/packages/container/package/metrics) which contains already installed dependencies which will cut execution time from ~5 minutes to ~1 minute. diff --git a/source/templates/markdown/README.md b/source/templates/markdown/README.md index 6fc36a88..c3f92415 100644 --- a/source/templates/markdown/README.md +++ b/source/templates/markdown/README.md @@ -25,12 +25,25 @@ For convenience, several useful properties are aliased in [/source/templates/mar #### ℹ️ Examples workflows ```yaml +# Markdown output - uses: lowlighter/metrics@latest with: # ... other options template: markdown - filename: README.md # Output file - markdown: TEMPLATE.md # Template file - markdown_cache: .cache # Cache folder - config_output: markdown # Output as markdown file + filename: README.md # Output file + markdown: TEMPLATE.md # Template file + markdown_cache: .cache # Cache folder + config_output: markdown # Output as markdown file +``` + +```yaml +# PDF output +- uses: lowlighter/metrics@latest + with: + # ... other options + template: markdown + filename: render.pdf # Output file + markdown: TEMPLATE.md # Template file + markdown_cache: .cache # Cache folder + config_output: markdown-pdf # Output as pdf file ``` diff --git a/source/templates/markdown/example.md b/source/templates/markdown/example.md index f4dea05c..90ccc8d3 100644 --- a/source/templates/markdown/example.md +++ b/source/templates/markdown/example.md @@ -50,7 +50,7 @@ ___ To include SVGs metrics images without creating additional jobs, use the `embed` function: -<%- await embed("example-isocalendar", {isocalendar:true, isocalendar_duration:"full-year"}) %> +<%- await embed(`example-isocalendar`, {isocalendar:true, isocalendar_duration:"full-year"}) %> It takes two arguments: - An unique identifier which will be used as filename withing `markdown_cache` folder diff --git a/source/templates/markdown/example.pdf.md b/source/templates/markdown/example.pdf.md new file mode 100644 index 00000000..c92599dd --- /dev/null +++ b/source/templates/markdown/example.pdf.md @@ -0,0 +1,13 @@ +# 📒 Markdown template example (pdf) + +When using **markdown template**, it is possible to export output as PDF. + +See [rendering of this file here](https://github.com/lowlighter/lowlighter/blob/master/metrics.markdown.pdf.md) and [original template source here](https://github.com/lowlighter/metrics/blob/master/source/templates/markdown/example.pdf.md). + +## 🧩 Plugins + +You can customize your template with both markdown plugins and SVG plugins like below: + +<%- await include(`partials/rss.ejs`) %> + +<%- await embed(`test-isocalendar`, {isocalendar:true}) %> \ No newline at end of file