Skip to content

Commit 1be2677

Browse files
authored
feat(render): support disabling PDF (#38)
Closes #36
1 parent c9c6c54 commit 1be2677

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ with:
6868
([Boolean](#boolean))
6969
Whether to also create a .html file.
7070

71+
### Build PDF
72+
73+
```yaml
74+
with:
75+
build_pdf: value
76+
```
77+
78+
([Boolean](#boolean))
79+
Whether to also create a .pdf file (defaults to `true`. After all, this is the intended behaviour).
80+
7181
### CSS Theme
7282

7383
```yaml

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ inputs:
2424
build_html:
2525
description: '(Boolean) Whether to also create a .html file'
2626
required: false
27+
build_pdf:
28+
description: '(Boolean) Whether to create a .pdf file (the intended behaviour)'
29+
required: false
2730
theme:
2831
description: '(File) The location of the CSS file you want to use as the theme'
2932
required: false

src/github_interface.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ if (!OutputDirIsDir) {
6969
// Whether to also output a <filename>.html file, there is a bit of magic at the end to ensure that the value is a boolean
7070
const build_html = getRunnerInput('build_html', true, booleanTransformer);
7171

72+
// Whether to also output a <filename>.pdf file, there is a bit of magic at the end to ensure that the value is a boolean
73+
// This was requested in #36. No idea why...
74+
const build_pdf = getRunnerInput('build_pdf', true, booleanTransformer);
75+
7276
// Custom CSS and HTML files for theming
7377
const ThemeFile = getRunnerInput('theme', null, getRunnerPath);
7478
const HighlightThemeFile = getRunnerInput('highlight_theme', DEFAULT_HIGHLIGHT_FILE, getRunnerPath);
@@ -148,7 +152,9 @@ async function ConvertMarkdown(file) {
148152
}
149153

150154
// Build the PDF file
151-
BuildPDF(result, file);
155+
if (build_pdf === true) {
156+
BuildPDF(result, file);
157+
}
152158
}
153159

154160
// Assign the style and template files to strings for later manipulation

0 commit comments

Comments
 (0)