add Makefile, update to require enable local file access

This commit is contained in:
Ava Gaiety W 2025-03-27 16:54:00 -06:00
parent e8f87ba5a8
commit 463242a068
2 changed files with 19 additions and 34 deletions

2
Makefile Normal file
View file

@ -0,0 +1,2 @@
pdf:
pandoc resume.md -f markdown -t pdf --pdf-engine-opt="--enable-local-file-access" --pdf-engine=wkhtmltopdf -c resume-stylesheet.css -s -o resume.pdf

View file

@ -21,47 +21,30 @@ The workflow is pretty simple.
1. Run pandoc to convert the Markdown file to HTML. OR 1. Run pandoc to convert the Markdown file to HTML. OR
1. Run pandoc to convert the Markdown file into a PDF. 1. Run pandoc to convert the Markdown file into a PDF.
```sh
The big difference between Sonya's workflow is that if you want, you can convert from MD -> PDF in one step, rather than two. You can still go from MD -> HTML -> PDF, but if you don't want to have an HTML file, you don't have to. # On macOS
brew install pandoc wkhtmltopdf
I also don't feel like supporting/using Microsoft Word, so I'm not even trying to output to .docx. # On Linux (ubuntu/debian)
sudo apt install pandoc wkhtmltopdf
# Updated instructions for a Mac .. or 2021
A lot has changed since Sonya wrote her blog post and shared her workflow, so here are some updates on how to get started and building/updating your own resume.
# Pre-Requisites.
## [Pandoc](https://pandoc.org) a universal document converter.
```bash
brew install pandoc
```
## [Wkhtmltopdf](https://wkhtmltopdf.org)
```
brew install wkhtmltopdf
```
## Markdown to HTML
```
pandoc resume.md -f markdown -t html -c resume-stylesheet.css -s -o resume.html
``` ```
## Markdown to PDF ## Markdown to PDF
```sh
make
# or...
pandoc resume.md -f markdown -t pdf --pdf-engine-opt="--enable-local-file-access" --pdf-engine=wkhtmltopdf -c resume-stylesheet.css -s -o resume.pdf
``` ```
pandoc resume.md -f markdown -t pdf --pdf-engine=wkhtmltopdf -c resume-stylesheet.css -s -o resume.pdf
## Markdown to HTML
```sh
pandoc resume.md -f markdown -t html -c resume-stylesheet.css -s -o resume.html
``` ```
## HTML to PDF ## HTML to PDF
If you want to convert from HTML to PDF for some reason, you'll need to add a switch to wkhtmltopdf so that it works properly. If you want to convert from HTML to PDF for some reason, you'll need to add a switch to wkhtmltopdf so that it works properly.
``` ```sh
wkhtmltopdf --enable-local-file-access resume.html resume.pdf wkhtmltopdf --enable-local-file-access resume.html resume.pdf
``` ```
# TODO
- [x] [github action](https://github.com/pandoc/pandoc-action-example) will run and create the HTML and PDF file automatically.
- [ ] the Author field in the PDF, it seems to not work when the pdf-engine is set to wkhtmltopdf
- [ ] make a release or a package?