Skip to content

Commit

Permalink
feat: make all is back
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
  • Loading branch information
greut committed Oct 5, 2023
1 parent e0711db commit 05e4cbe
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 48 deletions.
62 changes: 37 additions & 25 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,60 @@
name: html generation with pandoc
run-name: ${{ github.actor }} is generating new slides
name: Generation with pandoc
run-name: ${{ github.actor }} is generating new slides
on: [push]

env:
PANDOC_VERSION: 3.1.8
# EMOJIONE_VERSION: 8.0.0

jobs:
md2html:
build:
runs-on: ubuntu-latest
concurrency:
group: ci-${{ github.ref_name }}
cancel-in-progress: true
steps:
- run: echo "🎉 Job triggered by a ${{ github.event_name }}, running on ${{ runner.os }}"
- run: |
wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb -O pandoc.deb
sudo dpkg -i pandoc.deb
# - run: |
# wget https://github.com/joypixels/emoji-assets/archive/v${EMOJIONE_VERSION}.tar.gz -O emojione-assets.tgz
# tar xf emojione-assets.tgz
# mv emoji-assets-${EMOJIONE_VERSION} emojione-assets
# wget https://raw.githubusercontent.com/mreq/xelatex-emoji/master/xelatexemoji.sty
# wget https://raw.githubusercontent.com/mreq/xelatex-emoji/master/xelatexemoji-flags.sty
# sed -i 's/^\(\\usepackage{amsmath}\)/%\1/' xelatexemoji.sty
# sed -i 's/^\(\\providecommand{\\xelatexemojipath}\)/%\1/' xelatexemoji.sty

- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4

- run: echo "💡 The branch ${{ github.ref }} from ${{ github.repository }} has been cloned to the runner."

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: >-
fonts-inconsolata
fonts-linuxlibertine
fonts-noto-color-emoji
fonts-texgyre
latexmk
lmodern
make
texlive-fonts-extra
texlive-fonts-recommended
texlive-lang-french
texlive-luatex
texlive-plain-generic
texlive-science
wget
version: 0.1

- run: |
wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb -O pandoc.deb
sudo dpkg -i pandoc.deb
- name: Run the Makefile
run: make slides # XeTeX : I can't find the format file `xelatex.fmt'!
# 2do : https://github.com/pandoc/pandoc-action-example

run: make all

- name: Add index
run: |
echo ${{ github.workspace }}
ls ${{ github.workspace }}
cp ${{ github.workspace }}/templates/index.html ${{ github.workspace }}/build
cp ${{ github.workspace }}/templates/style.css ${{ github.workspace }}/build
echo "🖥️ build dir :"
ls ${{ github.workspace }}/build
cp ./templates/index.html build/
cp ./templates/style.css build/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/master'
with:
folder: build # The folder the action should deploy.
branch: gh-pages

- run: echo "🍏 This job's status is ${{ job.status }}."
2 changes: 1 addition & 1 deletion .latexmkrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$pdflatex = 'xelatex --shell-escape %O %S';
$pdflatex = 'lualatex --shell-escape %O %S';
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ SOURCEDIR = src
TEMPLATES = templates
BUILDDIR = build

PDFENGINE = lualatex

SOURCES=$(wildcard $(SOURCEDIR)/*.md)
SLIDES=$(patsubst $(SOURCEDIR)/%.md,$(BUILDDIR)/%.html,$(SOURCES))
PDFS=$(patsubst $(SOURCEDIR)/%.md,$(BUILDDIR)/%.pdf,$(SOURCES))
Expand Down Expand Up @@ -34,7 +36,7 @@ $(SLIDES): $(BUILDDIR)/%.html : $(SOURCEDIR)/%.md
sed -e 's/(\(img\/\)/($(SOURCEDIR)\/\1/g' "$^" \
| sed -e "\$$a# Sources" \
| pandoc -s \
-f markdown \
-f markdown \
-t dzslides \
--embed-resources \
--standalone \
Expand All @@ -51,9 +53,9 @@ $(PDFS): $(BUILDDIR)/%.pdf : $(SOURCEDIR)/%.md
sed -e 's/(\(img\/\)/($(SOURCEDIR)\/\1/g' "$^" \
| sed -e "\$$a# Sources" \
| pandoc -s \
-f markdown \
-f markdown+emoji \
-t latex \
--pdf-engine=xelatex \
--pdf-engine=$(PDFENGINE) \
--lua-filter=meta.lua \
--lua-filter=english.lua \
--citeproc \
Expand All @@ -69,11 +71,11 @@ $(BOOKS): $(BUILDDIR)/%.tex: $(SOURCEDIR)/%.md
| sed -e 's/<footer>.*<\/footer>//g' \
| sed -e 's/^----*//g' \
| sed -e "\$$a# Sources" \
| pandoc -f markdown \
| pandoc -f markdown+emoji \
-t latex \
--lua-filter=meta.lua \
--lua-filter=english.lua \
--filter=pandoc-citeproc \
--citeproc \
> $@

$(BUILDDIR)/book.pdf: $(TEMPLATES)/book.tex $(BOOKS)
Expand Down
38 changes: 28 additions & 10 deletions templates/book.tex
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\setmonofont[Scale=0.9]{Inconsolata}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text, Numbers=OldStyle, Ligatures={Common,Rare,Discretionary,Historic}}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text, Numbers=OldStyle, Ligatures={Common,Rare,Discretionary}, RawFeature={fallback=emojifallback}}

\usepackage{csquotes}
\usepackage{polyglossia}
Expand All @@ -25,8 +25,7 @@

\usepackage{longtable}
\usepackage{booktabs}


\usepackage{array}

\usepackage{hyperref}
\urlstyle{same}
Expand Down Expand Up @@ -87,7 +86,7 @@
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi

\titlehead{2020-2021}
\titlehead{2023-2024}
\subject{Haute-École Arc}
\title{Développement Web}
\subtitle{Technologies d'interaction}
Expand All @@ -110,14 +109,33 @@

\input{templates/header.tex}

\begin{document}

\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{cslreferences}%
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
{\par}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newlength{\cslentryspacingunit} % times entry-spacing
\setlength{\cslentryspacingunit}{\parskip}
\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
{% don't indent paragraphs
\setlength{\parindent}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1
\let\oldpar\par
\def\par{\hangindent=\cslhangindent\oldpar}
\fi
% set entry spacing
\setlength{\parskip}{#2\cslentryspacingunit}
}%
{}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}

\usepackage{soul}

\begin{document}

\maketitle

Expand Down
16 changes: 10 additions & 6 deletions templates/header.tex
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
% Emoji's
\usepackage{xltxtra}
\usepackage{xelatexemoji}
% Emoji
% via https://tex.stackexchange.com/a/572220
\directlua{luaotfload.add_fallback
("emojifallback",
{
"NotoColorEmoji:mode=harf;"
}
)}

\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text, Numbers=OldStyle, Ligatures={Common,Rare,Discretionary}, RawFeature={fallback=emojifallback}}

% Headings
\usepackage{sectsty}
\allsectionsfont{\sffamily}

% customize the path
\providecommand{\xelatexemojipath}[1]{./emojione-assets/png/64/#1.png}
1 change: 0 additions & 1 deletion templates/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ a.left{
a.right{
float:right;
clear:right;
display: none;
}

a.book{
Expand Down

0 comments on commit 05e4cbe

Please sign in to comment.