-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Docs: emojis in TOC captions, FontAwesome on external links in TOC (Diátaxis) #10039
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
Docs: emojis in TOC captions, FontAwesome on external links in TOC (Diátaxis) #10039
Conversation
…ing FontAwesome external link icon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -9,3 +9,15 @@ | |||
#rtd-stickybox-container { | |||
text-align: center; | |||
} | |||
|
|||
.wy-menu.wy-menu-vertical a.reference.external::after { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue for this on all external links, but baby steps :)
Though @humitos had a good point that it makes the link more visible, but I think it's good to be explicit here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though #10026 (comment) that it makes the link more visible, but I think it's good to be explicit here?
The font-awesome icon is much more discreet so I think that it works better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get a feeling that this will cause unintended side-effects.. like if the <a>
is on an <img>
tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, we likely need to scope it smartly. I'm sure there's good examples of doing this other places, but we can start w/ the toctree for now.
hash = hash.replace(/[^0-9a-z\-_]/gi, ''); | ||
// If the hash is inside a tab panel | ||
var tab_with_reference = $(".sphinx-tabs-panel #" + hash).parents(".sphinx-tabs-panel"); | ||
if (hash) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What changed in this file? Seems like it needs a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git diff is awful, it was just a matter of adding if (hash) {
to fix a JS error occurring on all pages.
It's explained in line 22, the following code is pretty verbose:
// Uses a hash referencing a Sphinx label from the URL page#sphinx-label
var hash = window.location.hash.substr(1);
if (hash) {
...
Is there any chance this feature and usage is documented in the user guide? I'd like to use emoji's in my docs, but can't figure a way to add the sphinxemoji module myself... And even if I think I succeeded, the substitution doesn't happen and I get raw |:emojicodehere:| output. |
@gwilku you can actually use emojis directly in your code. Using an extension isn't required. Here is the raw code: https://raw.githubusercontent.com/readthedocs/readthedocs.org/main/docs/user/index.rst Small tip: You should check that your text editor can display emojis, though, since it's really annoying to edit files with emojis that aren't shown in the editor. Most modern text editors do. Good luck! |
Yes, but it crashes PDF generator. these unicode characters are not
supported.
śr., 15 mar 2023, 16:13 użytkownik Benjamin Balder Bach <
***@***.***> napisał:
… @gwilku <https://github.com/gwilku> you can actually use emojis directly
in your code. Using an extension isn't required. Here is the raw code:
https://raw.githubusercontent.com/readthedocs/readthedocs.org/main/docs/user/index.rst
Small tip: You should check that your text editor can display emojis,
though, since it's really annoying to edit files with emojis that aren't
shown in the editor. Most modern text editors do.
Good luck!
—
Reply to this email directly, view it on GitHub
<#10039 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUIXHN3HAI3PF24BBRM7PLW4HMCNANCNFSM6AAAAAAU6F5JXM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@gwilku interesting! You can perhaps use the |
Refs: #10026 (comment)
📚 Documentation previews 📚
docs
): https://docs--10039.org.readthedocs.build/en/10039/dev
): https://dev--10039.org.readthedocs.build/en/10039/