1

I'm using Sphinx's apidoc extension to produce documentation for a Python project. It's somewhat quirkier than I had expected, but I've gotten most things to work. However, one quirk has me stumped.

I've got a couple of classes with docstrings that include something like this:

"""
:ivar normal_attr1:  This is a normal attribute.
:ivar doppleganger:  This is an attribute with the same name as a class in
    another module.

""""

Sphinx is automatically adding a link from "doppleganger" to the class whose name it shares--and I can't find a way to stop it. In ordinary circumstances, I'd just change one of the names, but unfortunately, both names are are from code autogenerated from an XSD specification that I'm not at liberty to change.

Is there any easy way to stop these links from being inserted?

mzjn
  • 48,958
  • 13
  • 128
  • 248
MTKnife
  • 133
  • 8
  • Looks similar to https://stackoverflow.com/q/31784830/407651 – mzjn Sep 29 '18 at 04:13
  • Yes, thank you! I searched all over the place but couldn't find that one. – MTKnife Sep 29 '18 at 23:49
  • Ugh, the monkey patch in that thread doesn't work for me on 1.79...and I don't even have the reputation to comment and ask why not. :P – MTKnife Sep 30 '18 at 00:14
  • See the comments on the answer with the monkey patch. Since I wrote that answer, another argument has been added to `TypedField.make_field()`. – mzjn Sep 30 '18 at 05:06
  • Yes, I tried adding the "env = None" argument, but it still doesn't work. It doesn't throw an error or anything--it just doesn't have any apparent impact on the output. – MTKnife Oct 01 '18 at 03:19

0 Answers0