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

[Show]My fork of the toc extention(sidebar) #532

Closed
cqcn1991 opened this Issue Mar 12, 2016 · 11 comments

Comments

Projects
None yet
5 participants
@cqcn1991
Copy link

cqcn1991 commented Mar 12, 2016

toc

Just to show you guys what I've done so far, thanks for all your help.
The problem is that, I deleted a lot of code, and make it un-compatible with original toc2, what should I do? Do we need a 3rd toc extension? LOL

Another thing is that, I want to make it outputable. When I save the notebook as html, the sidebar is not there. Is it possible to output it as well?

@Kevin-McIsaac

This comment has been minimized.

Copy link
Contributor

Kevin-McIsaac commented Mar 12, 2016

This is great and I think I'd use it.! I've no problem with having a new extension. BTW, Google docs does something very, very similar.

@jcb91

This comment has been minimized.

Copy link
Member

jcb91 commented Mar 13, 2016

I'm sure it'd be possible to merge your version and toc2 - they seem to essentially do the same thing, just with slightly different places to insert the toc html, which is easy to alter with a little jquery, as in help_panel. But, at the same time, I think it'd also be fine to start out by adding a second extension in parallel, then people can always choose which they want to use.

I currently have no idea how to make it outputtable - I've never really used notebook output functionality. That said, it must be possible. Quite how to go about it will depend on how the output's produced - whether it's done by the notebook js (in which case you can probably patch your own js in somehow), or through nbconvert or something (in which case you'd have to write a postprocessor in python, see other extensions for examples).

@jankatins

This comment has been minimized.

Copy link
Member

jankatins commented Mar 13, 2016

It would be great if this could become a config option... I always hated that the centered notebook wasts so much screen space which the ToC couldn't use :-(

@jankatins

This comment has been minimized.

Copy link
Member

jankatins commented Mar 13, 2016

output as in "File -> Download as ..." is produced by nbconvert. So you would have to write a nbconvert preprocessor which includes some bits in the output which are the ToC. So basically a rewrite of the ToC functionality in python... Or go the way of the current toc, which can add a new cell to the front with a toc which would then also be converted.

@jfbercher

This comment has been minimized.

Copy link
Member

jfbercher commented Mar 13, 2016

Hi all,

  • I think that it should be easy to integrate a sidebar version in the current toc2 version, and probably regrettable to not do it. The only difference it the location of the container for actually writing the toc.
  • The very best would be to have something dockable -- that is a floating window that can be docked as a sidebar, either on the right or on the left. At least, it would be easy to add a button that docks/undock the toc as a sidebar (and store the current state). Anyway the sidebar looks good.
  • The export question is an important one, indeed. The point is that the modifications are live and not written in the notebook itself, thus not converted. A possible option would be to execute (part of the ) toc2 code against the notebook file as a preprocessing step, eg using nodejs, in order to recreate the section numbers and toc table itself.
  • [Note that it might be possible to save the numerotation in the notebook at any-time. This could be enabled by an option. I didn't do it because it leads to pbs when converting to LaTeX.]
@cqcn1991

This comment has been minimized.

Copy link

cqcn1991 commented Mar 14, 2016

I think merging would be possible. I hacked the CSS layout using Bootstrap's grid system, that may require some more rigors CSS writing. Some other details (like hiddening the number section) are more like my personal preference.

The real issue is that, the file is growing so complex, that maintaining it would be very difficult.

@jcb91

This comment has been minimized.

Copy link
Member

jcb91 commented Mar 14, 2016

@cqcn1991 if you were to publish your fork, it might be easier for people to suggest potential improvements/ways forward...

@cqcn1991

This comment has been minimized.

Copy link

cqcn1991 commented Mar 14, 2016

@jcb91 sure, but how should I do? PR at here? I'm not sure what to do, since I never cloned the whole project, and my fork of the toc2 is located in the extension directory. Is it possible to directly open source the specific extension repo?

@jcb91

This comment has been minimized.

Copy link
Member

jcb91 commented Mar 14, 2016

Yes, you could make a report specific to your TOC clone, then we can always
merge its history into the collected repo later - I did something similar
with minrk's scratchpad extension recently.
On 14 Mar 2016 1:53 p.m., "cqcn1991" notifications@github.com wrote:

@jcb91 https://github.com/jcb91 sure, but how should I do? PR at here?
I'm not sure what to do, since I never cloned the whole project, and my
fork of the toc2 is located in the extension directory. Is it possible to
directly open source the specific extension repo?


Reply to this email directly or view it on GitHub
#532 (comment)
.

@cqcn1991

This comment has been minimized.

Copy link

cqcn1991 commented Mar 18, 2016

@jcb91 I just uploaded it. https://github.com/cqcn1991/sidepyter
But the problem is that, I didn't use git as first, so it may be quite a bit work to know what code has changed. I don't know how can I change the readme.md, I don't have a markdown editor in my pc. I'll find time to update the readme.

Just let me know what I need to do.

Addtionally, it's a big let down for me to know that scrollspy is uncompatible with the current version of Jupyter Notebook (jupyter/notebook#1202). We could have pushed the toc2 further.

@jcb91

This comment has been minimized.

Copy link
Member

jcb91 commented Jun 13, 2016

closing this as #593 is merged

@jcb91 jcb91 closed this Jun 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment