xarray
xarray copied to clipboard
Add sphinx-codeautolink extension to docs build
I think that sphinx-codeautolink is different from sphinx.ext.linkcode
...
- [x] Closes #7010
- [ ] Tests added
- [ ] User visible changes (including notable bug fixes) are documented in
whats-new.rst
- [ ] New functions/methods are listed in
api.rst
I don't understand why this failed - it works when I build the docs locally, but the RTD build doesn't give me a useful error message...
did you compare the versions? If it works locally, maybe you have a different version of sphinx
or sphinx-codeautolink
(or any other dependency?)
There are a lot of these warnings:
/home/docs/checkouts/readthedocs.org/user_builds/xray/checkouts/7011/doc/whats-new.rst:1: WARNING: invalid syntax (<unknown>, line 6) in document "whats-new"
Parsed source in `ipython` block:
block source: In [66]: ds = xray.Dataset({"x": np.arange(1000)})
In [67]: with xray.set_options(display_width=40):
....: print(ds)
....:
<xarray.Dataset>
Dimensions: (x: 1000)
Coordinates:
* x (x) int64 0 1 2 ... 998 999
Data variables:
*empty*
Hi, it looks like the print output is recognised as Python code and parsed. This shouldn't be happening since your what's-new correctly contains the Out [...]:
prefixes which we use to ignore lines for parsing (although I couldn't find the specific case you presented). I'll test the multiline outputs and provide an update to you.
Yep, a weird interaction between rST processing and the IPython transformer. This class of issues fixed in sphinx-codeautolink==0.12.1
!