From ce1012a4f0902d24889348f5359e4788c1048fe3 Mon Sep 17 00:00:00 2001
From: Orestis <orestis.malaspinas@hesge.ch>
Date: Wed, 11 Nov 2020 22:36:00 +0100
Subject: [PATCH] changed headers and makefile

---
 LICENSE.md           |  9 -----
 Makefile             | 11 ++++--
 README.markdown      | 79 --------------------------------------------
 base_1.md            |  4 +--
 base_X.md            |  7 ++--
 command_line.md      |  7 ++--
 delaunay.md          |  9 ++---
 intro.md             |  7 ++--
 ligne_commande.md    |  9 ++---
 make.md              |  7 ++--
 oral.md              |  7 ++--
 pointeurs_avances.md |  9 ++---
 strings.md           |  7 ++--
 tests_assertions.md  |  7 ++--
 14 files changed, 54 insertions(+), 125 deletions(-)
 delete mode 100644 LICENSE.md
 delete mode 100644 README.markdown

diff --git a/LICENSE.md b/LICENSE.md
deleted file mode 100644
index eddd9b5..0000000
--- a/LICENSE.md
+++ /dev/null
@@ -1,9 +0,0 @@
- Copyright (C)  2019  Orestis Malaspinas.
-
-
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license can be downloaded from:
- https://www.gnu.org/licenses/fdl.html.
diff --git a/Makefile b/Makefile
index 6a1bb31..277d6bb 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,9 @@ REVEALOPTIONS += -V theme=white
 MD=$(wildcard *.md)
 HTML=$(MD:%.md=%.html)
 PDF=$(MD:%.md=%.pdf)
+MARKDOWN=$(MD:%.md=%.markdown)
 
-all: $(HTML) $(PDF)
+all: $(MARKDOWN)
 
 %.pdf: %.md metadata.yaml
 	pandoc -s $(OPTIONS) $(PDFOPTIONS) -o $@ $^
@@ -23,10 +24,16 @@ all: $(HTML) $(PDF)
 %.html: %.md metadata.yaml
 	pandoc -s $(OPTIONS) $(REVEALOPTIONS) -o $@ $^
 
+%.markdown: %.md metadata.yaml
+	echo "---" >> $@
+	sed '1 { /^---/ { :a N; /\n---/! ba; d} }' $< > only_header && grep -v -F -x -f  only_header $< > header.yaml && ./yq_linux_amd64 merge metadata.yaml header.yaml > $@
+
+
+
 deploy: all 
 	mkdir -p prog_seq_c_cours
 	cp *.pdf prog_seq_c_cours
 	cp *.html prog_seq_c_cours
 
 clean:
-	rm -f *.pdf *.html
+	rm -f *.pdf *.html *.markdown
diff --git a/README.markdown b/README.markdown
deleted file mode 100644
index 21dcc58..0000000
--- a/README.markdown
+++ /dev/null
@@ -1,79 +0,0 @@
-[![pipeline status](https://githepia.hesge.ch/orestis.malaspin/programmation_sequentielle/cours/badges/master/pipeline.svg)](https://githepia.hesge.ch/orestis.malaspin/programmation_sequentielle/cours/commits/master)
-
-# Cours de programmation séquentielle (1ère année)
-
-Ce projet contient les diapositives du cours de Programmation séquentielle pour la
-filière ITI de HEPIA. Vous pouvez accéder à la dernière version des diapositives en cliquant sur [`ce lien`](http://malaspinas.academy/prog_seq_c_cours/index.html)
-
-# Production des pdf
-
-Le projet est écrit à l'aide de la librairie [`pandoc`](https://pandoc.org/installing.html) dans laquelle on peut inclure du `LaTeX`. 
-
-Afin de compiler le projet vous avez besoin des programmes suivants:
-
-## make
-
-## pandoc (v2.0 ou plus récent)
-
-Il existe un certain nombre de package pour la plupart des distributions linux et aussi pour mac OS ou windows. Consultez le site de [`pandoc`](https://pandoc.org/installing.html) pour plus d'informations concernant l'installation.
-
-## pandoc-crossref 
-
-En supposant que la [plateforme de développement Haskell](http://hackage.haskell.org/platform/) est déjà installée vous pouvez installer pandoc-crossref avec cabal:
-
-``` bash
-cabal update
-cabal install pandoc-crossref
-```
-
-Ou alors vous pouvez également installer les fichiers binaires (ici pour la version 0.3.0.1, pas forcément la plus récente)
-```bash
-mkdir pandoc-crossref
-cd pandoc-crossref
-wget https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.0.1/linux-ghc80-pandoc20.tar.gz
-tar xzvf linux-ghc80-pandoc20.tar.gz
-export PATH=`pwd`:$PATH
-```
-
-Sinon allez voir sur le [site de `pandoc-crossref`](https://github.com/lierdakil/pandoc-crossref).
-	
-## pandoc-numbering
-
-Vous avez besoin d'une installation de python 3.X, du programme `pip`, et vous pouvez faire
-
-``` bash
-pip install --user -U pip panflute pandocfilters  pandoc-numbering
-```
-
-Pour plus d'information voir le [site](https://pypi.python.org/pypi/pandoc-numbering).
-
-## Des packages latex suivant 
-
-### Pour ubuntu ou debian-like
-
-```sudo apt-get install texlive-latex-recommended lmodern texlive-fonts-recommended texlive-latex-extra texlive-fonts-extra dvipng texlive-latex-recommended texlive-lang-french```
-
-### Pour les distributions basées sur Arch Linux (Manjaro, ...)
-
-```bash
-sudo pacman -Sy texlive-bin texlive-core texlive-latexextra texlive-science texlive-fontsextra texlive-formatsextra
-```
-
-## La libraririe librsvg (pour la conversion des images svg en ... autre chose)
-
-### Pour ubuntu ou debian-like
-
-```bash
-sudo apt install librsvg2-2
-```
-
-### Pour les distributions basées sur Arch Linux (Manjaro, ...)
-
-```bash
-sudo pacman -Sy librsvg
-```
-
-## License
-
-See the [LICENSE](LICENSE.md) file for license rights and limitations (GNU Free Documentation License).
-
diff --git a/base_1.md b/base_1.md
index 1b2d86f..077287a 100644
--- a/base_1.md
+++ b/base_1.md
@@ -1,6 +1,6 @@
 ---
-title: Base I
-date: 16 septembre 2020
+title: "Base I"
+date: "16 septembre 2020"
 ---
 
 # Historique (1/2)
diff --git a/base_X.md b/base_X.md
index 7c4cf66..25e124b 100644
--- a/base_X.md
+++ b/base_X.md
@@ -1,6 +1,7 @@
-% Base III
-% Inspirés des slides de F. Glück
-% 2 octobre 2019
+---
+title: Base III
+date: 2 octobre 2019
+---
 
 # Les tableaux (1/6)
 
diff --git a/command_line.md b/command_line.md
index 85cf4f5..50fa6eb 100644
--- a/command_line.md
+++ b/command_line.md
@@ -1,6 +1,7 @@
-% Introduction à la l'interface en ligne de commande
-% O. Malaspinas
-% 16 septembre 2020
+---
+title: Introduction à la l'interface en ligne de commande
+date: 16 septembre 2020
+---
 
 # Introduction
 
diff --git a/delaunay.md b/delaunay.md
index 89c5a18..c895d8b 100644
--- a/delaunay.md
+++ b/delaunay.md
@@ -1,6 +1,7 @@
-% Triangulation de Delaunay
-% Travail pratique de programmation séquentielle
-% 19 février 2020
+---
+title: Triangulation de Delaunay
+date: 19 février 2020
+---
 
 ## Généralités
 
@@ -154,4 +155,4 @@ $$
 \begin{vmatrix}A_{x}-D_{x}&A_{y}-D_{y}&(A_{x}-D_{x})^{2}+(A_{y}-D_{y})^{2}\\B_{x}-D_{x}&B_{y}-D_{y}&(B_{x}-D_{x})^{2}+(B_{y}-D_{y})^{2}\\C_{x}-D_{x}&C_{y}-D_{y}&(C_{x}-D_{x})^{2}+(C_{y}-D_{y})^{2}\end{vmatrix}>0,
 $$
 où $|.|$ signifie le calcul du déterminant.
-* Une façon alternative est donnée dans l'énoncé du travail pratique. Choisissez celle que vous préférez.
\ No newline at end of file
+* Une façon alternative est donnée dans l'énoncé du travail pratique. Choisissez celle que vous préférez.
diff --git a/intro.md b/intro.md
index 5a0b7c3..d25a219 100644
--- a/intro.md
+++ b/intro.md
@@ -1,6 +1,7 @@
-% Programmation séquentielle en C
-% Introduction générale
-% 16 septembre 2020
+---
+title: Introduction générale
+date: 16 septembre 2020
+---
 
 # La hotline
 
diff --git a/ligne_commande.md b/ligne_commande.md
index 9c28928..382b6e5 100644
--- a/ligne_commande.md
+++ b/ligne_commande.md
@@ -1,6 +1,7 @@
-% La ligne de commande
-% Inspirés des slides de F. Glück
-% 16 octobre 2019
+---
+title: La ligne de commande
+date: 16 octobre 2019
+---
 
 # Point d'entrée d'un programme
 
@@ -80,4 +81,4 @@ int main(int argc, char **argv) {
 ```bash
 $ ./prog Paul 29
 Hello Paul, you are 29 years old.
-```
\ No newline at end of file
+```
diff --git a/make.md b/make.md
index 9f0b270..c984b93 100644
--- a/make.md
+++ b/make.md
@@ -1,6 +1,7 @@
-% Introduction à `make`
-% Inspirés des slides de F. Glück
-% 9 octobre 2019
+---
+title: Introduction à `make`
+date: 9 octobre 2019
+---
 
 # Introduction
 
diff --git a/oral.md b/oral.md
index 0e3da6f..b9a9317 100644
--- a/oral.md
+++ b/oral.md
@@ -1,6 +1,7 @@
-% Instructions pour l'oral du 11.12.2019
-% OM, PA, PK
-% 4 décembre 2019
+---
+title: Instructions pour l'oral du 11.12.2019
+date: 4 décembre 2019
+---
 
 ### Administration
 
diff --git a/pointeurs_avances.md b/pointeurs_avances.md
index 55a4c84..b0550ee 100644
--- a/pointeurs_avances.md
+++ b/pointeurs_avances.md
@@ -1,6 +1,7 @@
-% Pointeurs avancés
-% Inspirés des slides de F. Glück
-% 19 février 2020
+---
+title: Pointeurs avancés
+date: 19 février 2020
+---
 
 # Pointeurs avancés
 
@@ -76,4 +77,4 @@ p = &m; // erreur de compilation.
 const int *const p = &n; // la valeur p et *p sont const
 *p = m; // erreur de compilation.
 p = &m; // erreur de compilation.
-```
\ No newline at end of file
+```
diff --git a/strings.md b/strings.md
index 1dfe92b..370aeae 100644
--- a/strings.md
+++ b/strings.md
@@ -1,6 +1,7 @@
-% Chaînes de caractères
-% Inspirés des slides de F. Glück
-% 16 octobre 2019
+---
+title: Chaînes de caractères
+date: 16 octobre 2019
+---
 
 # Rappel: le type `char`{.C}
 
diff --git a/tests_assertions.md b/tests_assertions.md
index be3487a..508be6b 100644
--- a/tests_assertions.md
+++ b/tests_assertions.md
@@ -1,6 +1,7 @@
-% Tests unitaires et assertions
-% Inspirés des slides de F. Glück
-% 9 octobre 2019
+---
+title: Tests unitaires et assertions
+date: 9 octobre 2019
+---
 
 # Tests unitaires
 
-- 
GitLab