-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add sphinx-codeautolink extension to docs build #7011
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
base: main
Are you sure you want to change the base?
Conversation
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 |
There are a lot of these warnings:
|
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 |
Yep, a weird interaction between rST processing and the IPython transformer. This class of issues fixed in |
@felix-hilden Looks like we still have the same issue with
|
We now have a different error where a error message is being treated as code:
|
Oh yikes, that should also be fixed now! I hope the parsing logic is finally sound. |
Ah now a different one
Thanks for be patient with us! |
That actually might be something for you to change. See the issue and in particular this IPython doc on the lexer implementation. It states that blocks not starting with a console prompt should be considered ordinary (IPython) code. So In/Out won't be expected. Now maybe comments are or should be an exception, but I suspect by moving the comment elsewhere you might get it to pass! If you refuse, I'll have a look at IPython's implementation and how they handle comments 😄 |
It's the second code block here and the source is .. ipython:: python
# only one argument has the 'x' coordinate
arr[0] + 1
# both arguments have the same 'x' coordinate
arr[0] - arr[0] It's rendering properly so it seems like this should just work.
The source block doesn't have In/Out but I guess the extension is receiving the output after IPython has executed the block? I tried moving the comments around which seems to work, but we do this in a lot of places. Is it easy for you to handle it? |
Yep we'll definitely follow what IPython does, now available in |
Wow, it's green! I still see some matching warnings though 🤔 I can have a closer look later if you care about them. |
It works! so on to the next issue :( https://xray--7011.org.readthedocs.build/en/7011/user-guide/data-structures.html# has no links in the first cell. Do you execute ipython cells that are "suppressed" (see https://github.com/pydata/xarray/blob/main/doc/user-guide/data-structures.rst). I think we "suppress" cells with imports at the top of all our doc pages. Thanks again for all your work! |
I'm not familiar with how .. autolink-preface::
import numpy as np
import pandas as pd
import xarray as xr
... or you can also set a global preface in |
This reverts commit ade906444c6b4ce34df1dfca7e167db5fc71a195.
I think that sphinx-codeautolink is different from
sphinx.ext.linkcode
...whats-new.rst
api.rst