Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fixed html doc usage docs to fix 6.x #1386
Fixed html doc usage docs to fix 6.x #1386
Changes from 1 commit
2fee22e
b429b10
7f858c5
f0ee233
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be useful to also document the “embeddable” version, which would be
--template-file=classic/base.html.j2
(orlab/
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--template=classic
is preferred over--template-file=classic/base.html.j2
. It's possible in a future release that when the backwards compatibility is removed that the second pattern might not work that way anymore (--template=classic --template-file=notbase.html.j2
might be required in some distance release, or no support template-file at all). https://nbconvert.readthedocs.io/en/6.0.2/changelog.html?highlight=--template-file#id3 outlines how to use template-file to refer to a specific.tpl
5.x file.I'm hesitant to promote it more elsewhere for other uses because some of these always-supported patterns made the 6.0 upgrade harder. But I could be convinced it's a good idea to document it more if people feel strongly about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--template=classic
is not a replacement forbasic
/classic/base.html.j2
, because it produces a full 13k line (?!) HTML document with styles and JS. This is not usable for embedding, at least not without using a HTML parser to get rid of the 13k lines of<head>
.classic/base.html.j2
produces just the notebook code and expects styles to be added in elsewhere (and we do it that way in Nikola).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm you're correct. I wasn't as involved with the html template changes from 5.x to 6.x. It looks like adding
--template-file=base.html.j2
along with--template=classic
gets you back to close to the original--template=base
pattern without all the styles and JS. Can you try that and see if it matches expectations? I can discuss with the other maintainers how to better preserve that capability in a clearer format with the new system if so.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work, both from the command line and code. It would be good to have an officially recommended way to do this in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Thanks for raising the concern and documentation gap. I'll talk with the other maintainers and see if we want to introduce an easier way to run this combination before I document it, but I don't believe we'll remove the pattern that worked for you here.