From b8f6b904670257868ba3d9674c1431b8c8bd7c58 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 2 Aug 2021 15:47:58 -0400 Subject: [PATCH] mkdocs_hooks: Add some comments to the script Signed-off-by: Kevin O'Connor --- docs/_klipper3d/mkdocs_hooks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 "
". +# 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):