mr-ubik / tensorflow-intersphinx

Provide a Sphinx Inventory file to enable intersphinx reference with TensorFlow Documentation.
5 stars 3 forks source link

Problem getting this to work... #1

Open JamesALeedham opened 4 years ago

JamesALeedham commented 4 years ago

Hi, I was very excited to see this project, would love to link through to Tensorflow docs.

As instructed, my conf.py looks like this:

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.intersphinx'
]

intersphinx_mapping = {
    "python": ("https://docs.python.org/3/", None),
    "tensorflow": (
        "https://www.tensorflow.org/api_docs/python",
        "https://github.com/mr-ubik/tensorflow-intersphinx/raw/master/tf2_py_objects.inv"
    ),
}

In the generated html (see picture), the link to the Python docs works but unfortunately the tf.Module link doesn't...

Am I doing something wrong..?

TF-intersphinx-failure

mr-ubik commented 4 years ago

Hi @JamesALeedham, sorry for the late reply, the notification was lost amidst others. It seems everything is correct; It may be an issue of how you are using the directive in your docstrings. You may want to take a look at how we are using it in https://github.com/zurutech/ashpy.git documentation.

JamesALeedham commented 4 years ago

No problem, thanks for getting back to me.

I took a look at AshPy's Readthedocs: https://ashpy.zurutech.io/en/master/_autosummary/keras/losses/ashpy.keras.losses.DHingeLoss.html#ashpy.keras.losses.DHingeLoss

I guess I was hoping that this base class link (red arrow) would be a hyperlink into the TF docs, but it isn't either: image

This is what I'm trying to get working in my project.

PS. I see you are using sphinx.ext.autosummary to generate your API docs. You might be interested in the new :recursive: option in Sphinx 3.1, which means you don't have to hard-code module names any more. See my writeup. Also, if you copy my custom templates, you'll get separate pages for each class, as you do now, but class docstrings won't get duplicated on module pages.

st-- commented 3 years ago

Hi, I've fixed a few minor issues (e.g. classes not being recognized correctly; perhaps TensorFlow changed their style) & added support for tensorflow_probability in this fork. @mr-ubik I'd be happy to open a PR into your repo if you are keen to continue maintaining tensorflow-intersphinx - otherwise we could also add a link to the updated fork in the relevant StackOverflow question.

njzjz commented 2 years ago

Has this issue been resolved? I have the same issue here: image https://docs.deepmodeling.com/projects/deepmd/en/latest/api_py/deepmd.descriptor.html#deepmd.descriptor.se_a.DescrptSeA.get_nlist