-
Notifications
You must be signed in to change notification settings - Fork 806
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] Enabling sidebar/toc output in HTML #584
Comments
I just get
at that url... |
@jcb91 seems like I've accidently deleted the The repo (My notebook) is https://github.com/cqcn1991/Wind-Speed-Analysis/tree/master/output_HTML |
In https://github.com/cqcn1991/Wind-Speed-Analysis/tree/master/lib the |
@jcb91 Thanks alot! I use git in that folder, and I didn't understand why it not show in my repo until you point out that |
Ah, ok, that also makes sense: using git in a subdir of the parent repository will look the same as if the child repo were a submodule, but then the parent's |
@jcb91 https://github.com/cqcn1991/Wind-Speed-Analysis/tree/master/lib/my_toc |
ok, yeah, I can see the directory contents now. I'm not really sure which bits I ought to be looking at though, to be honest. I'm guessing that Looking at If you could see your way to using a fork of this repo, you could submit a PR, and it would be easier to see what had changed, and you might be able to use git commits for your versioning instead of naming your files after versions 😝 |
actually, it seems that the bulk of the new functionality over the existing toc2 is provided by |
@jcb91 Yes, I also think injecting the js and css is really bad practice. But that's the only way I figured could output the toc when output notebook into HTML. And yes, for the sidebar layout, I hack it using the I might not be clear at first. I'm not suggesting making a PR. It's just bad code. However, I want to show you the possibilites: A sidebar is easy to use, and output in HTML also looks good. |
Ah, I see, apologies, I misunderstood slightly. Yes, I see what you mean, this isn't so simple to get into html output. The easiest way to approach this might be to use a toc cell (i.e. a markdown cell created and updated by the nbextension javascript) combined with a preprocessor which can insert appropriate css to alter the display and get it looking like a sidebar. Of course, this might require some hacking to get the toc cell to display as a regular cell as well, but I'm sure it could be done 😝
It'd be nice to have it draggable like with help_panel, but I think the bootstrap approoach is perfectly acceptable for now! I like the idea, anyway 😄 |
@jcb91 Just remembered that I deleted the number label in JS. Instead, I used a pure css implementation, you can see it here: http://stackoverflow.com/questions/2729927/number-nested-ordered-lists-in-html, the second answer. Effect could be seen at https://nbviewer.jupyter.org/github/cqcn1991/Wind-Speed-Analysis/blob/master/Sidepyter_demo.ipynb# This may help to simply the original code a little bit. |
closing this now that #593 is merged |
Hi all,
This is the progress I made so far,
You can see the file here
https://cdn.rawgit.com/cqcn1991/Wind-Speed-Analysis/master/output_HTML/hongqiao_intl.html
Addtionally, this also enables drop-and-run for this extension. Declare this in cell, and it will work (if you have the files).
The text was updated successfully, but these errors were encountered: