Skip to content

Commit

Permalink
Support html from the action (#60)
Browse files Browse the repository at this point in the history
* support html output

* render html samples

* add missing echo

* use a subset of different output types to test the action
  • Loading branch information
chrisfenner authored Jan 5, 2024
1 parent 73e4d20 commit 47ce4c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/render-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,21 @@ jobs:
output-pdf: sample1.pdf
output-docx: sample1.docx
output-tex: sample1.tex
output-html: sample1.html

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

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

- name: Upload Artifact
uses: actions/upload-artifact@master
Expand All @@ -50,6 +49,7 @@ jobs:
sample*.docx
sample*.tex
sample*.pdf
sample*.html
- name: Check in latest render
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
33 changes: 6 additions & 27 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ inputs:
required: true
output-pdf:
description: 'The name of the rendered PDF file'
required: true
output-html:
description: 'The name of the rendered HTML file'
output-docx:
description: 'The name of the rendered DOCX file'
output-tex:
Expand All @@ -20,31 +21,9 @@ runs:
shell: sh
- run: >
/usr/bin/build.sh
--puppeteer
--pdf=${{ inputs.output-pdf }}
${{ inputs.input-md }}
shell: sh
env:
MERMAID_FILTER_THEME: "forest"
MERMAID_FILTER_FORMAT: "pdf"
- run: >
/usr/bin/build.sh
--puppeteer
--latex=${{ inputs.output-tex }}
${{ inputs.input-md }}
shell: sh
if: ${{ inputs.output-tex }}
env:
MERMAID_FILTER_THEME: "forest"
MERMAID_FILTER_FORMAT: "pdf"
- run: >
/usr/bin/build.sh
--puppeteer
--pdf=${{ inputs.output-pdf }}
--docx=${{ inputs.output-docx }}
$( [ -n "${{ inputs.output-pdf }}" ] && echo --pdf=${{ inputs.output-pdf }} )
$( [ -n "${{ inputs.output-html }}" ] && echo --html=${{ inputs.output-html }} )
$( [ -n "${{ inputs.output-docx }}" ] && echo --docx=${{ inputs.output-docx }} )
$( [ -n "${{ inputs.output-tex }}" ] && echo --latex=${{ inputs.output-tex }} )
${{ inputs.input-md }}
shell: sh
if: ${{ inputs.output-docx }}
env:
MERMAID_FILTER_THEME: "forest"
MERMAID_FILTER_FORMAT: "pdf"

0 comments on commit 47ce4c4

Please sign in to comment.