diff options
Diffstat (limited to 'doc/development/tutorials/examples')
-rw-r--r-- | doc/development/tutorials/examples/recipe.py | 3 | ||||
-rw-r--r-- | doc/development/tutorials/examples/todo.py | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/development/tutorials/examples/recipe.py b/doc/development/tutorials/examples/recipe.py index 2464302da..c7317578b 100644 --- a/doc/development/tutorials/examples/recipe.py +++ b/doc/development/tutorials/examples/recipe.py @@ -4,8 +4,7 @@ from docutils.parsers.rst import directives from sphinx import addnodes from sphinx.directives import ObjectDescription -from sphinx.domains import Domain -from sphinx.domains import Index +from sphinx.domains import Domain, Index from sphinx.roles import XRefRole from sphinx.util.nodes import make_refnode diff --git a/doc/development/tutorials/examples/todo.py b/doc/development/tutorials/examples/todo.py index 7eee534d0..59e394ee8 100644 --- a/doc/development/tutorials/examples/todo.py +++ b/doc/development/tutorials/examples/todo.py @@ -61,6 +61,13 @@ def purge_todos(app, env, docname): if todo['docname'] != docname] +def merge_todos(app, env, docnames, other): + if not hasattr(env, 'todo_all_todos'): + env.todo_all_todos = [] + if hasattr(other, 'todo_all_todos'): + env.todo_all_todos.extend(other.todo_all_todos) + + def process_todo_nodes(app, doctree, fromdocname): if not app.config.todo_include_todos: for node in doctree.traverse(todo): @@ -119,6 +126,7 @@ def setup(app): app.add_directive('todolist', TodolistDirective) app.connect('doctree-resolved', process_todo_nodes) app.connect('env-purge-doc', purge_todos) + app.connect('env-merge-info', merge_todos) return { 'version': '0.1', |