Comments (9)
Hey gang, so yeh I wanted this also, plus didn't really like the whole having to have it hosted on RTD to get it working.
So I created my own extension 😅, that works by pre-compiling all the tips, rather than fetching them interactively (and also supports other APIs like wikipedia and DOI)
Here it is: https://sphinx-tippy.readthedocs.io, and you can see it in action on https://myst-parser.readthedocs.io
happy to work with you guys on it
from sphinx-hoverxref.
Hi all! I don't have too much experience working with MyST and how it generates the nodes. It makes sense that it works when using {ref}
in your links since that's a Sphinx role and it's translated into a ref
node in docutils.
However, I'm not sure to what node [text](file#header)
translates to. We will need to figure it out that first. Once we know it, we can probably add a small chunk of code to this extension to handle those as ref
as well.
from sphinx-hoverxref.
Hello Everyone,
I am sorry but I can't figure out from the docs above how to get these tippy tooltips to work with Myst Markdown.
We use: md files -> myst -> sphinx -> github -> readthedocs
We basically have 3 simple use-cases when the mouse hovers our keyword 'foo':
- show 1 line tooltip: just display the string "Hello World!"
- show multi-lines tooltip: just display the text:
"Hello line1 !
Hello line2!"
when the mouse over the keyword. - show a box with the content of another html page: hello_world.html ? (although I assume we write the file as hello_world.md and it get translated to hello_world.html by myst+sphinx)
...I am very new to this whole markdown things, so I apologize if my question is somehow obvious...
for instance for item 1,
I did add to my md file: "Custom tip" which I stole from your tippy doc source code.
but it only show the link in the bottom left corner of my browser no tooltip is showing.
I think I did configure some of tippy properly because I do see some tooltip showing up when I hover over some of my headers in the menu...
Thank you so much!
from sphinx-hoverxref.
I've noticed this issue #114. And I find the ref syntex provided by my-st is useful: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#targets-and-cross-referencing
{ref}`my text <header_target>`
I'm wondering whether hoverxref_auto_ref
can identify and convert markdown links ({any} role?) written by [name](file)
automatically.
from sphinx-hoverxref.
I find a solution.
First, generate section label:
extensions += ['sphinx.ext.autosectionlabel']
# Make sure the target is unique
autosectionlabel_prefix_document = True
autosectionlabel_maxdepth = None
Then use {ref}
provided by myst-parser in markdown:
{ref}`design principle <overview/overview:design principle>`
hoverxref will identify the ref above.
However, the markdown links cannot be identified:
using sphinx.ext.autosectionlabel:
[](<overview/overview:design principle>)
using markdown anchor. for example, set `myst_heading_anchors = 3`
[](../overview/overview.md#design-principle)
So I have to rewrite all my links using {ref}
. Is there any way to avoid rewriting existing markdown links ([text](file#header)
)?
from sphinx-hoverxref.
Hi, same question/issue here with Myst markdown in Sphinx. Commenting here for visibility.
from sphinx-hoverxref.
What do you make of these @humitos ?
https://myst-parser.readthedocs.io/en/latest/develop/architecture.html#a-sphinx-parser
https://myst-parser.readthedocs.io/en/latest/develop/background.html#the-relationship-between-myst-restructuredtext-and-sphinx
from sphinx-hoverxref.
Am I doing something wrong, or are external
roles not supported? I tried on a .md
file as:
{external+rtd:std:doc}`test<intro/getting-started-with-sphinx>`
but that did not seem to work. ref
with hoverxref_auto_ref
seemed to work, but I am not sure how to translate the equivalent of <inv:rtd:std:doc#intro/getting-started-with-sphinx>
to that. I've also tried doc
as:
{doc}`test<rtd:index>`
~~but that did not work either. ~~ Actually it works, I did not configure hoverxref_intersphinx
appropriately
Basically what would be the minimum setup and supported roles that could be used? Ideally compared to myst documentation here and here
from sphinx-hoverxref.
@humitos is this reference useful? Or maybe the class of that caller is needed?
from sphinx-hoverxref.
Related Issues (20)
- Dependabot: it does not work as expected HOT 1
- Manual references (`.. _quickstart::`) seem to not work properly HOT 1
- Image inside tooltips don't render HOT 3
- Logging: log only once each unknown `typ` HOT 3
- Improve CSS UX of links HOT 2
- Add branding to hover
- Content not loading HOT 3
- Docs: expand "Who is using it" with project's descriptions
- Dark mode support HOT 3
- test_intersphinx_all_mappings is unstable
- Help with packaging `sphinx-hoverxref` for `conda-forge` HOT 10
- support sphinx 6.0 without jquery HOT 2
- Start a stand alone JS package for hoverxref HOT 3
- Support sphinx-design tabs HOT 3
- Internal References not displaying on Hidden builds. HOT 4
- https://github.com/readthedocs/sphinx-hoverxref/blob/6ff2d6007bbc8a5b84da87d2b7a87c8bb8205153/hoverxref/domains.py#L1 HOT 1
- Tooltip content fails to generate HOT 3
- Broken rendering of 'usage' page on readthedocs HOT 3
- Tooltip Content Not Generating with Read the Docs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-hoverxref.