taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit eb9501d7ad714a552ad9e320ea3ee9248c6c51e8
parent 38d91ef3494d97479d3d796ac54ae86c48b4be42
Author: Florian Dold <florian.dold@gmail.com>
Date:   Thu, 21 Jan 2016 11:13:51 +0100

Pickle references.

Diffstat:
Mexts/tsref.py | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/exts/tsref.py b/exts/tsref.py @@ -158,10 +158,6 @@ link_reg = re.compile(r"`([^`<]+)\s*(?:<([^>]+)>)?\s*`_") # since they derive from Python's tuple. token_props = {} -# Mapping from element IDs to document -# name where the ID occurs. -id_to_doc = {} - class LinkFilter(Filter): def __init__(self, app, **options): @@ -169,6 +165,7 @@ class LinkFilter(Filter): Filter.__init__(self, **options) def filter(self, lexer, stream): + id_to_doc = self.app.env.domaindata.get("_tsref", {}) for ttype, value in stream: if ttype in Token.Keyword.Type: defname = make_id('tsref-type-' + value); @@ -212,6 +209,9 @@ class LinkFilter(Filter): def remember_targets(app, doctree): docname = app.env.docname + id_to_doc = app.env.domaindata.get("_tsref", None) + if id_to_doc is None: + id_to_doc = app.env.domaindata["_tsref"] = {} for node in doctree.traverse(): if not isinstance(node, nodes.Element): continue