justheuristic 5 роки тому
батько
коміт
205cb4d93b
5 змінених файлів з 35 додано та 3 видалено
  1. 21 1
      docs/conf.py
  2. 10 1
      docs/index.md
  3. 1 0
      docs/modules/client.md
  4. 1 0
      docs/modules/runtime.md
  5. 2 1
      docs/requirements.txt

+ 21 - 1
docs/conf.py

@@ -15,6 +15,8 @@
 # import os
 # import sys
 # sys.path.insert(0, os.path.abspath('.'))
+from recommonmark.transform import AutoStructify
+from recommonmark.parser import CommonMarkParser
 
 
 # -- Project information -----------------------------------------------------
@@ -47,7 +49,6 @@ extensions = [
     'sphinx.ext.ifconfig',
     'sphinx.ext.viewcode',
     'sphinx.ext.githubpages',
-    'recommonmark'
 ]
 
 # Add any paths that contain templates here, relative to this directory.
@@ -62,6 +63,11 @@ source_suffix = {
     '.md': 'markdown',
 }
 
+
+source_parsers = {
+    '.md': CommonMarkParser,
+}
+
 # The master toctree document.
 master_doc = 'index'
 
@@ -196,3 +202,17 @@ intersphinx_mapping = {'https://docs.python.org/': None}
 
 # If true, `todo` and `todoList` produce output, else they produce nothing.
 todo_include_todos = True
+
+# markdown autostructify
+
+def setup(app):
+    github_doc_root = 'https://github.com/rtfd/recommonmark/tree/master/doc/'  # TODO
+    app.add_config_value('recommonmark_config', {
+        'url_resolver': lambda url: github_doc_root + url,
+        'auto_toc_tree_section': 'Contents',
+        'enable_math': True,
+        'enable_inline_math': True,
+        'enable_eval_rst': True,
+        # 'enable_auto_doc_ref': True,
+    }, True)
+    app.add_transform(AutoStructify)

+ 10 - 1
docs/index.md

@@ -2,4 +2,13 @@ This is a test file
 
 # TODO caption
 
-$$ formula = x + y $$
+$$ formula = x + y $$
+
+![logo](https://i.imgur.com/GPxolxb.gif)
+
+Contents
+--------
+* Titles1
+  * [Title1](modules/runtime.md)
+  * [Title2](modules/client.md)
+* Titles2

+ 1 - 0
docs/modules/client.md

@@ -0,0 +1 @@
+TODO i explain client

+ 1 - 0
docs/modules/runtime.md

@@ -0,0 +1 @@
+TODO i explain runtime

+ 2 - 1
docs/requirements.txt

@@ -1 +1,2 @@
-recommonmark
+recommonmark
+sphinx_rtd_theme