#!/bin/bash
#
# PY Barriat, May 2022
#
# Install pandoc & pandac-crossref
# sudo apt install ghc haskell-stack
# stack upgrade --binary-only
# 
# cd /tmp; git clone https://github.com/jgm/pandoc
# cd pandoc; stack install
# 
# cd /tmp; git clone https://github.com/lierdakil/pandoc-crossref.git 
# cd pandoc-crossref; stack install
# 
# cd /tmp; git clone https://github.com/jgm/pandoc-types
# cd pandoc-types; stack install
#
# Download and install diagrams:
# sudo apt install graphviz python3-pydotplus
# pip install diagrams
#
# Install npm (needed for mermaid: nice extension to make diagramm)
# npm i
#

DATE=$(date "+%d %B %Y")

# with diagrams

#python3 scripts/dia_nc_simple.py
#python3 scripts/dia_nc_pelican.py
#python3 scripts/dia_nc_improved.py
#python3 scripts/dia_db_cluster.py
#python3 scripts/dia_nc_dev_simple.py
#python3 scripts/dia_nc_dev_improved.py

# without mermaid

#pandoc -s Projet_brevet.md -o Projet_brevet.pdf \
#    --from markdown \
#    --template assets/eisvogel \
#    --lua-filter assets/columns.lua \
#    --listings

pandoc -s Projet_brevet.md -o Projet_brevet.pdf \
    --from markdown \
    --template assets/eisvogel \
    --filter pandoc-crossref \
    --lua-filter assets/columns.lua \
    --listings \
     -M date="$DATE"

#pandoc -s Complement_technique_Brevet_PYB.md -o Complement_technique_Brevet_PYB.pdf \
#    --from markdown \
#    --template assets/eisvogel \
#    --filter pandoc-crossref \
#    --lua-filter assets/columns.lua \
#    --listings \
#     -M date="$DATE"     

#/opt/quarto/bin/quarto render tufte.qmd --to pdf

# with mermaid

