-
Notifications
You must be signed in to change notification settings - Fork 505
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
Feature: template and theme override #637
Feature: template and theme override #637
Conversation
e845be1
to
deaee4f
Compare
Note that this PR also changes the static URL to include a hash, like `voila.js?v=ae356' such that we don't get bitten by aggressive caching. This is a feature of tornado, that also the notebook uses, and we simply didn't make use of. |
f068dea
to
74b866a
Compare
allow_template_override = Enum(['YES', 'NOTEBOOK', 'NO'], 'YES', help=''' | ||
Allow overriding the template (YES), or not (NO), or only from the notebook metadata. | ||
''').tag(config=True) |
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.
Wondering whether something like ['url', 'notebook', 'all']
would sound more explicit?
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.
My reasoning was that you probably don't want the combination of 'permit from URL', but not from notebook metadata. Or can you come up with te use case?
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 was mostly for users who want to set the option without reading the docs or the help string, to know what 'YES' and 'NO' mean in this case.
Nice, thanks @maartenbreddels 👍 We will probably want to add a quick word about this feature in the docs too. |
608a22b
to
e3ce714
Compare
Closes #105 |
1cf5d01
to
40153be
Compare
example format: {"voila":{"template","default"}}
To implement this, we had to redo the static resources handling, which is now using a path like: voila/templates/<template_name>/static/path/to/file.js Since we use the StaticFileHandler from tornado, we should have used the ?v=<hash> feature, which is now always used, to avoid aggresive caching by browsers.
40153be
to
3354ceb
Compare
Implements #635 Replaces #629, #201 and #258
This allow overriding the template and theme, e.g.:
Or via notebook metadata:
Configuration to disable this: