tudat-team / tudat-space

An introduction and guide to tudat-space.
https://tudat-space.readthedocs.io
15 stars 17 forks source link

Intersphinx linking to properties not working #27

Closed DominicDirkx closed 2 weeks ago

DominicDirkx commented 3 years ago

As discussed in the first couple of posts in #25: https://github.com/tudat-team/tudat-space/issues/25#issuecomment-961882837 we currently have no way of using intersphinx to use links to the tudatpy API docs for class properties. This should be resolved to allow full linking between tudat-space and API docs. Since properties are usually mentioned in the context of the linked class that they belong to, this issue does not have high priority

FilippoOggionni commented 3 years ago

The same problem happens for modules. I tried with :mod: but it does not work.

DominicDirkx commented 3 years ago

That's weird, I hadn't tried that yet. If we don't manage to resolve this soon-ish, we could put in direct URL links, pending the resolution of this issue, as a temporary working solution

FilippoOggionni commented 3 years ago

I agree. Let's see if we can get @ggarrett13's view on it in the next few days, otherwise I agree on temporarily switching to regular URL links for now

geoffreygarrett commented 2 years ago

Apologies for the late reply. I saw the original thread in #25 and saw it closed, did not see this one.

links to the tudatpy API docs for class properties

I don't think there is a solution for linking directly to a class' properties. The following approach may be a good alternative:

... as determined by property_X of :class:Class_X

Where the latter is linked and former is not.

geoffreygarrett commented 2 years ago

Actually, I found this. I don't know if it works only within the same project, or if it works for linking to external projects. Give it a go, but I consider this issue closed.

FilippoOggionni commented 2 years ago

The link posted by @ggarrett13 unfortunately does not solve the issue. While the workaround for properties holds, this does not work for modules (neither :mod: nor the generic :obj: tags work).

FilippoOggionni commented 2 years ago

Potentially useful material: see this comment

FilippoOggionni commented 2 years ago

Resource

larshinueber commented 2 weeks ago

Hi all, I came across this by accident and think I got it to work. The command @DominicDirkx posted in https://github.com/tudat-team/tudat-space/issues/25#issuecomment-961896395 also gives the type of a certain reference.

To link to properties, the :attr: role needs to be used, while for modules the module name with :doc: works, e.g. :doc:`element_conversion`. See a quick demo with links to all objects here: https://docs.tudat.space/en/fix-relative-links/_src_advanced_topics/sphinx-linking.html

DominicDirkx commented 2 weeks ago

That's really cool! Thanks for digging into this