From 9476301aa1959686335db27fc11093cca46b83b2 Mon Sep 17 00:00:00 2001 From: Chris Fenner Date: Fri, 5 Jan 2024 21:47:22 +0000 Subject: [PATCH 1/4] support html output --- action.yml | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/action.yml b/action.yml index 5efcd53..63aa122 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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 }}" ] && --pdf=${{ inputs.output-pdf }} ) + $( [ -n "${{ inputs.output-html }}" ] && --html=${{ inputs.output-html }} ) + $( [ -n "${{ inputs.output-docx }}" ] && --docx=${{ inputs.output-docx }} ) + $( [ -n "${{ inputs.output-tex }}" ] && --latex=${{ inputs.output-tex }} ) ${{ inputs.input-md }} shell: sh - if: ${{ inputs.output-docx }} - env: - MERMAID_FILTER_THEME: "forest" - MERMAID_FILTER_FORMAT: "pdf" From 647fcedaf27ba3005b90c894fc32275722c2b57d Mon Sep 17 00:00:00 2001 From: Chris Fenner Date: Fri, 5 Jan 2024 21:48:00 +0000 Subject: [PATCH 2/4] render html samples --- .github/workflows/render-samples.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/render-samples.yml b/.github/workflows/render-samples.yml index 5b66247..4fa9176 100644 --- a/.github/workflows/render-samples.yml +++ b/.github/workflows/render-samples.yml @@ -25,6 +25,7 @@ jobs: output-pdf: sample1.pdf output-docx: sample1.docx output-tex: sample1.tex + output-html: sample1.html - name: Run the action on sample2 uses: ./ @@ -33,6 +34,7 @@ jobs: output-pdf: sample2.pdf output-docx: sample2.docx output-tex: sample2.tex + output-html: sample2.html - name: Run the action on sample3 uses: ./ @@ -41,6 +43,7 @@ jobs: output-pdf: sample3.pdf output-docx: sample3.docx output-tex: sample3.tex + output-html: sample3.html - name: Upload Artifact uses: actions/upload-artifact@master @@ -50,6 +53,7 @@ jobs: sample*.docx sample*.tex sample*.pdf + sample*.html - name: Check in latest render uses: stefanzweifel/git-auto-commit-action@v4 From 7446ec8d6fa39b793dde966de8971ccfd36fa237 Mon Sep 17 00:00:00 2001 From: Chris Fenner Date: Fri, 5 Jan 2024 21:50:51 +0000 Subject: [PATCH 3/4] add missing echo --- action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 63aa122..d726541 100644 --- a/action.yml +++ b/action.yml @@ -21,9 +21,9 @@ runs: shell: sh - run: > /usr/bin/build.sh - $( [ -n "${{ inputs.output-pdf }}" ] && --pdf=${{ inputs.output-pdf }} ) - $( [ -n "${{ inputs.output-html }}" ] && --html=${{ inputs.output-html }} ) - $( [ -n "${{ inputs.output-docx }}" ] && --docx=${{ inputs.output-docx }} ) - $( [ -n "${{ inputs.output-tex }}" ] && --latex=${{ inputs.output-tex }} ) + $( [ -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 From 5508f0935ab7ed7c021c0531b3366e089a8b3806 Mon Sep 17 00:00:00 2001 From: Chris Fenner Date: Fri, 5 Jan 2024 21:54:33 +0000 Subject: [PATCH 4/4] use a subset of different output types to test the action --- .github/workflows/render-samples.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/render-samples.yml b/.github/workflows/render-samples.yml index 4fa9176..da0244a 100644 --- a/.github/workflows/render-samples.yml +++ b/.github/workflows/render-samples.yml @@ -33,7 +33,6 @@ jobs: 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 @@ -41,9 +40,6 @@ jobs: with: input-md: sample3.md output-pdf: sample3.pdf - output-docx: sample3.docx - output-tex: sample3.tex - output-html: sample3.html - name: Upload Artifact uses: actions/upload-artifact@master