All Projects → pandoc → Pandoc Action Example

pandoc / Pandoc Action Example

using the pandoc document converter on GitHub Actions

Projects that are alternatives of or similar to Pandoc Action Example

Oscp Exam Report Template Markdown
📙 Markdown Templates for Offensive Security OSCP, OSWE, OSCE, OSEE, OSWP exam report
Stars: ✭ 2,066 (+1477.1%)
Mutual labels:  markdown, latex, pandoc
Letter Boilerplate
Finest letter typesetting from the command line
Stars: ✭ 374 (+185.5%)
Mutual labels:  markdown, latex, pandoc
Pandoc Markdown Template
Markdown templates for Pandoc
Stars: ✭ 135 (+3.05%)
Mutual labels:  markdown, latex, pandoc
Pandoc Starter
📄 My pandoc markdown templates and makefiles
Stars: ✭ 443 (+238.17%)
Mutual labels:  markdown, latex, pandoc
Pandoc Latex Template
A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
Stars: ✭ 3,750 (+2762.6%)
Mutual labels:  markdown, latex, pandoc
Pandoc Plantuml Filter
Pandoc filter for PlantUML code blocks
Stars: ✭ 51 (-61.07%)
Mutual labels:  markdown, latex, pandoc
Markdown Cv
Simple Markdown CV / Resume
Stars: ✭ 97 (-25.95%)
Mutual labels:  markdown, pandoc
Orkestra
Functional DevOps with Scala and Kubernetes
Stars: ✭ 102 (-22.14%)
Mutual labels:  continuous-integration, continuous-delivery
Fabric8 Platform
Generates the distribution of the fabric8 microservices platform
Stars: ✭ 105 (-19.85%)
Mutual labels:  continuous-integration, continuous-delivery
Flint
Fast and configurable filesystem (file and directory names) linter
Stars: ✭ 115 (-12.21%)
Mutual labels:  continuous-integration, continuous-delivery
Science.md
An easy framework for drafting scientific documents: Write (Markdown), Compile (PDF, Word, HTML), Share.
Stars: ✭ 90 (-31.3%)
Mutual labels:  markdown, pandoc
Pipelines
Build pipelines for automation, deployment, testing...
Stars: ✭ 105 (-19.85%)
Mutual labels:  continuous-integration, continuous-delivery
Kontinuous
The Kubernetes Continuous Integration & Delivery Platform (CI/CD) 🔄
Stars: ✭ 115 (-12.21%)
Mutual labels:  continuous-integration, continuous-delivery
Github Slug Action
GitHub Action to expose slug value of GitHub environment variables inside your GitHub workflow
Stars: ✭ 96 (-26.72%)
Mutual labels:  continuous-integration, continuous-delivery
Dyn365 Ce Vsts Tasks
VSTS Extension for Dynamics 365 Customer Engagement
Stars: ✭ 94 (-28.24%)
Mutual labels:  continuous-integration, continuous-delivery
Ecs Nginx Proxy
Reverse proxy for AWS ECS. Lets you address your docker containers by sub domain.
Stars: ✭ 93 (-29.01%)
Mutual labels:  continuous-integration, continuous-delivery
Pandiff
Prose diffs for any document format supported by Pandoc
Stars: ✭ 110 (-16.03%)
Mutual labels:  markdown, pandoc
Jacoco Plugin
Jenkins JaCoCo Plugin
Stars: ✭ 119 (-9.16%)
Mutual labels:  continuous-integration, continuous-delivery
Patat
Terminal-based presentations using Pandoc
Stars: ✭ 1,725 (+1216.79%)
Mutual labels:  markdown, pandoc
Bbrun
Run Bitbucket Pipelines locally
Stars: ✭ 127 (-3.05%)
Mutual labels:  continuous-integration, continuous-delivery

Using pandoc with GitHub Actions

Simple Usage Long Usage Advanced Usage

You can use pandoc, the universal markup converter, on GitHub Actions to convert documents.

GitHub Actions is an Infrastructure as a Service (IaaS) from GitHub, that allows you to automatically run code on GitHub's servers on every push (or a bunch of other GitHub events). For example, you can use GitHub Actions to convert some file.md to file.pdf (via LaTeX) and upload the results to a web host.

Using docker://pandoc Images Directly

You can now directly reference container actions on GitHub Actions. You do not need a separate GitHub Action.

If you need LaTeX (because you want to convert through to PDF), you should use the docker://pandoc/latex image. Otherwise, the smaller docker://pandoc/core will suffice.

It is a good idea to be explicit about the pandoc version you require, such as docker://pandoc/core:2.9. This way, any future breaking changes in pandoc will not affect your workflow. You can find out whatever the latest released docker image is on docker hub. You should avoid specifying no tag or the latest tag -- these will float to the latest image and will expose your workflow to potentially breaking changes.

Simple Usage

You can use pandoc inside GitHub actions exactly as you would use it on the command line. The string passed to args gets appended to the pandoc command.

The below example is equivalent to running pandoc --help.

You can see it in action here.

name: Simple Usage

on: push

jobs:
  convert_via_pandoc:
    runs-on: ubuntu-18.04
    steps:
      - uses: docker://pandoc/core:2.9
        with:
          args: "--help" # gets appended to pandoc command

Long Pandoc Calls

Remember that as per the GitHub Actions workflow syntax, "an array of strings is not supported by the jobs.<job_id>.steps.with.args parameter. Pandoc commands can sometimes get quite long and unwieldy, but you must pass them as a single string. If you want to break up the string over several lines, you can use YAML's block chomping indicator:

name: Long Usage

on: push

jobs:
  convert_via_pandoc:
    runs-on: ubuntu-18.04
    steps:
      - run: echo "foo" > input.txt  # create an example file
      - uses: docker://pandoc/core:2.9
        with:
          args: >-  # allows you to break string into multiple lines
            --standalone
            --output=index.html
            input.txt

You can see it in action here.

Advanced Usage

You can also:

  • create an output directory to compile into; makes it easier to deploy outputs.
  • upload the output directory to GitHub's artifact storage; you can quickly download the results from your GitHub Actions tab in your repo.

Remember that wildcard substitution (say, pandoc *.md) or other shell features frequently used with pandoc do not work inside GitHub Actions yaml files args: fields. Only GitHub Actions context and expression syntax can be used here. If you want to make use of such shell features, you have to run that in a separate step in a run field and store the result in the GitHub actions context. The below workflow includes an example of how to do this to concatenate several input files.

You can see it in action (haha!) here.

name: Advanced Usage

on: push

jobs:
  convert_via_pandoc:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/[email protected]
      - run: |
          echo "Lorem ipsum" > lorem_1.md  # create two example files
          echo "dolor sit amet" > lorem_2.md
          mkdir output  # create output dir
          # this will also include README.md
          echo "::set-env name=FILELIST::$(printf '"%s" ' *.md)"
      - uses: docker://pandoc/latex:2.9
        with:
          args: --output=output/result.pdf ${{ env.FILELIST }}
      - uses: actions/[email protected]
        with:
          name: output
          path: output
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].