aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-01-28 16:13:47 -0200
committerSilvio Rhatto <rhatto@riseup.net>2018-01-28 16:13:47 -0200
commit5842b1a4b35a293e3d3cb9eedb85092ee3761326 (patch)
tree2a4e43f66808e70e62b0f452cbef56e276a839ec
parent3f31d3da4a87ce2e08542de8fdbaa1de951385fa (diff)
downloadtemplater-5842b1a4b35a293e3d3cb9eedb85092ee3761326.tar.gz
templater-5842b1a4b35a293e3d3cb9eedb85092ee3761326.tar.bz2
Sphinx: markdown support
-rw-r--r--share/templater/sphinx/files/Makefile.sphinx6
-rw-r--r--share/templater/sphinx/files/conf.py14
2 files changed, 19 insertions, 1 deletions
diff --git a/share/templater/sphinx/files/Makefile.sphinx b/share/templater/sphinx/files/Makefile.sphinx
index 6f8ddaa..3369b20 100644
--- a/share/templater/sphinx/files/Makefile.sphinx
+++ b/share/templater/sphinx/files/Makefile.sphinx
@@ -94,6 +94,8 @@ epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+ @cp $(BUILDDIR)/epub/*epub _static/
+ @echo "A copy was made to _static/."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@@ -107,6 +109,8 @@ latexpdf:
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+ @cp $(BUILDDIR)/latex/*pdf _static/
+ @echo "A copy was made to _static/."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@@ -152,7 +156,7 @@ doctest:
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
-web: clean html
+web: clean epub latexpdf html
web_deploy:
@rsync -avz --delete _build/html/ templates:/var/sites/templates/www/
diff --git a/share/templater/sphinx/files/conf.py b/share/templater/sphinx/files/conf.py
index a605478..a8aa2d8 100644
--- a/share/templater/sphinx/files/conf.py
+++ b/share/templater/sphinx/files/conf.py
@@ -12,6 +12,8 @@
# serve to show the default.
import sys, os
+import recommonmark
+from recommonmark.transform import AutoStructify
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -291,3 +293,15 @@ epub_copyright = u'2016, Templates'
# Allow duplicate toc entries.
#epub_tocdup = True
+
+# See http://recommonmark.readthedocs.io
+#github_doc_root = 'https://github.com/rtfd/recommonmark/tree/master/doc/'
+def setup(app):
+ app.add_config_value('recommonmark_config', {
+ #'url_resolver': lambda url: github_doc_root + url,
+ 'auto_toc_tree_section': 'Index',
+ 'enable_auto_toc_tree' : True,
+ 'enable_auto_doc_ref' : True,
+ 'enable_eval_rst' : True,
+ }, True)
+ app.add_transform(AutoStructify)