From ca893e8e9e0a312e43d8ad972b557f590ff583ee Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 17 Jan 2021 10:51:45 +0100 Subject: [PATCH] Add glossary chapter Signed-off-by: trivernis --- Glossary.toml | 8 +++++++ chapters/glossary.md | 51 ++++++++++++++++++++++++++++++++++++++++++++ main.md | 6 +++++- 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 chapters/glossary.md diff --git a/Glossary.toml b/Glossary.toml index e69de29..957150e 100644 --- a/Glossary.toml +++ b/Glossary.toml @@ -0,0 +1,8 @@ + +[SHORT] +long = "Long Form" +description = "The description of the entry" + +[HTML] +long = "Hypertext Markup Language" +description = "The markup language of the web" \ No newline at end of file diff --git a/chapters/glossary.md b/chapters/glossary.md new file mode 100644 index 0000000..604abe5 --- /dev/null +++ b/chapters/glossary.md @@ -0,0 +1,51 @@ +# Glossary + +You can use glossary entries in Snekdown to provide +a way of linking abbreviations to their longer form +and auto expand the first occurrence of an abbreviation. + + +Glossary entries can be defined in a separate TOML File. +Per default the `Glossary.toml` file gets imported. + +```toml +# Glossary.toml + +[SHORT] +long = "Long Form" +description = "The description of the entry" + +# Example +[HTML] +long = "Hypertext Markup Language" +description = "The markup language of the web" +``` + +The defined entries can be used in the text by using the following syntax: + + +Short entry: +``` +~SHORT +~HTML +``` + +~SHORT +~HTML + + +The first occurrence expands to the long form. When using it a second time it uses the shorter form: + +~SHORT +~HTML + + +You can force Snekdown to use the long form for an entry by writing + +``` +~~SHORT +~~HTML +``` + +~~SHORT +~~HTML \ No newline at end of file diff --git a/main.md b/main.md index 9b25d35..08914df 100644 --- a/main.md +++ b/main.md @@ -43,4 +43,8 @@ - - - -<[chapters/bibliography.md] \ No newline at end of file +<[chapters/bibliography.md] + +- - - + +<[chapters/glossary.md] \ No newline at end of file