Loading pyproject.toml +1 −1 Original line number Diff line number Diff line [project] name = "coliverter" version = "0.2.0" version = "0.2.1" authors = [ { name="Jakob Moser", email="moser@cl.uni-heidelberg.de" }, ] Loading src/coliverter/resources/pandoc-heading-to-title.lua 0 → 100644 +13 −0 Original line number Diff line number Diff line -- From https://stackoverflow.com/a/76048743/, by johndoe (https://stackoverflow.com/users/2520247/johndoe), CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) local title function Header(el) if title then return end title = pandoc.utils.stringify(el) end function Meta(el) if not el.pagetitle then el.pagetitle = title return el end end src/coliverter/steps/md_to_html.py +11 −0 Original line number Diff line number Diff line import importlib.resources as resources import subprocess from pathlib import Path def _get_filter(name: str) -> Path: with resources.path("coliverter.resources", f"pandoc-{name}.lua") as path: return path PANDOC_EXECUTABLE = "pandoc" ACTIVE_MARKDOWN_EXTENSIONS = ("autolink_bare_uris", "emoji", "task_lists") Loading @@ -9,6 +18,8 @@ PANDOC_OPTIONS = ( "--wrap=none", "--standalone", "--css=https://fachschaft.cl.uni-heidelberg.de/wp-content/themes/fscoli-next-master/typography.css", "--variable=lang=de", f"--lua-filter={_get_filter('heading-to-title')}", ) Loading Loading
pyproject.toml +1 −1 Original line number Diff line number Diff line [project] name = "coliverter" version = "0.2.0" version = "0.2.1" authors = [ { name="Jakob Moser", email="moser@cl.uni-heidelberg.de" }, ] Loading
src/coliverter/resources/pandoc-heading-to-title.lua 0 → 100644 +13 −0 Original line number Diff line number Diff line -- From https://stackoverflow.com/a/76048743/, by johndoe (https://stackoverflow.com/users/2520247/johndoe), CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) local title function Header(el) if title then return end title = pandoc.utils.stringify(el) end function Meta(el) if not el.pagetitle then el.pagetitle = title return el end end
src/coliverter/steps/md_to_html.py +11 −0 Original line number Diff line number Diff line import importlib.resources as resources import subprocess from pathlib import Path def _get_filter(name: str) -> Path: with resources.path("coliverter.resources", f"pandoc-{name}.lua") as path: return path PANDOC_EXECUTABLE = "pandoc" ACTIVE_MARKDOWN_EXTENSIONS = ("autolink_bare_uris", "emoji", "task_lists") Loading @@ -9,6 +18,8 @@ PANDOC_OPTIONS = ( "--wrap=none", "--standalone", "--css=https://fachschaft.cl.uni-heidelberg.de/wp-content/themes/fscoli-next-master/typography.css", "--variable=lang=de", f"--lua-filter={_get_filter('heading-to-title')}", ) Loading