From 6ae902b02230048f2f3ef964a7edac0bca768b9e Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 17 Jan 2026 12:21:53 +0100 Subject: add proper mermaid support Use pdf as default format for pandoc-plot. This improves rendering and makes plot content accessable in the document. --- common.mk | 2 +- pandoc/defaults/pandoc-plot.yml | 57 +++++++++++++++++++++++++++++++++++++++++ templates/slides.md | 12 +++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 pandoc/defaults/pandoc-plot.yml diff --git a/common.mk b/common.mk index 87433b69..644adb68 100644 --- a/common.mk +++ b/common.mk @@ -17,7 +17,7 @@ PANDOC_CITE_OPTIONS := --citeproc PANDOC_FILTER_OPTIONS := --lua-filter "$(PANDOC_FILTER_DIR)/center-img.lua" PANDOC_FILTER_OPTIONS += --lua-filter "$(PANDOC_FILTER_DIR)/include-files.lua" PANDOC_FILTER_OPTIONS += --lua-filter "$(PANDOC_FILTER_DIR)/meta-vars.lua" -PANDOC_FILTER_OPTIONS += --filter pandoc-plot +PANDOC_FILTER_OPTIONS += --filter pandoc-plot -M plot-configuration=$(PANDOC_DIR)/defaults/pandoc-plot.yml COMMON_PANDOC_OPTIONS := --data-dir="$(PANDOC_DIR)" --resource-path="$(COMMON_IMAGES):." $(PANDOC_FILTER_OPTIONS) PANDOC := pandoc $(PANDOC_CITE_OPTIONS) $(COMMON_PANDOC_OPTIONS) diff --git a/pandoc/defaults/pandoc-plot.yml b/pandoc/defaults/pandoc-plot.yml new file mode 100644 index 00000000..f94954e2 --- /dev/null +++ b/pandoc/defaults/pandoc-plot.yml @@ -0,0 +1,57 @@ +# Dereived from the example configuration. Everything in this file is optional. +# Please refer to the documentation to know about the parameters herein. +# +# The `executable` parameter for all toolkits can be either the +# executable name (if it is present on the PATH), or +# the full path to the executable. +# E.g.: +# executable: python3 +# executable: "C:\Python37\Scripts\python.exe" + +# The following parameters affect all toolkits +# Directory where to save the plots. The path can be relative to pandoc-plot's +# current working directory, or absolute. +directory: .build/plots/ + +# Whether or not to include a link to the source script in the caption. +# Particularly useful for HTML output. +source: false + +# When `strict: false`, pandoc-plot will leave code blocks untouched if a plot +# could not be generated. This could happen if, for example, a toolkit is not +# installed. If you want pandoc-plot to fail instead, use `strict: true`. +strict: false + +# Default density of figures in dots per inches (DPI). +# This can be changed in the document specifically as well. +dpi: 300 + +# Default format in which to save the figures. This can be specified +# individually as well. +format: PDF + +# Logging configuration +logging: + # Possible verbosity values: debug, error, warning, info, silent + verbosity: warning + # If the filepath below is not present, then pandoc-plot will log to stderr + # Otherwise, log messages will be appended to the filepath. + # filepath: path/to/file.txt + +# The possible parameters for the Matplotlib toolkit +matplotlib: + # preamble: matplotlib.py + tight_bbox: false + transparent: false + executable: python + command_line_arguments: + +# The possible parameters for the graphviz toolkit +graphviz: + # preamble: graphviz.dot + executable: dot + command_line_arguments: + +mermaid: + executable: mmdc + command_line_arguments: --pdfFit -s 5 --backgroundColor=transparent diff --git a/templates/slides.md b/templates/slides.md index 26eba53a..445d9d02 100644 --- a/templates/slides.md +++ b/templates/slides.md @@ -114,3 +114,15 @@ Mache was anderes. \rowcolor{red!30} red line & yeah \\ \rowcolor{blue!30} blue line & wuhu \\ \end{tabularx} + +## Timeline + +```{.mermaid} +timeline + title History of Social Media Platform + 2002 : LinkedIn + 2004 : Facebook + : Google + 2005 : YouTube + 2006 : Twitter +``` -- cgit v1.2.3