Skip to content

Commit

Permalink
feat(render): support disabling PDF (#38)
Browse files Browse the repository at this point in the history
Closes #36
  • Loading branch information
BaileyJM02 committed Jun 27, 2022
1 parent c9c6c54 commit 1be2677
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ with:
([Boolean](#boolean))
Whether to also create a .html file.

### Build PDF

```yaml
with:
build_pdf: value
```

([Boolean](#boolean))
Whether to also create a .pdf file (defaults to `true`. After all, this is the intended behaviour).

### CSS Theme

```yaml
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ inputs:
build_html:
description: '(Boolean) Whether to also create a .html file'
required: false
build_pdf:
description: '(Boolean) Whether to create a .pdf file (the intended behaviour)'
required: false
theme:
description: '(File) The location of the CSS file you want to use as the theme'
required: false
Expand Down
8 changes: 7 additions & 1 deletion src/github_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ if (!OutputDirIsDir) {
// 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
const build_html = getRunnerInput('build_html', true, booleanTransformer);

// 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
// This was requested in #36. No idea why...
const build_pdf = getRunnerInput('build_pdf', true, booleanTransformer);

// Custom CSS and HTML files for theming
const ThemeFile = getRunnerInput('theme', null, getRunnerPath);
const HighlightThemeFile = getRunnerInput('highlight_theme', DEFAULT_HIGHLIGHT_FILE, getRunnerPath);
Expand Down Expand Up @@ -148,7 +152,9 @@ async function ConvertMarkdown(file) {
}

// Build the PDF file
BuildPDF(result, file);
if (build_pdf === true) {
BuildPDF(result, file);
}
}

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

0 comments on commit 1be2677

Please sign in to comment.