From c17153f50e68d12e631cdbd4a1c320d2bd3be09a Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 17 Jan 2021 11:16:17 +0100 Subject: [PATCH] Add placeholders chapter Signed-off-by: trivernis --- chapters/configuration.md | 7 +++++-- chapters/glossary.md | 7 ++++++- chapters/placeholders.md | 30 ++++++++++++++++++++++++++++++ main.md | 7 +++++-- 4 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 chapters/placeholders.md diff --git a/chapters/configuration.md b/chapters/configuration.md index ce17591..e869056 100644 --- a/chapters/configuration.md +++ b/chapters/configuration.md @@ -37,11 +37,14 @@ It currently supports two keys: ```toml [metadata] -# language setting of the document +# Language setting of the document language = 'en' -# author of the document +# Author of the document author = 'author' + +# Title of the document +title = 'title' ``` diff --git a/chapters/glossary.md b/chapters/glossary.md index 604abe5..f21105d 100644 --- a/chapters/glossary.md +++ b/chapters/glossary.md @@ -48,4 +48,9 @@ You can force Snekdown to use the long form for an entry by writing ``` ~~SHORT -~~HTML \ No newline at end of file +~~HTML + + +The list of glossary entries can be inserted with the `[[GLS]]` placeholder. + +[[GLS]] \ No newline at end of file diff --git a/chapters/placeholders.md b/chapters/placeholders.md new file mode 100644 index 0000000..7f65ab6 --- /dev/null +++ b/chapters/placeholders.md @@ -0,0 +1,30 @@ +# Placeholders + +Placeholders are used to insert additional content or variables in the document. +The syntax for placeholders is: + +``` +[[PLACEHOLDER]] + +# Example +[[date]] +``` + +The most commonly used placeholders are: + + +| Placeholder | Meaning | +| ----------------------------- | ----------------------------------------------------- | +| `[[TOC]][ordered=true/false]` | Inserts the table of contents at the current position | +| `[[BIB]]` | Inserts the bibliography list at the current position | +| `[[GLS]]` | Inserts the glossary list at the current position | +| `[[date]]` | Inserts the current date | +| `[[time]]` | Inserts the current time | +| `[[datetime]]` | Inserts the current date and time | +| `[[author]]` | Inserts the author of the document | +| `[[title]]` | Inserts the title of the document | +  + +Additionally all entries defined in the `custom_attributes` section of the configuration +can be inserted as placeholders. + diff --git a/main.md b/main.md index d50ff8f..836cb44 100644 --- a/main.md +++ b/main.md @@ -7,7 +7,7 @@ - - - ##[toc-hidden] Table of Contents -[[TOC]] +[[TOC]][ordered] - - - @@ -53,4 +53,7 @@ <[chapters/configuration.md] -- - - \ No newline at end of file +- - - + +<[chapters/placeholders.md] +