From 16b1167ae1af968f6290a99937dd89107aed783d Mon Sep 17 00:00:00 2001 From: EpocDotFr Date: Wed, 15 May 2024 13:42:21 +0200 Subject: [PATCH] Docs --- docs/installation.md | 2 +- docs/templates.md | 30 ++++++++++++++++++++++++++++-- mkdocs.yml | 3 ++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 857d960..e104fae 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -18,4 +18,4 @@ After cloning/downloading the repo: $ pip install . ``` -A [CLI](cli.md) (`staticjinjaplus`) will be made available upon installation in any case. \ No newline at end of file +A CLI ([`staticjinjaplus`](cli.md)) will be made available upon installation in any case. \ No newline at end of file diff --git a/docs/templates.md b/docs/templates.md index 6ec9e3a..7969733 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -74,8 +74,32 @@ Return the file content of the given file, marked as safe to be rendered by Jinj **Type:** List[Dict[str, Any]] -List of all valid template files (as seen by staticjinja) found in the `TEMPLATES_DIR` directory. Dictionary include -source filename, rendered template URL, file extension, and for Markdown (`.md`) files their parsed metadata. +List of all valid template files (as seen by staticjinja) found in the `TEMPLATES_DIR` directory. Dictionaries contained +in this list owns the following keys and values. + +`source` (str) +: The template filename. + + **Example:** `wow/about.html` + +`type` (str) +: The type (file extension) of the template. + + **Example:** `html` + +`url` (str) +: The rendered template URL. + + Setting `USE_HTML_EXTENSION` configuration value to `False` will remove the `.html` suffix, including for Markdown + templates output. + + **Example:** `/wow/about.html` + +`meta` (Dict[str, str]) +: If `type` equals `md`: metadata parsed from the source Markdown file. Multiline values have been concatenated using + `\n` without extra spaces. + + **Example:** `{'my-metadata': 'any value'}` **Examples:** @@ -163,6 +187,8 @@ values are detailed below. `markdown.url` (str) : The rendered Markdown template URL. + Setting `USE_HTML_EXTENSION` configuration value to `False` will remove the `.html` suffix. + **Example:** `/blog/my-article.html` `markdown.meta` (Dict[str, str]) diff --git a/mkdocs.yml b/mkdocs.yml index efaefdf..4265b5d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,7 +14,8 @@ nav: markdown_extensions: - codehilite: use_pygments: true - - toc + - toc: + permalink: true - smarty - admonition - footnotes