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
nbconvert - ReST .. code:: directive #6100
Comments
The code directive is a standard part of rst: Sphinx uses code-block instead - there is a reason, but I can't remember it just now. I thought code still worked, but maybe that's not the case. Maybe we need a sphinx-rst template. |
Thanks a lot for your quick reply. Maybe there is also a simple way to modify my rst-template locally so that I get 'code-block' instead of 'code'. Do you have any insight in how this might be achieved? I'll try to check whether I can convince sphinx to accept the code directive instead of code-block also. In the worst case I might need to postprocess all the generated .rst files, but it would be nice if that wouldn't be necessary. Thanks |
It was indeed easy to modify rst.tpl. Replacing the 'code' by the 'code-block' directive did the job for me. Maybe a sphinx-rst.tpl option could be a fix, but it seems strange to me that sphinx doesn't accept 'code' despite it being a standard rst-directive. |
+1. Would love to see this happen --to sphinx or something, would just make life easier. |
Just tried with latest sphinx and it is now accepting |
Hi,
I have encountered a problem when converting .ipynb files to .rst. Code cells are marked using the ".. code:: python" directive.
Using sphinx to build html using the .rst files generated via nbconvert fails with the following error.
ERROR: Unknown directive type "code".
.. code:: python
In the sphinx-docs I have found ".. code-block:: python" directive instead.
Is this a bug of nbconvert or am I using an outdated version of sphinx.
I am glad for any suggestions.
Thanks,
Ben
The text was updated successfully, but these errors were encountered: