https://github.com/serlo/mfnf-sitemap-parser
A parser for "Mathe für Nicht-Freaks"-like sitemaps. Allows dependency export in a make-compatible format.
https://github.com/serlo/mfnf-sitemap-parser
Last synced: over 1 year ago
JSON representation
A parser for "Mathe für Nicht-Freaks"-like sitemaps. Allows dependency export in a make-compatible format.
- Host: GitHub
- URL: https://github.com/serlo/mfnf-sitemap-parser
- Owner: serlo
- License: mit
- Created: 2018-05-06T15:50:18.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2021-08-23T19:31:35.000Z (almost 5 years ago)
- Last Synced: 2025-02-26T08:57:57.503Z (over 1 year ago)
- Language: Rust
- Size: 44.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mfnf-sitemap-parser
A parser for "Mathe für Nicht-Freaks"-like sitemaps. Allows dependency export in a make-compatible format.
## Sitemap Format
A site-/ bookmap is a mediawiki article referring to other articles in a structured way. This description focuses mainly on bookmaps.
Books currently allow only one level of structure: *parts*:
```markdown
= Beispielbuch =
== Grundlegende Formatierungen von Wikibooks ==
* [[Mathe für Nicht-Freaks: Beispielkapitel: Grundlegende Formatierungen|Grundlegende Formatierungen]]
== Eigene Formatierungen ==
* [[Mathe für Nicht-Freaks: Beispielkapitel: Semantische Blöcke|Semantische Blöcke]]
```
The top-level heading declares the book title: `Beispielbuch`. The second-level headings declare two *parts* with one *chapter* (article) each. Chapters are declared as a mediawiki list.
## Markers (Include / Exclude / After / ...)
For each layer of the bookmap hierarchy, some meta information can be declared. This can be useful for tools like [MFNF pdf export](https://github.com/lodifice/mfnf-pdf-export).
Currently, all markers are:
| Marker | Functionality |
| ------- | --------------|
| include | For non-chapters: Sets default wether to include chapters for this subtarget. For chapters: Includes a chapter for this subtarget. May have a sublist listing all headings to include, all others will be excluded. |
| exclude | For non-chapters: Sets default wether to exclude chapters for this subtarget. For chapters: Excludes a chapter for this subtarget. May have a sublist listing all headings to exclude, all others will be included. |
| after | Sets a marker to include something after this *part* or *chapter* |
| todo | Leave a todo message |
This example is specific to the pdf export tool:
```markdown
= Beispielbuch =
* include:
** all
** print
* exclude:
** minimal
== Noprint-Content ==
* [[Mathe für Nicht-Freaks: Beispielkapitel: Inhalte im Druck unterbinden|Inhalte im Druck unterbinden]]
** include:
*** minimal
** exclude:
*** print:
**** Parameter von Vorlagen löschen
```
Markers on deeper levels inherit markers of the top level. For example: for the `minimal` subtarget, all *parts* are excluded by default. But this default was overridden by a *chapter*, making it still appear in `minimal`.
For the `print` subtarget, the heading `Parameter von Vorlagen löschen` wil be omitted from the *chapter*.