-
Notifications
You must be signed in to change notification settings - Fork 132
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
WARNING: Content block expected for the "raw" directive; none found. #620
Comments
Following up here. It seems like the |
Yes, but this is an implementation detail, see #36.
There are (at least) two ways to do this:
Both should give you a reST document, but the second method doesn't includes things like Using the linked file above, I don't find anything suspicious on line 15, but maybe there are some project specific settings in place? |
PS: it looks like none of the two options contain |
We recently updated that file to remove the offending metadata added by Colab, try with this commit: https://github.com/microsoft/torchgeo/blob/7d90045b9b2fe456dd42b3c1eb6819d7514825ad/docs/tutorials/indices.ipynb |
OK, I found the problem ... it can be quite brittle to programmatically generate reST files ... The line number was confusing, the error was far from there, in the output of the cell starting with "outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" \r"
]
}
], Since the output only contains whitespace, this led to a syntax error in the auto-generated reST file. I've fixed this problem in #621. |
Thanks for quickly finding the issue @mgeier. We're also seeing this error over on -nbsphinx 0.8.7
+nbsphinx 0.8.8 /home/runner/work/pyhf/pyhf/docs/examples/notebooks/learn/UsingCalculators.ipynb:15: WARNING: Content block expected for the "raw" directive; none found.
/home/runner/work/pyhf/pyhf/docs/examples/notebooks/multichannel-coupled-histo.ipynb:17: WARNING: Content block expected for the "raw" directive; none found.
/home/runner/work/pyhf/pyhf/docs/examples/notebooks/toys.ipynb:15: WARNING: Content block expected for the "raw" directive; none found. where the notebooks in question are I see that you've already made a patch for this in PR #621 (:pray:) so I'll install from your fork in CI and see if that fixes things. edit: Yeah, a diff of @@ -31,6 +31,13 @@ jobs:
python -m pip list
sudo apt-get update
sudo apt-get -qq install pandoc
+
+ - name: Patch dependencies
+ run: |
+ python -m pip uninstall -y nbsphinx
+ python -m pip install --upgrade "git+https://github.com/mgeier/nbsphinx.git@protect-from-empty-text#egg=nbsphinx"
+ python -m pip list
+
- name: Check docstrings
run: |
# Group 1 is related to docstrings fixes our CI. 👍 |
* Disallow nbsphinx v0.8.8 as it introduces a bug for empty 'raw' directives. - c.f. spatialaudio/nbsphinx#620
Work around for spatialaudio/nbsphinx#620 Should be fixed in the next release of nbspinx (spatialaudio/nbsphinx#621).
Congrats on the new release! We just noticed a change in behavior in our CI that we're having trouble debugging. When Sphinx tries to build the https://github.com/microsoft/torchgeo/blob/main/docs/tutorials/indices.ipynb file, it prints the warning:
However, this file is all markdown, not rST, so we aren't directly using a "raw" directive. I'm not familiar with the inner workings of nbsphinx. Does it convert .ipynb files to .rst files so that Sphinx can convert .rst files to .html? If so, it would help to see the intermediate .rst file for this notebook to see where the "raw" directive is being added.
The text was updated successfully, but these errors were encountered: