Skip to content

Commit

Permalink
feat: add initial pdf generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Hanford authored and Patrick Hanford committed Jun 25, 2024
1 parent f4f70e8 commit b4167de
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/generate-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Pandoc
- name: Set up Pandoc & LaTeX.
run: |
sudo apt-get update
sudo apt-get install -y pandoc texlive texlive-xetex
sudo apt-get install -y pandoc texlive texlive-xetex texlive-latex-extra
- name: Convert index.md to resume.pdf
- name: Convert index.md to index.pdf.
run: |
if [[ -f "index.md" ]]; then
pandoc index.md -o resume.pdf
echo "index.md has been converted to resume.pdf"
pandoc index.md -o index.pdf --template=templates/ph-simple.tex --pdf-engine=xelatex --from markdown-yaml_metadata_block
echo "Successfully converted 'index.md' to 'index.pdf'."
else
echo "index.md does not exist"
echo "Couldn't find 'index.md'."
exit 1
fi
- name: Upload resume.pdf as artifact
- name: Upload PDF as artifact.
uses: actions/upload-artifact@v3
with:
name: resume-pdf
Expand Down
63 changes: 63 additions & 0 deletions templates/ph-simple.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
% ph-simple
\documentclass[$if(fontsize)$$fontsize$$else$10pt$endif$,letterpaper]{article}

\usepackage{hyperref}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage{underscore}
\usepackage[parfill]{parskip}
\usepackage{lmodern}
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
\usepackage[utf8]{inputenc}

\newcommand{\name}{$name$}

\geometry{
body={6.5in, 9.0in},
left=1.0in,
top=1.0in
}

\markright{\name}
\thispagestyle{empty}

\usepackage{sectsty}
\sectionfont{\rmfamily\mdseries\Large}
\subsectionfont{\rmfamily\mdseries\itshape\large}

$if(numbersections)$
\setcounter{secnumdepth}{5}
$else$
\setcounter{secnumdepth}{0}
$endif$

\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}


\setlist[itemize]{leftmargin=1em,label={--},before=\item[]}

\setlist[description]{leftmargin=0em, style=sameline}

\urlstyle{same}

\begin{document}

{\huge \name}

\bigskip

$if(left-column)$
\begin{minipage}[t]{0.495\textwidth}
$for(left-column)$$left-column$$sep$ \\ $endfor$
\end{minipage}
$endif$
$if(right-column)$
\begin{minipage}[t]{0.495\textwidth}
$for(right-column)$$right-column$$sep$ \\ $endfor$
\end{minipage}
$endif$

$body$

\end{document}

0 comments on commit b4167de

Please sign in to comment.