cagix / pandoc-lecture

Pandoc Markdown Lecture Template: This project defines a skeleton repo for creating lecture slides and handouts including lecture notes out of Pandoc Markdown (https://pandoc.org/MANUAL.html) using a single source approach.
MIT License
97 stars 18 forks source link

Filter: use Pandoc's citeproc for processing references #166

Open cagix opened 1 year ago

cagix commented 1 year ago

Currently we have a metadata field readings to add recommended reading to a lecture:

readings:
  - key: "Russell2020"
    comment: "Problemlösen: Kapitel 3.1 - 3.3"

During conversion by Hugo we use a custom partial bib.html to translate this into something like

{{ partial "shortcodes/notice.html" (dict
        "page" .
        "style" "info"
        "icon" "fas fa-book-reader"
        "title" "Quellen"
        "content" $c
    )}}

Idea: Let's use Pandoc's citeproc for this and skip the custom partial. We could use a metadata field readings containing "normal" text plus citations, which will be translated in out Pandoc template into a section and afterwards Pandoc+citeproc could do their work ...

<!-- document -->
--- 
readings: |
  Bitte lesen Sie in @Russell2020 das Kapitel "Problemlösen" (Kap. 3.1 - 3.3).
---
$-- template

...

$if(readings)$
## Literatur
$readings$
$end$

## Quellen {#refs .allowframebreaks}

or even

$-- template

...

$if(readings)$
`{{% notice style="info" title="Literatur" icon="fas fa-book-reader" %}}`{=markdown}
$readings$
`{{% /notice %}}`{=markdown}
$end$

## Quellen {#refs .allowframebreaks}

related to #165 and #52 and #30

see also https://github.com/jgm/pandoc/discussions/10012#discussioncomment-10103245