Re: Approach for resolving unknown references with pure docutils

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=J5eepHqeR48xYAmtj7ZwCoLO29NJFNHT9_G=_ekAmmgA@mail.gmail.com>
On Wed, Sep 20, 2017 at 9:29 PM, Tony N <[email protected]> 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>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.