Skip to content

Commit

Permalink
Merge pull request #8 from HE-Arc/book
Browse files Browse the repository at this point in the history
Groupement en un cours format pdf.
  • Loading branch information
grunenwald authored Feb 7, 2017
2 parents 68ca2e6 + fbec434 commit 3a21aa8
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 71 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cache: apt
addons:
apt:
packages:
- fonts-inconsolata
- fonts-linuxlibertine
- lmodern
- make
Expand All @@ -18,7 +17,7 @@ addons:

env:
- ACTION=slides
- ACTION=pdfs
- ACTION=pdfs book

script:
- make ${ACTION}
- LANGUAGE= make ${ACTION}
56 changes: 52 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,29 @@ BUILDDIR = build
SOURCES=$(wildcard $(SOURCEDIR)/*.md)
SLIDES=$(patsubst $(SOURCEDIR)/%.md,$(BUILDDIR)/%.html,$(SOURCES))
PDFS=$(patsubst $(SOURCEDIR)/%.md,$(BUILDDIR)/%.pdf,$(SOURCES))
BOOKS=$(patsubst $(SOURCEDIR)/%.md,$(BUILDDIR)/%.tmp,$(SOURCES))

LANGUAGE ?= fr

.PHONY: all
all: slides pdfs
all: slides pdfs # book

.PHONY: slides
slides: $(SLIDES)

.PHONY: pdfs
pdfs: $(PDFS)

.PHONY: book
book: build/book.pdf

.PHONY: clean
clean:
rm -f \
$(foreach slide, $(SLIDES), "$(slide)") \
$(foreach pdf, $(PDFS), "$(pdf)")
$(foreach pdf, $(PDFS), "$(pdf)") \
$(foreach book, $(BOOKS), "$(book)") \
build/book.*
rmdir --ignore-fail-on-non-empty $(BUILDDIR)

$(SLIDES): $(BUILDDIR)/%.html : $(SOURCEDIR)/%.md
Expand All @@ -36,11 +44,51 @@ $(SLIDES): $(BUILDDIR)/%.html : $(SOURCEDIR)/%.md

$(PDFS): $(BUILDDIR)/%.pdf : $(SOURCEDIR)/%.md
mkdir -p $(BUILDDIR)
sed -e 's/(\(img\/\)/($(SOURCEDIR)\/\1/g' "$^" | \
pandoc -s \
sed -e 's/(\(img\/\)/($(SOURCEDIR)\/\1/g' "$^" \
| pandoc -s \
-f markdown \
-t latex \
--latex-engine=xelatex \
-V lang=$(LANGUAGE) \
-V documentclass="scrartcl" \
-V classoption="twoside" \
-V papersize=a4 \
-V fontsize=12pt \
-o "$@"

$(BOOKS): $(BUILDDIR)/%.tmp: $(SOURCEDIR)/%.md
mkdir -p $(BUILDDIR)
$(eval ref := $(shell echo $< | sed -e 's~[\/\-\.]~~g'))
sed -e 's/(\(img\/\)/($(SOURCEDIR)\/\1/g' "$^" \
| sed -e "s~\[\([a-zA-Z0-f_\-\.]*\)\]\([^\[(]\)~[$(ref)-\1]\2~g" \
| sed -e 's/^----*//g' \
| sed -e '0,/<footer>/ s/^#.*$$//g' \
| sed -e 's/<footer>.*<\/footer>//g' \
| sed -e 's/^#/##/g' \
| sed -e 's/^% [0-9]* *\.\(.*\)$$/\n\n# \1/g' \
> $@

build/book.md: $(BOOKS)
cat $(foreach source, $(sort $(BOOKS)), "$(source)") \
> $@

build/book.pdf: build/book.md
pandoc -s \
-f markdown \
-t latex \
--latex-engine=xelatex \
--toc \
-V lang=$(LANGUAGE) \
-V title="Application Web II" \
-V subtitle="HE-Arc Ingénierie" \
-V date="$(shell date +"%d %B %Y")" \
-V papersize=a4 \
-V documentclass="scrreprt" \
-V classoption="twoside" \
-V mainfont="Linux Libertine O" \
-V sansfont="Linux Biolinum O" \
-V monofontoptions=="Scale=0.9" \
-V linkcolor="blue" \
-V urlcolor="blue" \
-o $@ \
$^
2 changes: 1 addition & 1 deletion src/00-presentation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 00.Cours devweb
% 00.Présentation du cours

# Développement web dlm3

Expand Down
8 changes: 5 additions & 3 deletions src/03-Laravel.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
% 03.Laravel
% 03.Laravel 5

# Laravel 5
# Développement web dlm3

## Laravel 5{.title}

![Logo Laravel](src/img/laravel-logo-big.png)

Expand Down Expand Up @@ -182,4 +184,4 @@ $php artisan list
section#pratique ul li ul li{
font-size: 70%;
}
</style>
</style>
2 changes: 2 additions & 0 deletions src/05-JSandDOM.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
% 05.JavaScript & DOM

# Développement web dlm3

## JavaScript & DOM{.title}

<footer>HE-Arc (DGR) 2016</footer>
Expand Down
4 changes: 2 additions & 2 deletions src/09-webservices.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 09. webservices
% 09.Services Web

# Développement web dlm3

Expand Down Expand Up @@ -223,4 +223,4 @@ d'en [faire usage](https://developer.github.com/early-access/graphql/).
overflow: hidden;
}

</style>
</style>
4 changes: 2 additions & 2 deletions src/12-risques.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 12.Risques applicatifs
% 12. Risques applicatifs

# Développement web dlm3

Expand Down Expand Up @@ -210,4 +210,4 @@ ol > li {
font-size: 80%;
}

</style>
</style>
Loading

0 comments on commit 3a21aa8

Please sign in to comment.