From b85f2f31787bb1576623eaf6ad858a04aa48737f Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Sun, 2 Jan 2022 05:38:13 -0500 Subject: [PATCH] docs(plugins/core): add missing documentation about `optimize` [skip ci] --- source/plugins/core/README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/source/plugins/core/README.md b/source/plugins/core/README.md index f006e873..43fda87c 100644 --- a/source/plugins/core/README.md +++ b/source/plugins/core/README.md @@ -203,7 +203,7 @@ It is possible to configure output behaviour using `output_action` option, which - `gist`, where output will be stored an already existing gist - To use this feature, a `gists` scope must be granted to your `token` and `committer_gist` identifier must be provided -It also possible to alter output condition using `output_action` option, which can be set to: +It also possible to alter output condition using `output_condition` option, which can be set to: - `always`, to always push changes (provided that git sha changed) - `data-changed`, to skip changes if no actual data changed (e.g. when only render timestamp changed) @@ -265,6 +265,8 @@ It could then be processed for other usages. It is possible to convert output to PDF when using a markdown template by setting `config_output` to `markdown-pdf`. +It is advised to keep `config_base64: yes` to encode embed images in base64 and make self-contained documents. + #### ℹ️ Examples workflows ```yaml @@ -274,6 +276,31 @@ It is possible to convert output to PDF when using a markdown template by settin markdown: template.md markdown_cache: .cache config_output: markdown-pdf + config_base64: yes +``` + +### 🗜️ Optimize SVG output + +It is possible to optimize SVG output and reducing its filesize to improve loading times and reduce storage. + +The following optimizations are supported: +- `css`, which purge unused CSS and minify remaining styles +- `xml`, which pretty-print XML (it also helps reducing diffs between commits) +- `svg`, which optimize SVG with SVGO (experimental) + +#### ℹ️ Examples workflows + +```yaml +- uses: lowlighter/metrics@latest + with: + # ... other options + optimize: css, xml + +- uses: lowlighter/metrics@latest + with: + # ... other options + optimize: css, xml, svg + experimental_features: --optimize-svg ``` ### ✨ Render `Metrics insights` statically