Coder Social home page Coder Social logo

md-to-pdf's Introduction

Markdown to PDF Action

This action will find any markdown, .md, files and generate a .pdf file for each one. This action can be used in conjunction with a commit action to add the generated .pdf back to the repository. The example shows how to...

  1. Checkout the code
  2. Convert all markdown files (.md) to .pdfs, Note: You can filter the paths to only run on certain file types.
  3. Open a PR back to the repo with the generated .pdfs.

This action uses the pandoc library installed on Ubuntu.

Example

name: Convert PDF to Markdown

on:
  push:
    paths:
    - '**.md'

jobs:
  convert_md: 
    runs-on: ubuntu-latest
    steps:
    # We must checkout the latest version of the code to get a copy of all .md files
    - name: Checkout Code
      uses: actions/[email protected]
      with:
        fetch-depth: 1
    - name: Create .pdfs
      uses: scottypate/[email protected]
      env: {
        # Use this parameter to determine where the generated .pdf(s) will be stored.
        PDF_DIR: './pdfs'
      }
    - name: Create Pull Request
      uses: peter-evans/[email protected]
      env:
        # The token is built in to actions. No config required.
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        COMMIT_MESSAGE: Add .pdf files.
        PULL_REQUEST_TITLE: Add .pdf files.
        PULL_REQUEST_BRANCH: pdf-add
        PULL_REQUEST_BODY: :wave: Here are the .pdf files you requested.
        PULL_REQUEST_REVIEWERS: scottypate

md-to-pdf's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.