From 62b60f3f53425f895746e146caf7562376e4ef23 Mon Sep 17 00:00:00 2001 From: Renken Date: Wed, 13 Jul 2022 00:07:32 +0200 Subject: [PATCH] switch to markdown --- doc/conf.py.in | 9 ++++++--- gen_blogpost.sh | 24 +++++++++++++----------- requirements.txt | 1 + 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/doc/conf.py.in b/doc/conf.py.in index 2321e3b..454e80b 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -31,7 +31,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinxcontrib.plantuml'] +extensions = ['sphinxcontrib.plantuml', 'myst_parser'] # plantuml config plantuml = '@PLANTUML_PATH@ -config "@PROJECT_SOURCE_DIR@/doc/plantuml.cfg"' @@ -45,7 +45,10 @@ templates_path = [] # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +source_suffix = { + '.md': 'markdown', + '.rst': 'restructuredtext', +} # The master toctree document. master_doc = 'index' @@ -119,7 +122,7 @@ html_static_path = ['@DOC_SRC@/_static'] # https://github.com/rtfd/sphinx_rtd_theme/pull/432 # html_context = { # 'css_files': ['_static/theme_overrides.css'] -#} +# } # Custom sidebar templates, must be a dictionary that maps document names diff --git a/gen_blogpost.sh b/gen_blogpost.sh index c348690..a4d4061 100755 --- a/gen_blogpost.sh +++ b/gen_blogpost.sh @@ -17,14 +17,16 @@ for dir in "$archive" "$archive/$year" "$archive/$year/$month"; do name=Archive fi <<-EOF cat - >"$dir/index.rst" - $name - $(printf '%s\n' "$name" | sed -E 's|.|=|g') + # $name - .. toctree:: - $(printf '\t'):glob: - $(printf '\t'):maxdepth: 1 + \`\`\`{toctree} + --- + $(printf '\t')glob + $(printf '\t')maxdepth: 1 + --- $(printf '\t')*/index + \`\`\` EOF fi done @@ -32,14 +34,14 @@ done mkdir -- "$archive/$year/$month/$timestamp" -<<-EOF cat - >"$archive/$year/$month/$timestamp/index.rst" - $title - $(printf '%s\n' "$title" | sed -E 's|.|=|g') +<<-EOF cat - >"$archive/$year/$month/$timestamp/index.md" + # $title + *Written $title* - .. contents:: + \`\`\`{contents} + \`\`\` - TODO - ---- + ## TODO EOF printf '%s\n' "$archive/$year/$month/$timestamp" diff --git a/requirements.txt b/requirements.txt index 3b5305a..55f0154 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ Sphinx +myst-parser sphinx_rtd_theme sphinxcontrib.plantuml