Fix hyperlink rendering in Optax API docs on ReadTheDocs
See original GitHub issueCurrently, the Markdown-flavored links (inside Python files) in Optax API docs (from Python doc strings) appear to not render well on the ReadTheDocs site.
For example, this (source: https://github.com/deepmind/optax/tree/master/optax/_src/alias.py#L322#L374):
def rmsprop(
...
) -> base.GradientTransformation:
"""A flexible RMSProp optimiser.
...
References:
[Tieleman and Hinton, 2012](
www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf)
[Graves, 2013](https://arxiv.org/abs/1308.0850)
...
translates into this (source: https://optax.readthedocs.io/en/latest/api.html#rmsprop):

Potential solutions:
- Try reStructuredText-flavored formatting for links (since Sphinx likes rST) and see if this fixes the rendering:
`Text <URL>`_
(Source: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#hyperlinks)
- Alternatively, avoid introducing rST in Python files and, instead, remove Markdown-flavored links (
[text](URL)
) to keep things simple, like in Haiku docs, since most links are from arXiv and they are quite short:
- [Graves, 2013](https://arxiv.org/abs/1308.0850)
+ Graves, 2013 https://arxiv.org/abs/1308.0850
which is similar to https://dm-haiku.readthedocs.io/en/latest/api.html#id1:
class Linear(hk.Module):
"""Linear module."""
def __init__(
...
):
"""Constructs the Linear module.
Args:
...
w_init: Optional initializer for weights. By default, uses random values
from truncated normal, with stddev ``1 / sqrt(fan_in)``. See
https://arxiv.org/abs/1502.03167v3.

LMKWYT @mtthss
I can open a PR 👍
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Frequently Asked Questions - Read the Docs
Frequently Asked Questions¶. My project isn't building correctly¶. First, you should check out the Builds tab of your project. That records all of...
Read more >Read the Docs Documentation
Read the Docs simplifies software documentation by building, versioning, and hosting of your docs, automatically.
Read more >optax | Read the Docs
Versions · Repository · Project Slug · Last Built · Maintainers · Badge · Tags · Short URLs.
Read more >Read the Docs Documentation
This quick start will walk you through creating the basic configuration; in most cases, you can just accept the defaults.
Read more >NumPyro Documentation - Read the Docs
The model code should look very similar to Pyro except for some minor differences between PyTorch and Numpy's API. See the example below....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Since this has been fixed in #126 I’m closing this issue for now. Thanks for reporting!
@mtthss Let’s try this - from StackOverflow:
which should disable
pylint=max-line-length=80
for one line only.https://github.com/deepmind/optax/blob/823af5810cf6af2ee4913771792f42fe24449ee0/.pylintrc#L265
It might help with this TODO: https://github.com/deepmind/optax/blob/823af5810cf6af2ee4913771792f42fe24449ee0/.pylintrc#L267
Also, for multiple lines, this solution could work (based on StackOverflow):