mkdocs_hooks: Add some comments to the script

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-08-02 15:47:58 -04:00
parent b837a344c1
commit b8f6b90467
1 changed files with 10 additions and 0 deletions

View File

@ -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):