From 79f1a0b58155b8555d892189051f9778f632fbc9 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 28 Oct 2021 11:13:18 +0200 Subject: [PATCH 1/3] update reqs --- .rtd_pip_reqs.txt | 39 +++++++++++++++++++++++++++++++++------ doc/conf.py | 2 +- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.rtd_pip_reqs.txt b/.rtd_pip_reqs.txt index 52f9d30d..3d67b849 100644 --- a/.rtd_pip_reqs.txt +++ b/.rtd_pip_reqs.txt @@ -1,6 +1,33 @@ -sphinx -sphinxcontrib-napoleon -sphinx-markdown-tables -sphinx-rtd-theme -recommonmark -m2r +alabaster==0.7.12 +Babel==2.9.1 +certifi==2021.10.8 +charset-normalizer==2.0.7 +commonmark==0.9.1 +docutils==0.17.1 +idna==3.3 +imagesize==1.2.0 +Jinja2==3.0.2 +m2r==0.2.1 +Markdown==3.3.4 +MarkupSafe==2.0.1 +mistune==0.8.4 +packaging==21.0 +pockets==0.9.1 +Pygments==2.10.0 +pyparsing==3.0.3 +pytz==2021.3 +recommonmark==0.7.1 +requests==2.26.0 +six==1.16.0 +snowballstemmer==2.1.0 +Sphinx==4.2.0 +sphinx-markdown-tables==0.0.15 +sphinx-rtd-theme==1.0.0 +sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-napoleon==0.7 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.5 +urllib3==1.26.7 diff --git a/doc/conf.py b/doc/conf.py index 3cabc896..9bb65ce8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -78,7 +78,7 @@ # html_theme = 'sphinx_rtd_theme' def setup(app): - app.add_stylesheet('custom.css') + app.add_css_file('custom.css') # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". From 4c616e8e9b5f90ef4c507cf0ba88e1a06a11bb6d Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 28 Oct 2021 11:21:51 +0200 Subject: [PATCH 2/3] m2r2 for markdown --- .rtd_pip_reqs.txt | 10 +++++++--- doc/conf.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.rtd_pip_reqs.txt b/.rtd_pip_reqs.txt index 3d67b849..19e8aefb 100644 --- a/.rtd_pip_reqs.txt +++ b/.rtd_pip_reqs.txt @@ -1,13 +1,18 @@ +# Direct dependencies: +# Sphinx +# sphinx-markdown-tables +# sphinx-rtd-theme +# sphinxcontrib-napoleon +# m2r2 alabaster==0.7.12 Babel==2.9.1 certifi==2021.10.8 charset-normalizer==2.0.7 -commonmark==0.9.1 docutils==0.17.1 idna==3.3 imagesize==1.2.0 Jinja2==3.0.2 -m2r==0.2.1 +m2r2==0.3.1 Markdown==3.3.4 MarkupSafe==2.0.1 mistune==0.8.4 @@ -16,7 +21,6 @@ pockets==0.9.1 Pygments==2.10.0 pyparsing==3.0.3 pytz==2021.3 -recommonmark==0.7.1 requests==2.26.0 six==1.16.0 snowballstemmer==2.1.0 diff --git a/doc/conf.py b/doc/conf.py index 9bb65ce8..5db1a578 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -37,7 +37,7 @@ extensions = [ 'sphinx.ext.napoleon', 'sphinx.ext.autodoc', - 'recommonmark', + 'm2r2', 'sphinx.ext.autosummary', 'sphinx_markdown_tables', ] From 978ca4cd2b9f33fd06768c78dcf745d5013fa760 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 28 Oct 2021 11:24:42 +0200 Subject: [PATCH 3/3] anonymous_references --- doc/md2rst.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/md2rst.py b/doc/md2rst.py index e7972e89..858ab0c4 100644 --- a/doc/md2rst.py +++ b/doc/md2rst.py @@ -1,4 +1,4 @@ -import m2r +import m2r2 import re @@ -25,7 +25,7 @@ def absolute_links(txt): def md2rst(source: str, target: str): txt = absolute_links(read(source)) - txt = m2r.convert(txt) + txt = m2r2.convert(txt, anonymous_references=True) with open(target, 'w') as f: f.write(txt)