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
ReST support in notebook frontend #873
Conversation
Thanks! This is a good start. We do have plans for rst support, but I think it will have be rendered whole document at a time. The reason rst cells have been disabled is that if cells are rendered on their own, they do not behave as expected. For instance, section levels will not be respected across cells, cross-cell links will not resolve, etc. |
Ok, I see. @minrk: could you put your requirements in a new ticket, please ? So, I could maybe provide useful code then. In a second time, I hope to provide some changes to make the ajax call configurable to connect to a different rendering server (instead of tornado by default) |
Sure thing, I'll try to describe what we need. |
My recollections of our ReST discussions are now in #888. |
@jjehannet, I've also added a number of further points on this to #888 from a recent discussion we had on email... Thanks again for pitching in, this is a hugely important feature so we will get to it; it's just that it's also non-trivial so it will deserve (and require) a bit of design/thought up front. |
@jjehannet, I've played with the code and it's indeed a great start, but as @minrk pointed out, we'll need to back off from rendering reST for now, because it's simply too easy to trigger a docutils error. For example, right now if you have one cell with:
and another with:
the second one produces a "Docutils System Messages" result with an "unknown target name" for the "example" target. So I think that in the long run, we'll probably want a solution that does:
Now, it seems there's already useful code in this PR, so we could start merging things piece by piece, as the full effort will be a big job that will take some time. But in its current form we can't merge it quite yet. I see when I run the notebook it's dumping the html out to the terminal, but I don't know where that's coming from, since your code doesn't have printing. Perhaps those were in the old reST code that @ellisonbg was prototyping? In any case, they should be silenced and turned into logging calls at best, so they aren't seen in normal usage. So question to everyone participating: what do we do with this specific PR? Do we try to polish it and merge it in as a first step on the road towards reST support, or do you think we need to start over with a different approach? I just want to reach a conclusion with this one before it starts having merge conflicts... |
As we add reST cells we need to move to a model where the cell type is selected by a select menu/box rather than clicking on a button. This will require substantial refactoring but will more easily open the door to adding other cells types, such as the heading cells @fperez discusses. I guess I am 50/50 on simply aborting this PR. But, if we do allow it to live on, we need to remove the reST rendering that is there now. |
@jjehannet, would you wan to rebase and refactor it to remove the rendering part, so we merge this bit only as an incremental first step towards the model @ellisonbg describes? Or do you prefer to close this PR and work from scratch on the whole problem as discussed above and in more detail in #888? |
I should have said more explicitly that in any event, a rebase is needed right now, because it currently doesn't apply cleanly anymore. |
@fperez: Sorry, I'm afraid I will only refresh the patch for now. I hope to work on it tomorrow. IMO, there is another approach: instead of using just one cell content, we could try to rendering the whole document every time and redispatch cell output afterwards. Not very elegant (!) but we could test a prototype before rejecting. |
If we render the entire document to HTML, there is no way to extract On Wed, Nov 30, 2011 at 10:47 AM, Julien Jehannet
Brian E. Granger |
On Wed, Nov 30, 2011 at 10:57 AM, Brian E. Granger
Just to say that I concur with this view, Julien. I think it would be
So users who are running smaller documents on a fast/local network |
Even if we could get this working and it was off by default, I don't On Wed, Nov 30, 2011 at 12:00 PM, Fernando Perez
Even if we could get this working and it was off by default it adds
Brian E. Granger |
RST support is being added in PR #1331. |
Hello,
I'm working on the integration of the notebook app into the Logilab's framework named CubicWeb.
Here a first patch about minor changes to enable ReST format in frontend.
Cheers from Logilab !