diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-08-02 15:47:58 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-08-02 15:48:51 -0400 |
commit | b8f6b904670257868ba3d9674c1431b8c8bd7c58 (patch) | |
tree | 614267a87b4a5c582fd9604417734f3687f6403f /docs/_klipper3d/mkdocs_hooks.py | |
parent | b837a344c1aaf1634dd09d0fd537f7104b64d303 (diff) | |
download | kutter-b8f6b904670257868ba3d9674c1431b8c8bd7c58.tar.gz kutter-b8f6b904670257868ba3d9674c1431b8c8bd7c58.tar.xz kutter-b8f6b904670257868ba3d9674c1431b8c8bd7c58.zip |
mkdocs_hooks: Add some comments to the script
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'docs/_klipper3d/mkdocs_hooks.py')
-rw-r--r-- | docs/_klipper3d/mkdocs_hooks.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/_klipper3d/mkdocs_hooks.py b/docs/_klipper3d/mkdocs_hooks.py index f8e88839..b0e78f81 100644 --- a/docs/_klipper3d/mkdocs_hooks.py +++ b/docs/_klipper3d/mkdocs_hooks.py @@ -2,6 +2,16 @@ import re import logging +# This script translates some github specific markdown formatting to +# improve rendering with mkdocs. The goal is for pages to render +# similarly on both github and the web site. It has three main tasks: +# 1. Convert links outside of the docs directory (any reference +# starting with "../") to an absolute link to the raw file on +# github. +# 2. Convert a trailing backslash on a text line to a "<br>". +# 3. Remove leading spaces from top-level lists so that those lists +# are rendered correctly. + logger = logging.getLogger('mkdocs.mkdocs_hooks.transform') def transform(markdown: str, page, config, files): |