Code Monkey home page Code Monkey logo

cagix / pandoc-lecture Goto Github PK

View Code? Open in Web Editor NEW
91.0 4.0 18.0 914 KB

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.

License: MIT License

TeX 13.12% CSS 5.71% Lua 50.82% HTML 17.47% Makefile 9.27% Dockerfile 1.17% Shell 2.45%
lecture-notes lecture-slides homework-sheets exams pandoc pandoc-filter markdown pandoc-lecture handouts teaching-materials

pandoc-lecture's Introduction

title
Pandoc Markdown Lecture Template

This project defines a skeleton repo for creating lecture material, i.e. slides and handouts including lecture notes, homework sheets plus the corresponding evaluation sheets and exams plus solution sheets out of Pandoc Markdown using a single source approach.

History

Slides and Handouts

Originally TeX Live and the beamer class were used to produce slides in PDF format for lecture. A nice handout as article (i.e. not just 2 or 4 slides on a page) in PDF format with additional comments could easily be generated out of the slide source code by adding the \usepackage{beamerarticle} option.

However, there are a few drawbacks:

  • The TeX overhead is particularly high in this scenario: estimated 50 to 80 percent of the slides source code is just TeX code (defining slides and header, defining bullet point lists, ...).
  • Comments, that should appear in the handout, are limited. There is a \note command available in beamer, but using it for larger texts including code listings and headers is rather inconvenient or even impossible.
  • Most students would read the handout using a tablet or an e-book reader, so PDF is not really a suitable format for handouts. HTML or even EPUB would be a much more appropriate choice for this task. There are a number of projects addressing this (e.g. LaTeX2HTML, Hyperlatex, TeX4ht), but the resulting HTML is not really satisfying, and EPUB generation is not even supported.

Using Pandoc Markdown most of the standard TeX structures can be written in a much shorter way. Since Pandoc does not parse Markdown contained in TeX environments, all \begin{XXX} and \end{XXX} commands need to be replaced using redefinitions like \newcommand{\XXXbegin}{\begin{XXX}}.

Also by introducing a notes block/inline (using fenced Divs, new in Pandoc 2.x) in combination with a custom Pandoc filter, the lecture notes can be placed freely at any location in the material. Using the filter the lecture notes do not appear in the slides but in the handout. The lecture notes can contain any valid Markdown or TeX code, even further (sub-) sections.

Pandoc can convert Markdown also to HTML and EPUB. Thus a single source can be used to create lecture slides (PDF) and handouts (HTML/EPUB). Even slide desks in HTML using e.g. reveal.js would be possible.

Homework Sheets

Originally TeX Live and the exam class were used to produce homework sheets in PDF format.

However, there are a few drawbacks:

  • The overhead stemming from the exam class is quite high in this scenario.
  • Generating an evaluation sheet from the homework sheet is not supported by the exam class.

Much of the code required by the exam class (and also quite some TeX code) can be omitted by using Pandoc Markdown. Thus the homework sheets can be written in a much simpler way, saving quite some time.

Deriving an evaluation sheet from the homework sheet can be done by using Pandoc in combination with a customised template.

A Pandoc filter adds up all points (like the functionality provided by the exam class).

Since LaTeX is still used as back end, all TeX macros could be used.

Exams

Originally TeX Live and the exam class were used to produce exams and corresponding solution sheets in PDF format.

Using Pandoc Markdown the task of creating exams with the exam class can be simplified. Since LaTeX is still used as back end, all TeX macros could be used.

Installing and using Pandoc-Lecture

The project Pandoc-Lecture defines a toolchain to generate slides (in PDF format) as well as a website for teaching material from a set of Markdown files. For each unit, the PDF and the HTML page are generated from the same Markdown file:

All required tools are specified in the various installation scripts in the folder cagix/pandoc-lecture/docker/.

There are three ways to use the toolchain defined by the Pandoc-Lecture project:

Installation and usage in these scenarios is described in the following sections.

Option A: Online via GitHub action

You need a suitable build script, e.g. a Makefile, to apply Pandoc and the other tools to your Markdown files. Additionally, you need a GitHub workflow that utilises this Makefile and the composite GitHub-Action defined in the Pandoc-Lecture project (action.yaml).

Build Script

You can use your favourite build script technology. In this example we will demonstrate how to use a Makefile. The following code snippet shows two targets web and slides for calling Hugo and Pandoc, respectively. This example is quite abbreviated, you will find the complete (and working) text in Programmiermethoden-CampusMinden/Prog2-Lecture/Makefile.

To produce the teaching material as a website, invoke make web; and to produce the PDF slide sets, use make slides:

## Create website
web: ...
	hugo $(HUGO_ARGS)

## Create all slides
slides: ...
	pandoc -d beamer $< -o $@

GitHub Workflow

To use your build script and the tools in a CI/CD pipeline on the GitHub runner for producing the teaching materials, you need to define a suitable GitHub workflow. This workflow will first install the required tools using the composite GitHub-Action in action.yaml, and afterwards you can call your own build script from the workflow steps.

Our action will install Pandoc and Pandoc-Lecture in the GitHub runner. If the option hugo is set to 'true' (string!), Hugo and Hugo Relearn theme will also be installed. If the option texlive is set to 'true' (string!), TexLive will be installed along with all the packages needed to produce the Beamer PDF slides. If instead of 'true' the value 'extra' is given, additional packages such as additional fonts will be installed (cf. docker/install-texlive-extra.sh) - however, this requires significantly more space and time during installation! With the option graphviz (value 'true', string!) you can also install GraphViz and Dot.

Here is an example workflow for your project with one job each for the production of the beamer PDF slides and the website for the teaching materials:

name: WORKFLOWNAME
on:
  # push on master branch
  push:
    branches: [master]
  # manually triggered
  workflow_dispatch:

jobs:
  # build slides (pandoc): "make slides"
  slides:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: cagix/pandoc-lecture@master
        with:
          texlive: 'true'
      - run: make slides

      - uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_branch: _slides
          publish_dir: pdf/
          force_orphan: true

  # build lecture notes (hugo): "make web"
  hugo:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: cagix/pandoc-lecture@master
        with:
          hugo: 'true'
      - run: make web

      - uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_branch: _hugo
          publish_dir: docs/
          force_orphan: true

Usually, this workflow has to be saved as a YAML file "WORKFLOWNAME.yaml" in the .github/workflows/ folder of your project (use an appropriate name for your file). Once pushed to your repository, the workflow will be automatically activated as a CI/CD pipeline on the GitHub server by the defined triggers (in this example, if changes are made to the master branch, or if it is manually triggered in the menu Actions > WORKFLOWNAME > Run Workflow). The slides created will be available in the _slides branch, the teaching materials created in the _hugo branch. (Note: Both branches will be overwritten the next time you run the workflow).

Depending on your settings, the "cagix/pandoc-lecture" GitHub action must be enabled for your repository: Settings > Actions > General > Action permissions.

Option B: Locally via Docker container

For local use, the Docker image defined in the project can be used. You'll need to build this Docker image, also you'll need a suitable build script, e.g. a Makefile.

Building the Docker Image

To create the image with the name pandoc-lecture, just clone the project locally, navigate to the sub-folder docker/ and create the Docker image for your architecture via the provided Makefile. For Intel machines this will be the amd64 target, for Apple M1 (also M2 and other ARM-based machines) accordingly arm64:

git clone https://github.com/cagix/pandoc-lecture.git
cd pandoc-lecture/
# Use either of the following steps
make amd64  # Intel
make arm64  # Apple M1/M2/M3, ARM

Once the image has been created, the pandoc-lecture/ folder can be deleted. To renew the image, e.g. after updating the definitions, the above steps have to be repeated.

Working with the Docker Image

The entire toolchain is available in the Docker image named pandoc-lecture. To work with the toolchain, the Docker image needs to be launched and the local working directory has to be mounted into the container. An interactive shell inside the container can be used to access the mounted files and the toolchain in the container from there.

Here is an example of a Makefile for your local project (excerpt from Programmiermethoden-CampusMinden/Prog2-Lecture/Makefile, shortened):

## Start Docker container "pandoc-lecture" into interactive shell
runlocal:
	docker run  --rm -it  -v "$(shell pwd):/pandoc" -w "/pandoc"  -u "$(shell id -u):$(shell id -g)"  --entrypoint "bash"  pandoc-lecture

## Create all slides
slides: ...
	pandoc -d beamer $< -o $@

With make runlocal, issued in your local shell, the container will be launched and an interactive shell (Bash) inside the container will be started. Your local working directory will be mounted into the container, so all files in your local working directory are accessible inside the container. With the above Makefile, you can then produce the PDF slide sets in the interactive shell within the container using make slides. The generated PDF files are automatically available in the local working directory via the mount.

Testing of the website in the local file system

The base URL for the deployment of the produced website has to be defined in the Hugo configuration file (hugo.yaml, variable baseURL).

However, this prevents the generated web pages from being displayed correctly when accessed from the local file system. You would first have to adapt the Hugo configuration to the local URL. However, since this configuration is versioned with Git together with all the other project files, you can easily commit this "broken" configuration by accident.

As an alternative, you can add an additional local file local.yaml to the project root, which will not be versioned (create a corresponding entry in the .gitignore!). This file contains a single line baseURL: "file://<path_to_project>/docs/", specifying the actual path in the local file system to your project. If this file is present, its definition of the baseURL overwrites the original configuration and you can view the generated web pages locally. For the deployment to the LMS, you just need to comment out the single line in the file, so the baseURL from the versioned global configuration will be used again.

Here is an excerpt from a suitable Makefile (see again Programmiermethoden-CampusMinden/Prog2-Lecture/Makefile):

## Define options to be used by Hugo
## local.yaml allows to override settings in hugo.yaml
HUGO_ARGS  = --config hugo.yaml,$(wildcard local.yaml)  --themesDir "$(XDG_DATA_HOME)/pandoc/hugo"

## Create website
web: ...
	hugo $(HUGO_ARGS)

Option C: Locally via native installation

Local use without Docker is also an option for Unix-like operating systems like Linux or macOS (but is not recommended). For this purpose, the specified tools have to be installed manually using the correct versions. The files linked below provide both the download URLs for the respective binaries and the required version numbers:

The content of Pandoc Lecture has to be copied into your local user folder ${HOME}/.local/share/pandoc/. The content of Hugo Relearn-Theme is expected in ${HOME}/.local/share/pandoc/hugo/hugo-theme-relearn/. Both steps can be achieved using the Makefile in Pandoc Lecture:

git clone https://github.com/cagix/pandoc-lecture.git
cd pandoc-lecture/
make install_scripts_locally

You can now work with your build script, e.g. a Makefile, in your local project. In the following example, you see a shortened excerpt from Programmiermethoden-CampusMinden/Prog2-Lecture/Makefile to produce the teaching material as a website with make web or the PDF slide sets with make slides:

## Create website
web: ...
	hugo $(HUGO_ARGS)

## Create all slides
slides: ...
	pandoc -d beamer $< -o $@

The downside of this option would be that you need to manually maintain the installed tools (Pandoc, Hugo, TexLive) as well as the scripts from Pandoc-Lecture and Hugo Relearn-Theme. The versions must always match the specifications in cagix/pandoc-lecture/docker/!

If you want to check the generated artefacts locally, follow the advice given in the "Testing the Web site in the local file system" section above.

Contributing

Questions, bug reports, feature requests and pull requests are very welcome.

Please first check whether your request has already been dealt with in other (open or closed) issues. Feel free to reopen relevant closed issues to add your request there.

When submitting pull requests, please make sure that your feature branch starts at the tip of the current master branch. Upon acceptance (i.e. merging your pull request), your contribution automatically becomes subject to the licence of this repository (MIT).

Credits

See the credits for a detailed list of contributing projects.


License

This work by Carsten Gips and contributors is licensed under MIT.

pandoc-lecture's People

Contributors

atomsoldat avatar cagix avatar cyildiz avatar hasufell avatar jonazz747 avatar malt-r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pandoc-lecture's Issues

Filter: use Pandoc's citeproc for processing references

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 jgm/pandoc#10012 (reply in thread)

Filter: use Pandoc template in pre-processing for Hugo

When pre-processing Markdown files with Pandoc to prepare for website generation with Hugo, use custom Markdown templates for Pandoc. This will replace some day our custom archetype definitions for Hugo ...

This could be something like

---
$if(archetype=="home")$
archetype: home
$end$

title: $title$
...
---

$if(archetype=="lecture-cg")$
${ lecture-cg.md() }
$else-if(archetype=="lecture-bc")$
${ lecture-cg.md() }
$else$
${ lecture.md() }
$endif$
$-- lecture-cg.md

$if(titleblock)$
$titleblock$
$endif$

${ tldr.md() }
${ outcomes.md() }

$body$

${ quizzes.md() }
${ challenges.md() }
${ bib.md() }

related to #52 and #30

Tool: create an online calendar from a schedule or build a schedule using a web calendar

Proposal from @Ironeer in Compiler-CampusMinden/CB-Vorlesung-Master#106: Currently, we create our lecture schedule manually as a Markdown table. In addition to the calendar week, we include the actual day of the week and the date as well as links to the lessons and other information.

It would be nice to offer students a synchronised online calendar to subscribe to.

I see two three approaches: Either create a Google calendar from the course schedule (Markdown), or use an online calendar plus some configuration (YAML) to create the course schedule (Markdown). The latter might be easier to realise. Alternatively, we could create the schedule as Markdown table plus a corresponding .ics file from the configuration in YAML.

Ideally, this should be realised in Lua as a Pandoc filter and integrated into the workflow.


follow-up to Compiler-CampusMinden/CB-Vorlesung-Master#106

[Filter] Generiere Schedule mit Lua-Filter

Der Schedule wird aktuell mit einem Hugo-Shortcode generiert: {{< schedule >}}{=markdown}.

Das funktioniert in der GitHub-Ansicht nicht.

Ein Lua-Filter könnte diese Aufgabe übernehmen. Allerdings müsste dieser manuell gestartet werden und der Inhalt manuell (oder vom Filter) in die Datei kopiert werden, bevor die Markdown-Datei als solche eingecheckt wird. D.h. dieser Filter wäre nicht Teil der allgemeinen Vorverarbeitungstoolchain.

[FEATURE] Extra Style für Aufgaben

Für die Aufgaben sollte es einen eigenen Style für die Aufzählungen geben:

<style type="text/css">
    ul { list-style-type: lower-alpha; }
    ul ul { list-style-type: circle; }
</style>

Hugo kann kein (a) oder a), sondern nur 1. ... dies ist ein einfacher Workaround.

Damit man nicht die Aufzählungen in den Vorlesungen kaputt macht, sollte der komplette Aufgaben-Body in ein eigenes Div eingebettet werden und die Styleanpassung muss danach filtern.

Vgl. auch https://github.com/KI-Vorlesung/Lecture/pull/109/files#r753845238

/cc @cyildiz


closes Artificial-Intelligence-HSBI-TDU/KI-Vorlesung#110


In den Dungeon-Aufgaben wird immer wieder die selbe Struktur verwendet: Ziel, Voraussetzungen, Aufgabe. Das sollte man über das Template abwickeln -- entweder das existierende Template ergänzen (ACHTUNG: Muss für "normale" Aufgaben immer noch passen) oder besser ein neues Template erstellen und einsetzen. Dabei würden dann Ziele und Voraussetzungen in den YAML-Header verschoben und die Struktur so automatisch überall einheitlich.

Siehe auch Artificial-Intelligence-HSBI-TDU/KI-Vorlesung#110

[Filter] include-md may run into an endless recursion

When processing the links and including the Markdown files, it can happen that at some point a file that has already been processed and included is to be included again. This leads to an endless recursion. Example: test/readme.md.

Filter: makedeps enqueues landing pages too late

When a file 'a/b/c/foo.md' is loaded and analysed, the landing page 'a/b/c/readme.md' is added to the queue, followed by any links contained in this current file.

In reality, this can result in the intermediate pages 'a/readme.md' and/or 'a/b/readme.md' not being analysed. This leads to these pages being missing from the generated Hugo web page (it will present dummy pages "here could be your content"), and additionally the sequence in the menu gets mixed up.

Furthermore, it is possible that a file in sequence level "A" contains a link to a file in sequence level "D". This could enqueue the landing page of level "D" earlier than those of level "B" and "C", which would confuse the menu ordering.

[Action] Slides per PPTX?

Slides als PPTX erzeugen und als separater Branch bereitstellen.

Schönes Template basteln!

Vorteil ggü. Beamer/LaTeX: keine TeX-Installation nötig, super schneller Export

Vorteil ggü. Reveal.js: "Laserpointer" auf iPad, Malen mit Stift möglich


Die Folien werden aus Markdown mit Pandoc und LaTeX als Backend erzeugt. Dies wirft mehrere Probleme auf:

  • Feinformatierung im Markdown nötig (Abstände, Skalierungen)
  • Übersetzung dauert relativ lange
  • Docker-Image relativ groß
  • Im fertigen PDF können Elemente nicht mehr verschoben werden (nicht mal in GoodNotes)

Idee: Die Folien als .pptx von Pandoc erzeugen lassen. Einen Master-Foliensatz erstellen und verwenden, der relativ ähnlich zum verwendeten Beamer-Metropolis-Style ist.

Vorteile:

  • (+) Keine Feinformatierung im Markdown nötig (kann im Viewer erfolgen)
  • (+) Übersetzung geht sehr schnell
  • (+) Kein TeX notwendig, Docker-Image wird recht klein
  • (+) Elemente können im Viewer verschoben und bearbeitet werden

Nachteile:

  • (-) Feinformatierung muss immer wieder gemacht werden, sobald die Folien neu generiert werden
  • (-) Malwerkzeuge ragen im .pptx-Viewer leicht ins Bild

[DOCKER] Improve build times

Currently we use pandoc/extra as a base image and install a few additional tools, LaTeX packages and cagix/pandoc-lecture in every single run of our GitHub action.

Fetching pandoc/extra takes about 20 seconds, and installing the additional tools takes about 40 to 50 seconds. Especially installing the additional LaTeX packages costs a lot of that extra time.

Creating the lecture website (Pandoc, Hugo) takes another 40 seconds, so the overhead needed to install it into the base image is quite high - and we don't need all the LaTeX stuff in this case :)

Creating the slides takes about 4..6 minutes. But again, the time required to create the container adds up to a total time of 5..7 minutes.

Here are some ideas for mitigation:

  • Publishing our Docker image on Docker Hub - no build in GitHub action required anymore.
  • Multi-stage build using ready-made images and the GitHub cache:
    • Website:
      • Preprocessing with Pandoc and cagix/pandoc-lecture: markdown -> markdown + structure -> GH cache
      • Compiling with Hugo (using files from GH cache)
    • Slides:
      • Use cagix/pandoc-lecture for pre-processing and building.
      • Compiling with LaTeX
  • Can we store the cagix/pandoc-lecture container in GH cache?
  • Creating a PowerPoint template that resembles the Metropolis Beamer theme as much as possible -> translation to PPTX does not require extra LaTeX packages and is also much faster
  • Switch/Convert to "composite action" (#42)

[Filter] include-mdfile.lua would allow double inclusion of start file

pandoc -L include_mdfiles.lua -t markdown readme.md would include readme.md (again) because of [readme](readme.md) in line 56 in readme.md.

This is due to the fact that the call to Pandoc reads the start document and makes it available in the filter as a list of blocks. The filter iterates over this initial list and then includes all links that have not yet been incorporated. When the filter comes to the block corresponding to line 56, the path readme.md has not yet been processed as such and therefore the readme is included in the readme again at this point.

[Action] Export as PDF

new target to build a pdf version of the lecture material

this could be done using the include-md filter starting with readme.md and using a decent template like Eisvogel ...

Allow for new GH Markdown extensions

GH introduced "alerts" with distinctive styling, like

> [!NOTE]
> Foo bar, wuppie fluppie! 

(see https://github.blog/changelog/2023-12-14-new-markdown-extension-alerts-provide-distinctive-styling-for-significant-content/)

Let's stick with Pandocs divs in Markdown content and use filters for export:

::: note
Foo bar, wuppie fluppie! 
:::

This should probably be in line with #180 ...

How should configuration be changed if docker is not used?

I would like to use this tool, but without Docker. How should I change my Makefiles or other settings if I am not using Docker?

As it is I get an error like this:

docker run --rm -v /pathtodemo:/pandoc -v /pathtodemo/../filters:/filters -v /pathtodemo/../resources:/resources debian-texlive pandoc -t beamer --pdf-engine=pdflatex --default-image-extension=pdf -V theme:metropolis -V themeoptions:numbering=none -V themeoptions:progressbar=foot -V fontsize=smaller --slide-level=2 --lua-filter=../filters/tex.lua --include-in-header=../resources/definitions.tex --include-in-header=../resources/beamer.tex --filter pandoc-citeproc -M suppress-bibliography=true -M link-citations=false -f markdown --data-dir=.. --resource-path=.:./figs:.. -o pm_vl01.pdf vl01.md metadata.yaml make: docker: No such file or directory make: *** [pm_vl01.pdf] Error 1

[Doc] local.yaml dokumentieren

Lokales Bauen: Überschreiben der baseURL in der Hugo-Konfiguration mittels lokaler, nicht versionierter Datei local.yaml mit dem Inhalt: baseURL: "file://<path_to_workingcopy>/docs/".

[Partial] Code für Berechnung der Default-Language-URL für Images/Files auslagern

Partial/Attachments.html und Shortcodes/Img.html nutzen den selben Code für die Berechnung der URL für Images/Files, um auch bei mehreren Sprachen immer den Link zur Default-Sprache zu nutzen (die Artefakte werden quasi nur in der Default-Language abgelegt und hier nicht ordentlich "geerbt").

=> Code auslagern in eigenes Partial. Achtung: Kontext ... (alle Variablen über Scratch mitgeben).

[Hugo] CSS für Quellenhinweis für light-/dark-Mode anpassen

In hugo/hugo-lecture/layouts/partials/custom-header.html wird für die Quellenhinweise (Span .origin) die Schriftart festgelegt und ein leicht grauer Hintergrund definiert:

.origin {
    background-color: #ededed;
    font-size: 0.8em;
}

Das kann man im dark-Mode nicht mehr gut lesen. Entweder anpassen und zwei verschiedene Definitionen für light- vs. dark-Mode oder Einbindung vorhandener Möglichkeiten aus dem Theme (Icon, Notice)?

Support for Localization

This is a follow up from #4 (comment #4 (comment)). Thanks to @innomadic!

So far, there is quite a mix of different languages regarding the "API", i.e. used keywords in divs, spans and attributes, like attribut "punkte" in used in homework sheets.

Also, some of the generated documents, mostly exam and homework sheets, are to some extend language dependend. So it would be desirable to support some kind of localization.

Tasks:

  • Clean up "API" and filters etc. => use English language only
  • Strategy for localization needed

[Partial] Code für Berechnung des Sprachsuffix für Logos auslagern

Partial/Logo.html und Partial/Favicon.html nutzen den selben Code für die Berechnung "Sprach-angepassten" Logos/Favicons, um bei mehreren Sprachen ein eigenes Logo/Favicon passend zur Sprache zu nutzen.

=> Code auslagern in eigenes Partial. Achtung: Kontext ... (alle Variablen über Scratch mitgeben).

[Hugo] Ersetze Hugo mit Quarto? Oder alternativ Hugo-Geekdocs? Oder manuelle Pandoc-Templates?

Aktuell gibt es zwei Workflows: Ausgehend von Pandoc-Markdown-Files wird

  1. mit Pandoc und LaTeX+Beamer ein Foliensatz erzeugt, und
  2. mit Pandoc und Hugo+Relearn eine Webseite erzeugt.

Angedacht ist zusätzlich die Veröffentlichung als PDF oder ePub (Buch).


Das Hugo-Relearn-Theme ist ganz nett für eine Vorlesungsseite, ist aber auf Dauer zu "barock" und schrill. Ein schlichteres Theme ala Geekdocs wäre schön. Allerdings ist der Aufwand für die Umstellung recht hoch, auch wenn das eigentlich nur ein (anderes) Hugo-Theme ist. Auch ganz nett für Hugo: Docsy.

Mit Quarto gibt es einen integrierten Ansatz, der ein ähnliches minimalistisches Theme mitbringt inklusive der Navigation links+rechts ala mkDocs. Unter der Haube wird Pandoc eingesetzt, d.h. die Filter könnten weiter verwendet werden. Es gibt auch einen PDF-Export, wobei noch unklar ist, ob das nur Datei-weise ist oder für das gesamte Projekt funktioniert. Außerdem gibt es hier bereits fertige GH-Actions vom Projekt, die man direkt nutzen könnte. Allerdings steht das Projekt unter GNU GPL v2, was sich ggf. auf die damit erzeugten Artefakte auswirkt? Außerdem ist das Projekt vergleichsweise groß mit vielen Bereichen, die hier nicht benötigt werden.


@cagix note2self: hugo muss mittelfristig wieder raus aus der toolchain. erstelle templates mit ähnlicher funktionalität (hugo + hugo-learn-theme) direkt für pandoc.

Originally posted by @cagix in https://github.com/Compilerbau/Lecture/issues/62#issuecomment-926567791

https://github.com/ashki23/pandoc-bootstrap ist ein Projekt mit einfachen HTML-Templates, mit denen man eine halbwegs modern aussehende Webseite erzeugen kann. Dark Mode geht leider nicht, könnte aber vermutlich nachgebaut werden.

Die Struktur des Projekts muss von Hand in die Navigation übertragen werden.


Jekyll und just-the-docs könnten auch ein interessantes Gespann sein. Die generierten Seiten sind sehr minimalistisch und recht ansehnlich. Beispiel: Stanza – A Python NLP Package for Many Human Languages (Stanford University). Vorteil: Theme ist super schlicht und gut lesbar, Jekyll liegt hinter GH-Pages. Nachteil: Jekyll hat keine Binaries und muss per Ruby-Gem installiert werden (Default-Ruby auf macOS zu alt).

[Hugo] Abbildungen für light-/dark-Mode passend anzeigen

Für GitHub kann man zwei verschiedene Abbildungen bereit stellen und einbinden, so dass passend zum Mode die passende Abbildung angezeigt wird. (Quelle: GitHub Docs: Specifying the theme an image is shown to)

In Relearn Theme werden Abbildungen mit einem leicht modifizierten Markdown-Abbildungslink eingebunden und eine nette "Lightbox" erzeugt: https://mcshelby.github.io/hugo-theme-relearn/cont/markdown/index.html#images

=> Wie kriegt man beide Welten zusammen?

Filter: rewritelinks should support warping

when target links are being "warped" in makedeps filter, the resulting makefile dependencies are correct. however, the removed folder (part) can still be part of a link in the markdown sources, and in case of a "readme.md" the file name will be replaced by the rewrite filter with the name of the parent folder. we need to make sure that we do not use here a "warped" folder!

Add support for "mathescape" in listings

In order to use math characters in listings, you may use the option mathescape for lstlistings:

---
title: "Listing Test"
keywords: "Listing"
---

Minimierung eines DFAs
----------------------

Generiere eine untere Dreieckstabelle D, die am Anfang leer ist.

\begin{lstlisting} [mathescape, backgroundcolor=\color{lightgray},language = Pascal,
basicstyle=\scriptsize\ttfamily]
for each (p, q); p, q $\in$ Q, p $\neq$ q
  if (p $\in$ F and q $\notin$ F) or (p $\notin$ F and q $\in$ F)
    D(p, q) = $\epsilon $

do until there are no changes
  for each (q, p), p, q $\in$ $Q$, p $\neq$ q
    for each a $\in$ $\Sigma$
      if D (p, q) is blank and
          D($\delta$(p, a), $\delta$(q, a)) is not blank
        D(p, q) = a

for each entry in D with D(p, q) is blank
  combine p and q to one state
\end{lstlisting}

This poses problems:

  • The frame must be declared "fragile", which pandoc does not do because of the raw latex environment
  • The package "listings" must be imported

Note to myself: Using the pandoc option "--listings" in combination with fenced divs is not a real solution here, because all other listings would also be rendered as "lstlisting". In this case (two lecturers sharing a lecture project, one using pandoc's internal syntax highlighting and the other using the listings package like in the example above), this would lead to different makefiles or the need to set up environment variables ... A solution that can be defined in and/or activated locally per lecture file is therefore preferred.

Integrate Quizdown - Quizzes direkt im Skript?

hugo-quiz and quizdown-js


Gibt es JavaScript-Lösungen oder andere Lösungen, so dass man die Quizzes direkt in die Vorlesungsskripte einbetten kann? Die Lösungen müssten in der Webseite codiert sein und über ein Javascript müsste die eingegebene Lösung gegen die Vorgabe geprüft und eine Rückmeldung angezeigt werden.

Was ist mit "Ankhi"-Cards? Was ist mit https://github.com/bonartm/hugo-quiz und https://github.com/bonartm/quizdown-js?

Edit: Alternativ könnten die Quizzes direkt in die Lecture-Seiten eingebunden werden: https://github.com/bonartm/hugo-quiz (siehe McShelby/hugo-theme-relearn#507)

siehe auch Programmiermethoden-CampusMinden/Prog2-Lecture#331

siehe auch Artificial-Intelligence-HSBI-TDU/KI-Vorlesung#145

Table compatibility with pandoc 2.11

Hi,

Just found this very nice package and when trying it, I hit this problem with pandoc 2.11.1 where exams could not be generated.
Error:

Error running filter ../filters/exams.lua:
PandocLuaError "Error during function call: ../filters/exams.lua:55: attempt to index a nil value (field 'align')\nstack traceback:\n\t../filters/exams.lua:55: in function <../filters/exams.lua:29>\n\t[C]: in ?\n\t[C]: in field 'walk_block'\n\t../filters/exams.lua:88: in function 'solution'"

I was able to fix it with this simple patch:

diff --git a/filters/exams.lua b/filters/exams.lua
index 7197ac4..be050ee 100644
--- a/filters/exams.lua
+++ b/filters/exams.lua
@@ -26,7 +26,7 @@ end


 -- transform markdown table to simple latex tabular
-local function mdtabletotabular(el)
+local function mdtabletotabular(elt)
     -- returns (list of) `Block` (since `Table` is of type `Block`)

     local function addcell(tab, cell)
@@ -48,6 +48,9 @@ local function mdtabletotabular(el)
         tab[#tab] = pandoc.RawBlock("latex", "\\\\\\hline")
     end

+    -- FP: the parameter is a Table, but afterwards is treated as a SimpleTable
+    local el = pandoc.utils.to_simple_table(elt)
+
     -- alignments: pandoc to tex
     local align = { [pandoc.AlignDefault] = "c", [pandoc.AlignLeft] = "l", [pandoc.AlignRight] = "r", [pandoc.AlignCenter] = "c" }

Thank you for this package.

[Partial] Code für Berechnung des Due-Dates für Assignments auslagern

Partial/Assignments.html und Archetype/Assignments/article.html nutzen den selben Code für die Berechnung des Due-Date für Aufgabenblätter.

=> Code auslagern in eigenes Partial Partial/Due.html (Code anpassen oder Partial löschen). Achtung: Kontext ... (alle Variablen über Scratch mitgeben).

Tool: Datum/Commit-SHA letzter Änderung in den Seiten aufführen

Hugo kann von Haus aus eigentlich das Datum und den Commit der letzten Änderung herausfinden und auf die Seiten schreiben. Da im aktuellen Tooling aber Dateien bei der Vorverarbeitung per Make verschoben werden, klappt das nicht mehr.

Idee: Das Makefile so erweitern, dass zusätzlich zu jedem File der letzte Commit in einer Variable gespeichert wird. Das dann als Metadata bei der Vorverarbeitung setzen (lastmod o.ä.) und in den Hugo-Templates eine entsprechende Fußzeile einbauen/aktivieren.

Befehl: git log --follow -n 1 --pretty=format:"last modified: %h (by %an on %ah)" -- README.md => "last modified: 7830b8a (by Carsten Gips on Tue Sep 5 09:55)"

[Shortcode] Einbindung von Figures über den "img"-Shortcode durch Lua-Filter ersetzen

siehe Compiler-CampusMinden/CB-Vorlesung-Bachelor#128:

Images (Abbildungen ohne Titel) werden über das Relearn Theme als Abbildung mit Lightbox gerendert, dazu konvertiert der Lua-Filter hugo.lua die Skalierung von Pandoc-Markdown in das Format vom Relearn Theme. Das funktioniert sowohl mit lokalen Abbildungen als auch URLs.

Figures (Abbildungen mit Titel) werden vom Lua-Filter hugo.lua und unserem img-Shortcode (img.html) übersetzt, der etwas Pfadmagie betreibt und dann eine HTML-figure-Umgebung analog zum nativen figure-Shortcode von Hugo erzeugt.

Bei unserer Konfiguration in https://github.com/Compiler-CampusMinden/CB-Vorlesung (Multi-Lang + Ugly URL + Singe-File-Pages) klappt das mit lokalen Images leider nicht so richtig: Die Bilder werden von Hugo nur im Ordner der Defaultsprache abgelegt, d.h. die Referenzen in den anderen Sprachen müssen entsprechend dorthin umgebogen werden. Bei Web-Images (mit URL) ist das kein Problem, bei Figures rechnet unser img-Shortcode den Pfad um. Nur bei "normalen" Images klappt die Auflösung nicht (die müsste durch das Hugo Relearn Theme erledigt werden) - und die Nicht-Defaultsprache ist dann quasi kaputt.


Der img-Shortcode (img.html) wird eigentlich ausschließlich in https://github.com/Compiler-CampusMinden/CB-Vorlesung benötigt. Wenn wir dieses Repo irgendwann doch splitten (Compiler-CampusMinden/CB-Vorlesung-Bachelor#129 (comment)) und wieder auf Single-Lang umstellen, dann brauchen wir diesen Shortcode gar nicht mehr (=> löschen).

In hugo.lua kann in der Funktion Image(el) dann einfach aus {{% img ... ein {{% figure ... gemacht werden.

[Action] Export as GitHub-Markdown (gfm)

Add an additional build target to make the content available as GitHub markdown (gfm).

GH-Markdown has additional new syntax for math: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions ... this should resolve some cases where "traditional" math (using $ or $$) is not being recognised properly. Define a custom Lua filter, but maybe Pandoc does support this out of the box now (e.g. jgm/pandoc#9156).

support for boxes could be done via "gh markdown alerts" (https://github.com/orgs/community/discussions/16925).

replace \operatorname{x} w/ \mathop{\text{x}} (see github/markup#1688)


Release als GitHub-Markdown (als Branch einchecken, von Readme aus verlinken) analog zu _slides und _hugo

GH-Markdown kann mittlerweile sogar MathJax, d.h. man müsste die Toolchain so anpassen, dass Abbildungen skaliert werden und Referenzen aufgelöst werden. Ggf. braucht man hier noch ein eigenes Markdown-Template, um die einzelnen Bausteine in der richtigen Reihenfolge zu haben.

Damit könnte man sich das Skript in "nüchtern" direkt im GH ansehen.

is a multiple choice that is not true/false available?

I am unclear on how the multiple choice is to be used. The documentation says "Each line constitutes a possible answer." (which sounds like multiple choice), but the outputs created a two column choice for each row -- "Correct" and "Incorrect" -- which makes me think this is designed to create a series of true/false questions.

::: {.mc ok="CorrecT" nok="wrOng" points="**je 0.5P** (*Summe 2P*)"}
  [... blablabla.]{.nok}
  [... **wuppie** :)]{.ok}
  [... *fluppie.*]{.nok}
  [... `foobar`.]{.nok}
:::

I would like to create a multiple choice question like these. How is that possible?

[ACTION] Switch to composite action?

Currently, we fetch the Docker image pandoc/extra in every run of the GitHub action, and install a few additional tools and some LaTeX packages. This takes a relatively long time (see also #26).


To create slides or the web page, we can identify four different phases:

  1. Pre-processing: The Markdown sources are pre-processed with Pandoc and the scripts in cagix/pandoc-lecture and saved to Markdown or LaTeX. The result differs depending on whether the slides or the web pages are to be generated.
  2. Web pages: Hugo is used to create a static web page from the preprocessed Markdown sources.
  3. Slides: The slide sets are created from the preprocessed LaTeX sources using LaTeX and the Beamer class.
  4. Upload: The folders are pushed into a corresponding branch in the repo with peaceiris/actions-gh-pages.

(See https://github.com/Programmiermethoden/PM-Lecture: Makefile, Workflows)


If we switch to a "composite action", we could avoid loading the Docker image.

If we change the Makefile so that the different phases can be accessed individually, we could save further time:

In the composite action, we could define several "steps": (a) install Pandoc directly in the runner, and (b) check out cagix/pandoc-lecture, and (c) start the preprocessing (depending on the target, controlled via the action's input variables).

In the workflow in the lecture repos, you could then generate the web pages with peaceiris/actions-hugo or compile the slides with actions/latex-compilation or texlive/texlive. Alternatively, these could be different steps here in the action that are executed depending on conditions/input variables.

Brain teaser I: The Makefile must be adapted, the paths and configuration must be adjusted. And all this should also work in a compatible Docker container.

Brain teaser II: actions/latex-compilation appears to be abandoned? texlive/texlive appears to be not an official TeXLive Docker image. Maybe it would be best to continue using pandoc/extra plus Metropolis class?


see also:

Creating a composite action
Metadata syntax for GitHub Actions
dtolnay/rust-toolchain

[Tool] Nutze Summary.md zur Definition des Semesters

from McShelby/hugo-theme-relearn#587 (comment):

edit: following this thought perhaps i should implement a mechanism like the folks over at mdbook are using: define the structure of the lecture in some markdown document "summary.md" using relative links to the markdown file. this would define also an order on the documents. parsing the links in this document with pandoc i could (a) add the metadata field weight to each document, and (b) transfer each file from wuppie.md to wuppie/_index.md, and (c) parsing and copying the page's resources, and (d) modifying local links on the fly. this should make hugo happier. hmmm 🤔

weitere vorteile:

  • die basisstruktur wäre github-kompatibel, man könnte die lecture-seite dann direkt in der gh-vorschau benutzen
  • die für hugo nötigen strukturen würden dynamisch erzeugt
  • die "summary.md" spielt die rolle eines build-scripts:
    • der semesterumfang wird festgelegt: nicht referezierte dateien werden nicht in die webseite aufgenommen
    • die reihenfolge des contents wird implizit über die reihenfolge der referenzierung festgelegt: das weight-attribut für hugo gehört eigentlich nicht in die seiten-metatdaten
  • man könnte damit ein pdf mit dem
    kompletten semesterinhalt (aka "skript") generieren (pandoc -> latex + eisvogel -> pdf)
  • da die strukturen dann besser passen, wird das erzeugen der gfm-variante deutlich leichter

benötigt:

  • lua-filter zum parsen der lokalen links auf markdown-dateien: reihenfolge - (link, count)
  • lua-filter zum parsen der seiten-ressourcen (abbildungen)
  • lua-filter zum übersetzen der relativen links in shortcodes:
    • markdown: hugo ref: [](topic/subA.md) => {{< ref "/topic/subA" >}}
    • image: hugo figure (see McShelby/hugo-theme-relearn#587 (comment)) => aus ![](img/a.png) muss ![](a.png) generiert werden
    • ggf. hugo-magie bzgl. der pfade (?!)
  • makefile: ordnerstruktur und kopieren der dateien
    • readme.md => _index.md
    • topic/subA.md => topic/subA/_index.md
    • topic/img/a.png => topic/subA/a.png (ouch!)
  • makefile: pre-processing mit pandoc und ergänzen der metadaten (weight)

verwandtschaft zu #83, #80, #57, #56, #55, #38, #30, #29

[Shortcode] Fix partial outcomes.html (and archetype lecture-cy)

In archetypes/lecture-cy und partials/outcomes.html gibt es eine extra Weiche, die an sich unnötig ist.

Hintergrund war: Normalerweise ist ein Attribut im YAML-Header vorhanden (und dann aktiviert sich das Partial) oder eben nicht. In lecture-cy wurde das Attribut outcomes dagegen auf false gesetzt, um das Rendern von Outcomes zu verhindern. Möglicherweise ein Missverständnis, eigentlich braucht man das nicht.

Aktionen:

  • Weiche in archetypes/lecture-cy entfernen
  • Weiche in partials/outcomes.html an die anderen Partials angleichen
  • Alle Vorlesungen in KI (Thema NN) überprüfen und ggf. anpassen

Docker: Installation of Relearn Theme stopped working

Previously we did something like wget https://github.com/McShelby/hugo-theme-relearn/archive/refs/tags/${RELEARN}.tar.gz. This suddenly stopped working and results in a "403":

Run sh /home/runner/work/_actions/cagix/pandoc-lecture/master/docker/install-relearn.sh
--2023-08-28 16:49:00--  https://github.com/McShelby/hugo-theme-relearn/archive/refs/tags/5.20.0.tar.gz
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/McShelby/hugo-theme-relearn/tar.gz/refs/tags/5.20.0 [following]
--2023-08-28 16:49:00--  https://codeload.github.com/McShelby/hugo-theme-relearn/tar.gz/refs/tags/5.20.0
Resolving codeload.github.com (codeload.github.com)... 140.82.114.9
Connecting to codeload.github.com (codeload.github.com)|140.82.114.9|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2023-08-28 16:49:01 ERROR 403: Forbidden.

It seems that https://github.com/McShelby/hugo-theme-relearn/archive/refs/tags/5.20.0.tar.gz will be resolved to https://codeload.github.com/McShelby/hugo-theme-relearn/tar.gz/refs/tags/5.20.0, which responds to a request in a browser, but not via wget (not even with --user-agent="Mozilla" set!).

Interestingly, both Pandoc (https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-linux-amd64.tar.gz) and Hugo (https://github.com/gohugoio/hugo/releases/download/v0.117.0/hugo_0.117.0_linux-amd64.tar.gz) are being resolved from another location (https://objects.githubusercontent.com/github-production-release-asset-2e65be/571...)?!

This results in the action being useless.

[Hugo] Strukturen vereinfachen und aufräumen

Für die Lecture-Webseiten nutzen wir Hugo und das Relearn Theme. Dabei sind im Laufe der Zeit relativ viele Shortcodes und Partials entstanden, die teilweise sehr spezifisch für das Relearn Theme sind.

Das verursacht (a) relativ hohen Aufwand in der Wartung (durch Weiterentwicklung Relearn Theme permanenter Zwang zum Nachziehen), (b) relativ unübersichtliche Strukturen, (c) Mehrarbeit bei neuen Exporten (Github-Markdown, ...) und (d) bindet es stark an das eingesetzte Theme.

Generelle Strategie:

  • Im Repo werden die Quellen als Pandoc-Markdown gepflegt
  • Dateistrukturen sollten möglichst lesbar für normale Menschen sein (Herstellen der Hugo-spezifischen Strukturen o.ä. über Vorverarbeitung in Temp-Ordner): "Readme.md" statt "_index.md", ...
  • Tooling:
    • Vorverarbeitung mit Pandoc + Lua-Filter (für alle anderen Schritte)
    • Slides:
      • Variante 1: Übersetzen mit Pandoc + LaTeX nach PDF
      • Variante 2: Übersetzen mit Pandoc und eigenem Template nach PPTX
    • Webseite: Übersetzen mit Hugo und Relearn Theme nach HTML
    • GitHub: Übersetzen mit Pandoc nach GitHub-Markdown
    • PDF: Übersetzen mit Pandoc + LaTeX nach PDF

Dabei sollten möglichst viele Dinge nur einmal gemacht werden. Beispielsweise könnte ein Schedule bereits in der Vorverarbeitung mit Pandoc + Lua-Filter erzeugt werden. Dito die Quellenangaben oder Seitenstrukturen.

Analog sollten sämtliche Spans/Divs/Befehle einmal auf den Prüfstand gestellt werden: Ist es wirklich .origin oder eher sowas wie .credits oder .src, sollte es Key/Value-Paare als Parameter geben statt komplett freier Formatierung?

Welche CSS-Defitionen brauchen wir noch?

[Filter] Ersetze lokale Links mit Hugo-Referenz

Aktuell muss eine Hugo-Referenz genutzt werden, wenn auf eine andere Seite verlinkt werden soll. Das hat nur Auswirkungen auf das generierte HTML, in den Beamer-Slides wird das nicht genutzt (und kann nicht genutzt werden).

Um die Markdown-Dateien auch direkt in GitHub ansehen zu können und die Links anzeigen zu können, müsste ein Markdown-Link genutzt werden, der dann durch den Filter in eine Hugo-Referenz übersetzt wird.

  • Links in lokale Unterordner funktionieren
  • Links in Oberordner o.ä. müssten als relative Links formuliert werden
  • Dateiendung ".md" muss entfernt werden.

Das soll nur für lokale Links funktionieren. HTTP(S) soll nicht angefasst werden.


Beispiel:

Aus dem aktuellen (vgl. b01a.md)

[Konzeptskizze]({{< ref "../org/faq#konzeptskizze" >}}){=markdown}

wird im Markdown

[Konzeptskizze](../org/faq.md#konzeptskizze)

und der Filter müsste daraus

[Konzeptskizze]({{< ref "../org/faq#konzeptskizze" >}}){=markdown}

machen als Vorverarbeitung für Hugo.

Allow for "mark" extension

Pandoc supports highlighting text using ==: wuppie ==fluppie== foo bar will be transform into wuppie [fluppie]{.mark} foo bar, when activation the non-default extension mark (like -f markdown+mark).

Let's use this and translate if needed (e.g. into []{.alert} for Hugo or ** ... ** for GFM).

see https://pandoc.org/MANUAL.html#extension-mark

see #206

[Filter] Ersetze Überschriften mit bestimmten Klassen mit Eintrag in Meta-Data

Aktuell wird der YAML-Header für viele Metadaten verwendet, u.a. auch Zusammenfassung (TLDR), Outcomes, Video-Links, ... Diese Metadaten werden von den selbstdefinierten Hugo-Templates ("Archetypes") aufgegriffen und als Content an der gewünschten passenden Stelle generiert.

Das funktioniert für Hugo und die generierten HTML-Skripte, und für die Beamer-Slides bleibt es ohne Wirkung.

Für die Ansicht in GitHub passt das nicht: (a) Der YAML-Header wird als eine riesige Tabelle dargestellt, d.h. die Lesbarkeit leider massiv, und (b) die Links auf Videos und Self-Assessments funktionieren nicht.

Man könnte diese Dinge an einer passenden Stelle im Markdown einbauen: Passende Überschrift plus Inhalt darunter. Die Überschrift würde zusätzlich die entsprechende Klasse zugewiesen bekommen, etwa {.tldr}. Ein Filter könnte alle diese Blöcke als Vorverarbeitung für Hugo aus dem Markdown entfernen und in die Meta-Daten schreiben, so dass dann bei der nachfolgenden Verarbeitung mit Hugo die Hugo-Templates wieder wirken können.

Alternativ könnte man überlegen, dass ein Filter diese Blöcke zunächst entfernt (und in die Meta-Daten schreibt) und dann ein Pandoc-Template nutzt für die flexible Anordnung der Blöcke. Hugo würde darauf das passende HTML generieren (plus CSS für die Klassen). Damit würde man sich extra Hugo-Templates sparen.

Auf diese Weise hätte man die statische Ansicht im GitHub, eine per Template dynamische Struktur für Hugo und für die Beamer-Slides werden diese zusätzlichen Elemente bisher komplett ignoriert.

Defaults: header level for Beamer

currently we use a "title" metadata variable and start with H2 headers, which is also "hard wired" in the beamer default file.

we could use the option --shift-heading-level-by=1 to propagate the "title" field to the first H1 header. however, we'd need to use in the document also H1 instead of H2 headers (which will be demoted to H2 with this option). this would need changing in the beamer default file, too.

question: bc uses already H1 to group parts of her larger slide sets. would this still work?

TeX package deprecated

The package texlive-generic-recommended seems to have been removed in debian:bullseye-slim (it is still present in debian:buster-slim). However, the dependencies needed from this package seem to have already been installed by other meta packages.

[Doc] update examples

  • use current Makefile from PM-Lecture
  • use current organisation and folder structure
  • remove outdated examples

[Action] Split in multiple actions?

In https://github.com/quarto-dev/quarto-actions werden in einem Repo mehrere Actions definiert für bestimmte Use-Cases (über Unterordner).

So ein Ansatz wäre auch für Pandoc-Lecture denkbar: Eine konkrete Action für das Erstellen von Folien, eine andere Action für das Erstellen der Vorlesungs-Webseite, ...

Dabei könnte man direkt auch Composite-Actions verwenden statt der jetzigen Docker-Action und Teile des umfangreichen Makefiles in die jeweilige Action verlagern.

Die Schritte der Actions könnten geeignet mit Shellskripten/Makefiles gebaut werden, so dass man das auch lokal in einem Docker-Container integrieren könnte.

Mit $GITHUB_ACTION_PATH kann man in einer Action Dateien/Skripte im Pfad der Action zugreifen/ausführen (siehe Doku in https://docs.github.com/en/actions/learn-github-actions/variables, Beispiel in https://github.com/quarto-dev/quarto-actions/blob/main/setup/action.yml).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.