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
The rst contents directive does not work with sagenb (wrong anchors) #17371
Comments
comment:1
Can you be more specific about what you mean by "does not work"? Are you using (I ask, but of course I don't know much about ReST directives, so I'm not sure I can help you immediately.) Then I can report this "upstream" as well. |
comment:2
The problem appears when i upload the rst file directly from the notebook. For the table of contents directive, you can have a look at http://docutils.sourceforge.net/docs/ref/rst/directives.html#table-of-contents Now i tried to translate it into a sws file first, and i get the following error:
This problem seems unrelated to the |
comment:3
My guess on the original problem is that https://github.com/sagemath/sagenb/blob/master/sagenb/notebook/docHTMLProcessor.py isn't handling this properly. I wonder if that might also happen with an html document with intra-document links? If you could run docutils on your rst file and then upload that html file to the notebook and see what happens, that could also be useful. Or post a minimal rst file that doesn't work. Sebastien, looks like you wrote the rst converter - any ideas? I get the same error for the Once again, Sebastien, I think you wrote this - any ideas? Sorry for the double question, just trying to figure this out and I haven't looked closely at either of these things before.
Maybe new notebooks no longer have a default admin user. I can confirm that this did work in Sage 5.2, but already was broken in Sage 5.13... That only narrows it down between sagenb-0.9.1 and 0.10.7.2, unfortunately. |
comment:4
Okay, I figured out the (very) short answer to the second question. At some point new users were no longer created for a notebook, apparently. It's no problem to fix, though. diff --git a/src/bin/sage-rst2sws b/src/bin/sage-rst2sws
index 0a7b92b..33e7721 100755
--- a/src/bin/sage-rst2sws
+++ b/src/bin/sage-rst2sws
@@ -131,6 +131,7 @@ worksheet_txt = translator.process_doc_html(html)
from sagenb.notebook.notebook import Notebook
from sage.misc.misc import tmp_dir
nb = Notebook(tmp_dir()+'.sagenb')
+nb.user_manager().create_default_users('password')
# create a worksheet
W = nb.create_new_worksheet(title, 'admin') But I won't make a branch for that quite yet. Looking at it a bit more, the original problem is really with the refs. (I discovered this from the errors I got in a successful run of |
comment:5
Bonjour Karl, Thierry,
|
comment:6
Indeed, in 6.5.beta0
but I can confirm that there is still the same thing. But I don't think this is actually problematic. It even says back-references. Right?
Unless I am missing something. However, when I do something with
|
Attachment: file.rst.gz |
comment:7
And yes it is true that docutils is just putting these things in order with id numbers. So in that sense intra-doc links will not work properly, if they pre-existed - I guess one has to use Sphinx, I don't know? But that might be a bit much to combine with sagenb. |
comment:8
outdated, should be closed |
The following RST directive does not work in the notebook:
The table of contents are created, but the anchors do not correspond, titles are replaced bu IDs.
This bug seems not new but i do not find it on the trac.
CC: @nthiery @seblabbe @sagetrac-tmonteil @dimpase
Component: notebook
Issue created by migration from https://trac.sagemath.org/ticket/17371
The text was updated successfully, but these errors were encountered: