]> gitweb.fluxo.info Git - templater.git/commitdiff
Sphinx: markdown support
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jan 2018 18:13:47 +0000 (16:13 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jan 2018 18:13:47 +0000 (16:13 -0200)
share/templater/sphinx/files/Makefile.sphinx
share/templater/sphinx/files/conf.py

index 6f8ddaafaf50345df220a66f2b6a88b5e5e1622b..3369b20be0770ae79b16bdd006e3608eb41335c4 100644 (file)
@@ -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/
index a605478561e9305fa0930d02225eef194b60c116..a8aa2d8ad0a70fd7debf229209573a29b09a108b 100644 (file)
@@ -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)