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

How to include other external documents #28

Open
David-Le-Nir opened this issue Dec 13, 2024 · 4 comments
Open

How to include other external documents #28

David-Le-Nir opened this issue Dec 13, 2024 · 4 comments

Comments

@David-Le-Nir
Copy link

Hello,

why are the external links restricted to wikipedia, DOI and RTD and not allowed for every links (or at least for a whitelisted list of hosts)

my particular case:

  • I'm using sphinx-needs for many document and I would like to make preview of the links between these documents.
  • I'd like for example add in the configuration the host where my documents are deployed and that the extension creates tooltip for these URLs.
  • Currently only "internal" needs have a tooltip (which is great) but my external needs do not have tooltips which in fact would be more useful for my users than internal ones

PS: I know there is the sphinx-preview extension but I can't make it work and your extension looks more up-to-date

@ccoVeille
Copy link
Contributor

ccoVeille commented Dec 13, 2024

The code calls public API for fetching the information for the tooltip

The code handles Wikipedia, RTD and DOI.

The parsing is made by domain, avoiding to call every single links.

Could you provide an example of links you would like to see opened in a tooltip?

The only uses case I think about could be calling pages and then look for HTML meta tags

<meta property="og:title" content="European Travel Destinations">
<meta property="og:description" content="Offering tour packages for individuals or groups.">
<meta property="og:image" content="http://euro-travel-example.com/thumbnail.jpg">
<meta property="og:url" content="http://euro-travel-example.com/index.htm">

But then, it should be configured via a setting, calling external links would slowdown things, but also could be considered harmful for the site

@ccoVeille
Copy link
Contributor

@David-Le-Nir ?

@David-Le-Nir
Copy link
Author

I understand accessing many internet pages each with different page structure is maybe too complex.

In my case, I am using multiple documents referencing each others. They are hosted privately at my company.
These documents contains specifications, tests and other types of elements, managed with sphinx-needs extension.

In these documents, each "need" is a block of HTML, identified with an anchor (e.g in the tutorial section, referencing others like in the "required by" field)

I'd like to display tooltip for those elements.
Ideally, I would like to define my documents base url in the setup (to whitelist them let's say) and maybe express by an xpath or a python function how to extract the HTML section I want in the tooltip

This behaviour could be generic enough to be able to do that for any website, not limiting to the actual 3.

In fact, if you looked at the sphinx-preview extension I mentioned in my first post, you can see a demo of what I want to achieve but using your extension which seems better. ^^

Regards

@ccoVeille
Copy link
Contributor

OK, the need is now clearer

It reminds me the idea behind

https://github.com/dev-cycles/contextive

Maybe it could help you, I don't know.

I only contributed tippy for adding a very small feature. Let's wait for maintainers feedback

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