From: David G. <go...@py...> - 2017-09-21 04:19:51
|
On Wed, Sep 20, 2017 at 9:29 PM, Tony N <to...@gi...> wrote: > Docutils Users, This should be on the docutils-develop list. > Currently, sphinx has an infrastructure geared toward resolving unknown > references. I have not been able to find an approach for a custom reference > resolver mentioned before on the list. > > What would the best approach be for wiring in a callback to resolve missing > references with pure docutils? Not exactly sure what you're talking about. Examples go a long way. I'm guessing you're talking about resolving hyperlink references. (I don't like to guess; please don't make me.) > If it’s a transformer, when and where would > would it be added/applied? Transforms, not "transformers". Docutils has one Transformer, docutils.transforms.Transformer, which stores and applies Transforms. > (It appears the other reference resolvers in > docutils are in the Reader). The hook you're looking for is here: docutils/__init__.py::TransformSpec.unknown_reference_resolvers For an example, see sandbox/mmgilbe/rst.py, the original MoinMoin/Docutils interface code. > P.S. An aside, parsers/rst/states.py has an unused > UnknownInterpretedRoleError exception. OK... Do you have a point, other than this showing up in linter output? David Goodger <http://python.net/~goodger> |