From 1d5c0d8e0216b2bd42dc98d5f88b08c65330aaf0 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 17 Jan 2021 11:25:45 +0100 Subject: [PATCH] Add imports chapter Signed-off-by: trivernis --- chapters/imports.md | 40 ++++++++++++++++++++++++++++++++++++++++ main.md | 4 ++++ 2 files changed, 44 insertions(+) create mode 100644 chapters/imports.md diff --git a/chapters/imports.md b/chapters/imports.md new file mode 100644 index 0000000..33d4c4d --- /dev/null +++ b/chapters/imports.md @@ -0,0 +1,40 @@ +# Imports + +A key feature of Snekdown is splitting a document +into several files and importing those files in the main +document. + +Additionally files that provide Glossary entries, Bibliography, Style and +Configurations can be imported with the same syntax. + +``` +<[path] + +# import another snekdown document at the current position +<[document.md] + +# import a stylesheet that will be embedded in the document +<[style.css][type=stylesheet] + +# import a configuration file +<[Manifext.toml] + +# import bibliography +<[MyBib.toml][type=bibliography] + +# import a glossary + +<[MyGls.toml][type=glossary] +``` + +The parser differentiates five different types of imported files. + +- `document` - The default import which is just another Snekdown document +- `stylesheet` - CSS Stylesheets that are included when rendering +- `bibliography` - A file including bibliography +- `config/manifest` - A config file that contains metadata +- `glossary` - Glossary entries + +Imports of Snekdown documents are parsed in a separate thread, so you +might see a performance improvement when splitting a large document into +several files. \ No newline at end of file diff --git a/main.md b/main.md index 1d033e9..0f242b7 100644 --- a/main.md +++ b/main.md @@ -43,6 +43,10 @@ - - - +<[chapters/imports.md] + +- - - + <[chapters/bibliography.md] - - -