Skip to content

Collate markdown docs into a PDF document with pandoc #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/md-to-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Markdown to PDF

on: [push, workflow_dispatch]

jobs:
convert_via_pandoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create file list
id: files_list
run: |
echo "files=$(printf '\"%s\" ' *.md | sed 's/ \"sidebar\.md\"/ /' && printf '\"%s\" ' extensions/*.md)" > $GITHUB_OUTPUT
mkdir output
- uses: docker://pandoc/extra:latest-ubuntu
with:
args: >-
--output=output/aseprite-docs.pdf ${{ steps.files_list.outputs.files }}
--pdf-engine=lualatex
-f markdown_github
--include-in-header ./.github/workflows/pdf/header.tex
--include-before-body ./.github/workflows/pdf/title.tex
--file-scope
--table-of-contents
--number-sections
-V mainfont="DejaVu Sans"
-V mainfontoptions:"Extension=.ttf, UprightFont=*, BoldFont=*-Bold"
-V documentclass=article
-V colorlinks
-V urlcolor=NavyBlue
-V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm"
- uses: actions/upload-artifact@master
with:
name: aseprite-docs
path: output/aseprite-docs.pdf
6 changes: 6 additions & 0 deletions .github/workflows/pdf/header.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
\usepackage{listings}
\usepackage{fancyhdr}
\pagestyle{fancy}
\title{Aseprite Documentation}
\setkeys{Gin}{scale=1, height=0.4\textheight, keepaspectratio}
\let\verbatim\undefined\let\verbatimend\undefined\lstnewenvironment{verbatim}{\lstset{breaklines}}{}
4 changes: 4 additions & 0 deletions .github/workflows/pdf/title.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
\date{\today}
\maketitle
\lhead{Aseprite Documentation}
\rhead{\today}