Commit 648d9406 authored by Adrian DC's avatar Adrian DC
Browse files

docs(mkdocs, prepare): resolve Markdown support in hidden '<details>'

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent b7bb58c8
Loading
Loading
Loading
Loading
Loading
+9 −1
Changes for docs/prepare.sh: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ docs_path=$(cd "$(dirname "${BASH_SOURCE:-${0}}")" && pwd -P)
root_path="${docs_path%/*}"

# Prepare cache
rm -f "${docs_path}/.cache/*.md"
rm -f "${docs_path}/.cache/"*.md
mkdir -p "${docs_path}/.cache/"

# Export assets
@@ -35,6 +35,14 @@ diff -u "${root_path}/CHANGELOG.md" "${docs_path}/.cache/about/changelog.md" ||
  cat "${root_path}/LICENSE"
} >"${docs_path}/.cache/about/license.md"

# Bind 'md_in_html' extension
sed -i \
  -e 's/<\(details\)>/<\1 markdown>/g' \
  -e 's/<\(div style="padding-left: 30px"\)>/<\1 markdown>/g' \
  -e '/<div style="padding-left: 30px"/{ n; /<br/d; }' \
  "${docs_path}/.cache/"*.md \
  "${docs_path}/.cache/"*/*.md

# Show cache
echo ' '
ls -laR "${docs_path}/.cache/"
+1 −0
Changes for mkdocs.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ extra:

# Pages extensions
markdown_extensions:
  - md_in_html
  - pymdownx.highlight:
      anchor_linenums: true
      line_spans: __span