Skip to content

Commit

Permalink
bug correction in YAML block
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeryBruniaux committed Apr 2, 2020
1 parent c28cbf9 commit 440a7fc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
14 changes: 14 additions & 0 deletions css/lesson.css
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,20 @@ padding-left: 15em;
padding: 0 0 0 0.4em;
}

.box {
margin: 0.5em 0;
margin-left:auto;
margin-right:auto;
background-color: none;
/*font-size: 110%;
line-height: 110%;
border: 1px solid white;*/
border: none;
border-radius: 10px;
padding : 0.1em 0.4em;
box-shadow: 0 4px 8px 0 red, 0 6px 20px 0 orange;
}

.warning {
margin: 0.5em 0;
margin-left:auto;
Expand Down
18 changes: 10 additions & 8 deletions md2htmlpdf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ FooterSize="8"
StyleTemplate="$1"
StyleCss="$2"
Title=`echo $3 | cut -f1 -d'.'`
TmpFile="/tmp/md2htmlpdf.tmp"

if [[ $# -lt 1 || $# -gt 3 ]]; then
echo "============================================================="
Expand Down Expand Up @@ -79,17 +80,18 @@ echo "============================================================="
# Actual stable
#pandoc "$Title".md --from=markdown+emoji --to=html5 --self-contained --highlight-style=tango --template="$StyleTemplate" -c "$StyleCss" --number-sections --standalone --webtex="http://latex.codecogs.com/svg.latex?" -o "$Title".html

# Test Pandoc to pdf
# pandoc "$Title".md --from=markdown+emoji --pdf-engine=wkhtmltopdf --highlight-style=tango -c "$StyleCss" --number-sections --webtex="http://latex.codecogs.com/svg.latex?" -o "$Title".pdf

# Yaml
pandoc "$Title".md --from=markdown+emoji+yaml_metadata_block --to=html5 --self-contained --highlight-style=tango --template="$StyleTemplate" -c "$StyleCss" --number-sections --standalone --webtex="http://latex.codecogs.com/svg.latex?" -o "$Title".html


# travail Pandoc to pdf
# pandoc "$Title".md --from=markdown+emoji --pdf-engine=wkhtmltopdf --highlight-style=tango -c "$StyleCss" --number-sections --webtex="http://latex.codecogs.com/svg.latex?" -o "$Title".pdf

echo "============================================================="
echo "=> Make PDF file : $Title.pdf ..."
echo "============================================================="

# === Extract Author name from YAML block
head -n $(sed -n '/---/=' "$Title.md" | head -2 | tail -1) "$Title.md" > $TmpFile
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
Expand All @@ -105,11 +107,11 @@ parse_yaml() {
}
}'
}
eval $(parse_yaml $TmpFile "")
rm $TmpFile
# ===

eval $(parse_yaml "$Title".md "")
echo $author

# pandoc block
#pandoc block
#author=$(head -2 "$Title".md | tail -1)
#author=${author:2}

Expand Down

0 comments on commit 440a7fc

Please sign in to comment.