Skip to content

Commit 445902e

Browse files
committed
Update documentation
1 parent 44cfde6 commit 445902e

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed

source/plugins/core/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,21 @@ It could then be processed for other usages.
239239
config_output: png
240240
```
241241

242+
### 🖨️ Convert output to PDF
243+
244+
It is possible to convert output to PDF when using a markdown template by setting `config_output` to `markdown-pdf`.
245+
246+
#### ℹ️ Examples workflows
247+
248+
```yaml
249+
- uses: lowlighter/metrics@latest
250+
with:
251+
# ... other options
252+
markdown: template.md
253+
markdown_cache: .cache
254+
config_output: markdown-pdf
255+
```
256+
242257
### 🐳 Faster execution with prebuilt docker images
243258

244259
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.

source/templates/markdown/README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,25 @@ For convenience, several useful properties are aliased in [/source/templates/mar
2525
#### ℹ️ Examples workflows
2626

2727
```yaml
28+
# Markdown output
2829
- uses: lowlighter/metrics@latest
2930
with:
3031
# ... other options
3132
template: markdown
32-
filename: README.md # Output file
33-
markdown: TEMPLATE.md # Template file
34-
markdown_cache: .cache # Cache folder
35-
config_output: markdown # Output as markdown file
33+
filename: README.md # Output file
34+
markdown: TEMPLATE.md # Template file
35+
markdown_cache: .cache # Cache folder
36+
config_output: markdown # Output as markdown file
37+
```
38+
39+
```yaml
40+
# PDF output
41+
- uses: lowlighter/metrics@latest
42+
with:
43+
# ... other options
44+
template: markdown
45+
filename: render.pdf # Output file
46+
markdown: TEMPLATE.md # Template file
47+
markdown_cache: .cache # Cache folder
48+
config_output: markdown-pdf # Output as pdf file
3649
```

source/templates/markdown/example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ___
5050

5151
To include SVGs metrics images without creating additional jobs, use the `embed` function:
5252

53-
<%- await embed("example-isocalendar", {isocalendar:true, isocalendar_duration:"full-year"}) %>
53+
<%- await embed(`example-isocalendar`, {isocalendar:true, isocalendar_duration:"full-year"}) %>
5454

5555
It takes two arguments:
5656
- An unique identifier which will be used as filename withing `markdown_cache` folder
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 📒 Markdown template example (pdf)
2+
3+
When using **markdown template**, it is possible to export output as PDF.
4+
5+
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).
6+
7+
## 🧩 Plugins
8+
9+
You can customize your template with both markdown plugins and SVG plugins like below:
10+
11+
<%- await include(`partials/rss.ejs`) %>
12+
13+
<%- await embed(`test-isocalendar`, {isocalendar:true}) %>

0 commit comments

Comments
 (0)