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
Automatically add links to URLs in the docs site #4173
Comments
Personally I think it would be okay to add the link brackets (e.g. On the other hand, it's not automatic so we'd need to be cognizant of any new links that get added 🤔 Regardless, we can at least handle the existing links! @obulat are you okay with me converting the body of this issue with that approach and marking it as a good first issue? |
Hi @obulat @AetherUnbound This seems like a "good first issue" 😅 |
Sweet, thank you for your interest in contributing to Openverse! I've assigned this issue to you @madewithkode. If you have any questions, you may leave them here (or in the Slack where you've asked your other setup questions!). Please check out our welcome and quickstart documentation pages for getting started with setting up your local environment. |
Thanks @AetherUnbound . Quick question, for a change like this that doesn't really involve logic changes but can be rather observed visually, what is the checklist to be done before commit? static validation, linting, test etc? Is there a like a pre commit just recipe? |
There is! Once you've followed the setup guide, you should be able to run |
Hi @AetherUnbound, a look at sphinx's docs shows that to hyperlink a text I basically need to do something like this(example from the flickr provider script):
However doing this does not seem to cause the text to be hyperlinked on the generated docs, also, I'd love to know if the sphinx engine/server watches for code changes and reflects changes in real time or do I have to |
The documentation does automatically regenerate with I would recommend only changing the links to be |
Ahhh...Thanks much for this insight. I didn't know there was an extra command to regenerate the html. I had indeed done what you suggested initially with the hyperlink syntax but because I didn't see the changes reflect I had to start tweaking to see if that was the cause lol. |
@AetherUnbound Do you think we could still explore an automatic approach? Otherwise we should probably assume we'll need to redo #4195 once a year. If we're relying on just remembering to wrap links in brackets (or for it to be caught by manual review), it will absolutely drift and require another fix. Either we could implement a basic linting (I think Vale could actually work for this) or use/write a Sphinx plugin to transform things that look like links into links. |
@sarayourfriend This sounds like a more sustainable approach, I'd be interested in working on it as well(with as much guidance as I can get ofc 😅). Let me know if it's something you're willing to delve into now or whenever it becomes priority. P.S: I couldn't avoid using "delve" above, but I can guarantee I'm human 😅 |
I've made an issue here: #4208 - @sarayourfriend would you be able to fill in details about what the Vale approach might look like? @madewithkode you're welcome to take it on if you'd like, depending on which approach feels easier for you! |
Thanks @AetherUnbound. Is it possible to sort of "reserve" this task as I am currently trying to see if I can get my hands on #3847 and possibly get to this once done with that. |
Sure, @madewithkode if you want to leave a comment on #4208, we will then be able to assign it to you 😄 |
I've added a comment on #4208. We might just need to enable a MyST syntax extension. |
Problem
The documentation site does not wrap the URLs in a link, so the URLs are not clickable. See, for example, links on https://docs.openverse.org/catalog/reference/DAGs.html
Description
We should either manually wrap the URLs with links, or add a library that would detect URLs and add links automatically.Per discussion below, we will opt to convert all of the links that are present in module docstrings to be Sphinx-compatible links. This means changing any link that exists in a module docstring in thecatalog/dags/
folder fromhttps://{link}
to<https://{link}>
(note the surrounding<
/>
signs). This applies only to free-standing links (i.e. links that are not created using the markdown syntax:[example](http://{link})
).Here are some examples of the kinds of links that would need to be changed, though this list is non-exhaustive:
openverse/catalog/dags/providers/provider_api_scripts/phylopic.py
Line 9 in d80b590
openverse/catalog/dags/providers/provider_api_scripts/inaturalist.py
Lines 6 to 16 in 4051522
The text was updated successfully, but these errors were encountered: