From c28cbf9c1a70479a399e501681d4769a1d2c44ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9ry=20Bruniaux?= Date: Thu, 27 Feb 2020 11:35:03 +0100 Subject: [PATCH] version 1.1 - YAML metadata block --- README.md | 30 +-- css/default.css | 1 + css/retenir.css | 23 ++ examples/devoir_notation_scientifique.html | 253 +++++++++++++++++---- examples/devoir_notation_scientifique.md | 15 +- examples/devoir_notation_scientifique.pdf | Bin 35118 -> 38288 bytes examples/proportionnalite.html | 251 +++++++++++++++----- examples/proportionnalite.md | 10 +- examples/proportionnalite.pdf | Bin 123676 -> 135934 bytes examples/tests.html | 90 +++++--- examples/tests.md | 10 +- examples/tests.pdf | Bin 34880 -> 38069 bytes md2htmlpdf | 41 +++- templates/auto_title.template | 74 ++++++ templates/default.template | 1 + templates/lesson.template | 2 +- 16 files changed, 636 insertions(+), 165 deletions(-) create mode 120000 css/default.css create mode 100644 css/retenir.css create mode 100644 templates/auto_title.template create mode 120000 templates/default.template diff --git a/README.md b/README.md index 7a8b2bb..1685093 100644 --- a/README.md +++ b/README.md @@ -38,31 +38,31 @@ If you want to use equations, you need **internet access** to reach the transfor # Syntax for markdown file ? -## Header and Pandoc Title Block +## Header and Yaml Metadata Block All [pandoc extensions](https://pandoc.org/MANUAL.html#pandocs-markdown) for markdown are usable (equation, emoji, tables, ...) -At the beginning of markdown file put a [Pandoc Title Block](https://pandoc.org/MANUAL.html#metadata-blocks) to describe your document like this : +At the beginning of markdown file put a [Yaml Metadata Block](https://pandoc.org/MANUAL.html#extension-yaml_metadata_block) to describe your document like this : +```yaml +--- +title : The Wonderful title +author : My Name +date : 20/04/2018 +what : you want +--- ``` -% The Wonderful title -% My Name -% 20/04/2018 -``` -This block supports multilines : +**After a blank line** you can write your document using markdown syntax. Look example files in examples directory. + +⚠️ This version 1.1 the default template no longer includes title at the beginning of the document. +You can use the `auto_title.template` that works like in previous version. +Or you can write title like in old template with (no number and title class) : ``` -% The Wonderful title - You can have a multilines title like this -% My Name - And my friend - And another one -% 20/04/2018 +# Your nice title {- .title} ``` -**After a blank line** you can write your document using markdown syntax. Look example files in examples directory. - ## Pandoc Markdown extensions You can edit your text using the [standard Markdown syntax](http://commonmark.org/help/). diff --git a/css/default.css b/css/default.css new file mode 120000 index 0000000..b9afe91 --- /dev/null +++ b/css/default.css @@ -0,0 +1 @@ +lesson.css \ No newline at end of file diff --git a/css/retenir.css b/css/retenir.css new file mode 100644 index 0000000..8346472 --- /dev/null +++ b/css/retenir.css @@ -0,0 +1,23 @@ +/* Author : Valéry Bruniaux + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +@import url("lesson.css"); + +ul > li:before { + font-size: 1.1em; + content: "❑"; + content: "➫"; +} + diff --git a/examples/devoir_notation_scientifique.html b/examples/devoir_notation_scientifique.html index 2908253..24588b3 100644 --- a/examples/devoir_notation_scientifique.html +++ b/examples/devoir_notation_scientifique.html @@ -4,8 +4,7 @@ - - Devoir : Univers - Dimensions + devoir_notation_scientifique +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
+

$title$

+ +
+$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ + + diff --git a/templates/default.template b/templates/default.template new file mode 120000 index 0000000..2368b1a --- /dev/null +++ b/templates/default.template @@ -0,0 +1 @@ +lesson.template \ No newline at end of file diff --git a/templates/lesson.template b/templates/lesson.template index 56de597..1f652fa 100644 --- a/templates/lesson.template +++ b/templates/lesson.template @@ -47,8 +47,8 @@ $include-before$ $endfor$ $if(title)$
-

$title$