Skip to content

Commit

Permalink
add docx renders to the action (#34)
Browse files Browse the repository at this point in the history
This change adds an optional parameter to output a docx version of the file. It's not as pretty as the PDF, but it could be useful for reviewers who would prefer to review the contents using Word.
  • Loading branch information
chrisfenner authored Aug 19, 2022
1 parent 82dd3a6 commit a16444d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/render-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ jobs:
with:
input-md: sample1.md
output-pdf: sample1.pdf
output-docx: sample1.docx

- name: Run the action on sample2
uses: ./
with:
input-md: sample2.md
output-pdf: sample2.pdf
output-docx: sample2.docx

- name: Upload Artifact
uses: actions/upload-artifact@master
with:
name: samples
path: sample*.pdf
path: sample*.*
20 changes: 20 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ inputs:
output-pdf:
description: 'The name of the rendered PDF file'
required: true
output-docx:
description: 'The name of the rendered DOCX file'
runs:
using: 'composite'
steps:
Expand Down Expand Up @@ -81,3 +83,21 @@ runs:
env:
MERMAID_FILTER_THEME: "forest"
MERMAID_FILTER_FORMAT: "pdf"
- run: >
pandoc
--embed-resources
--standalone
--filter=mermaid-filter
--filter=pandoc-crossref
--resource-path=.:/resources
--data-dir=/resources
--from=markdown+implicit_figures
--reference-doc=/resources/templates/tcg_template.docx
--to=docx
${{ inputs.input-md }}
--output=${{ inputs.output-docx }}
shell: sh
if: ${{ inputs.output-docx }}
env:
MERMAID_FILTER_THEME: "forest"
MERMAID_FILTER_FORMAT: "pdf"
6 changes: 6 additions & 0 deletions sample1.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Draft specification, with a list of tables.

## Details

> **Start of informative comment**
>
> Informative comment.
>
> **End of informative comment**
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Expand Down
6 changes: 6 additions & 0 deletions sample2.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Published specification with a list of figures.

## Details

> **Start of informative comment**
>
> Informative comment.
>
> **End of informative comment**
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Expand Down

0 comments on commit a16444d

Please sign in to comment.