Skip to content

Commit

Permalink
Merge pull request #1 from bigladder/setup-markdown-to-pdf
Browse files Browse the repository at this point in the history
Setup Markdown to PDF tools
  • Loading branch information
nealkruis authored Feb 20, 2024
2 parents a4b429e + 5f1bc01 commit 33abb5c
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test

on: push
on:
push:
schedule:
- cron: "0 9 * * SUN"

jobs:
python-poetry:
Expand Down Expand Up @@ -36,3 +39,20 @@ jobs:
uses: actions/checkout@v4
- name: Setup Mesa3D
uses: ./setup-mesa3d
markdown-to-pdf:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
shell: bash
name: Markdown-to-PDF on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Markdown to PDF
uses: ./setup-markdown-to-pdf
- name: Test
run: echo "**Equation** [@eq:label]:\n\n\$\$E = mc^2\$\$ {#eq:label}" | pandoc -F pandoc-crossref --citeproc -t latex
56 changes: 56 additions & 0 deletions setup-markdown-to-pdf/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Setup Markdown to PDF tooling"
description: "Setup Markdown to PDF tooling"
inputs:
tinytex-version-year:
description: Year portion of the TinyTeX version number, used for historic TeX Live distributions (https://github.com/rstudio/tinytex-releases/releases)
default: "2024"
required: false
tinytex-version-release:
description: Release portion of the TinyTeX version number (https://github.com/rstudio/tinytex-releases/releases)
default: "02"
required: false
use-historic-texlive-distribution:
description: Used if the TeX Live distribution needs to pull from a historic repository
default: 'false'
required: false
pandoc-version:
description: Pandoc version to install (https://github.com/jgm/pandoc/releases)
default: "2.11.3.2"
required: false
crossref-version:
description: Pandoc cross ref version, needs to match pandoc-version (https://github.com/lierdakil/pandoc-crossref/releases)
default: "0.3.9.0a"
required: false
runs:
using: composite
steps:
- name: Install TinyTeX
uses: r-lib/actions/setup-tinytex@v2
env:
TINYTEX_INSTALLER: TinyTeX-1
TINYTEX_VERSION: "${{ inputs.tinytex-version-year }}.${{ inputs.tinytex-version-release }}"
- run: tlmgr --version
shell: pwsh # Needed because tlmgr is .bat file on Windows
- name: Set TeX Live repository
if: inputs.use-historic-texlive-distribution == 'true'
run: tlmgr option repository ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${{ inputs.tinytex-version-year }}/tlnet-final
shell: pwsh # Needed because tlmgr is .bat file on Windows
- name: Update tlmgr
run: tlmgr update --self
shell: pwsh # Needed because tlmgr is .bat file on Windows
- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: ${{ inputs.pandoc-version }}
- name: Install Pandoc crossref (Windows)
if: runner.os == 'Windows'
run: |
curl.exe -L --output pandoc-crossref.7z --url https://github.com/lierdakil/pandoc-crossref/releases/download/v${{ inputs.crossref-version }}/pandoc-crossref-${{ runner.os }}.7z
"C:\Program Files\7-Zip\7z.exe" e -y pandoc-crossref.7z -o/c/Users/runneradmin/bin
shell: bash
- name: Install Pandoc crossref (Non-windows)
if: runner.os != 'Windows'
run: |
curl -L --output pandoc-crossref.tar.xz --url https://github.com/lierdakil/pandoc-crossref/releases/download/v${{ inputs.crossref-version }}/pandoc-crossref-${{ runner.os }}.tar.xz
tar -xf pandoc-crossref.tar.xz -C /usr/local/bin
shell: bash

0 comments on commit 33abb5c

Please sign in to comment.