Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into https://sphobjinv.readthedocs.io/ to merge multiple obj.inv ? #2

Open
Carreau opened this issue May 3, 2024 · 3 comments

Comments

@Carreau
Copy link
Collaborator

Carreau commented May 3, 2024

No description provided.

@bskinn
Copy link
Contributor

bskinn commented May 3, 2024

<wave> sphobjinv author here.

You could definitely use the sphobjinv API to merge multiple objects.inv into a single master inventory. The main thing to watch out for would be duplicate object names within a given domain+role namespace, since intersphinx doesn't do any disambiguation there... I think it just grabs the first matching entry it finds in the inventory.

It also wouldn't be useful to merge inventories from docsets that live at different base URLs, because intersphinx has a one-to-one association of objects.inv --> base URL. E.g., you wouldn't be able to use an objects.inv that merges the matplotlib and numpy docs.

@Carreau Carreau mentioned this issue May 3, 2024
4 tasks
@Carreau
Copy link
Collaborator Author

Carreau commented May 3, 2024

sphobjinv author here.

❤️

You could definitely use the sphobjinv API to merge multiple objects.inv into a single master inventory. The main thing to watch out for would be duplicate object names within a given domain+role namespace, since intersphinx doesn't do any disambiguation there... I think it just grabs the first matching entry it finds in the inventory.

Yeah, I would have checked that all objects in the inventory do correspond to the package that publish the obj.inv

It also wouldn't be useful to merge inventories from docsets that live at different base URLs, because intersphinx has a one-to-one association of objects.inv --> base URL. E.g., you wouldn't be able to use an objects.inv that merges the matplotlib and numpy docs.

I was wondering about that and if we could rewrite the obj.inv to have full-urls instead of just the path.

I think this might be usefull though for things like numpy which websites is actually 2 sphinx builds, under different baseurl, so this could allow to have a single obj.inv for numpy, numpy-tutorial , same for scipy/scipy-devdocs.

@bskinn
Copy link
Contributor

bskinn commented May 3, 2024

I was wondering about that and if we could rewrite the obj.inv to have full-urls instead of just the path.

It might work. The base URL is defined in intersphinx_mapping, and each inventory object then defines its own URI that's relative to that base URL. As far as I know, they're just concatenated to form the links in the rendered docs.

So, in theory, if you put an empty string for the base URL in intersphinx_mapping and include complete URLs (with scheme) as the uri fields in the objects.inv, it seems like it should work. But, if intersphinx uses that base URL anywhere else, or if it chokes on that empty string, it'll blow up.

Wouldn't hurt anything to run the experiment.

I think this might be usefull though for things like numpy which websites is actually 2 sphinx builds

Yeah, I figured that was the use-case you were picturing for this. Seems like it should work pretty smoothly for any set of sites that has a common base URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants