marcel-hofer / markdown-document

Converts markdown files to PDF documents using HTML templates.
https://marcel-hofer.github.io/markdown-document/
MIT License
3 stars 2 forks source link

Add support for table of figures / tables / formulas #12

Closed marcel-hofer closed 6 years ago

marcel-hofer commented 7 years ago

Using a remarkable plugin or something else, it should be possible to list all figures / tables / formulas inside any template.

Markdown syntax

Because it should be possible to create listings for multiple kind of elements, there must be a syntax addition for this feature.

Example markdown:

![Awesome figure](link/to/image.png)
[figure][Awesome figure]

[table][Awesome table]
| Col 1 | Col 2|
|---|---|
| Row 1 | Row 2 |

$$
c = \pm\sqrt{a^2 + b^2}
$$
[formula][Awesome formula]

Templating

The data passed to the templates could look like:

{
  "listings": {
     "figures": [{  "": 1, "link": "#figure-1", "title": "Awesome figure" }, ...],
     "tables": [{ "": 1, "link": "#table-1", "title": "Awesome table" }, ...],
     "formulas": [{ "": 1, "link": "#formula-1", "title": "Awesome formula" }, ...]
  }
}

HTML

Because these types of elements often have a caption, captions should be auto-added to the resulting HTML. Using HTML and CSS the caption must be able to be transformed to things like Figure 42: Awesome figure.

This feature (caption) should be configurable inside the layout config.