-
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
hide_input Need better documentation for using with nbconvert #740
Comments
Same here! Would love some updated explanations regarding the template usage. 😄 |
We now have docs at http://jupyter-contrib-nbextensions.readthedocs.io/en/latest I will try to add some more documentation there. |
Hey @juhasch, I've been able to use the template if I place all in one folder ( Thanks for sharing the docs! |
the main install does attempt to alter nbconvert config to include the package's templates directory in install.py#L149-L152, but it's possible that that either didn't happen correctly, or isn't being read. There's another subtle complication, that if you specify a config with a different filename (e.g.
command. If you want to add your own templates system-wide, you can put them all in a folder (let's say from jupyter_contrib_core.notebook_compat import nbextensions
from traitlets.config.manager import BaseJSONConfigManager
user, sys_prefix = True, False
config_basename = 'jupyter_nbconvert_config'
my_templates_directory = '/users/josh/nbconvert_stuff/templates'
config_dir = nbextensions._get_config_dir(user=True, sys_prefix=False)
cm = BaseJSONConfigManager(config_dir=config_dir)
config = cm.get(config_basename)
config.setdefault('Exporter', {}).setdefault('template_path', []).append(
my_templates_directory)
cm.set(config_basename, config) adjusting the flags user & sys-prefix to set which config directory you want (the per-user one is |
Thanks a lot @jcb91! This explanation really helped to understand how everything fits together. I'd say that adding this example to the docs makes no harm and people that were searching for this now have a complete example 😄 Thanks again for the explanation! |
in light of [ipython-contrib#740](ipython-contrib#740)
I am trying to get hidden input cells to persist with nbconvert --to html. The documentation in readme could use more detail. As it is, I can't get to where I need to go.
The readme for hide_input states
To export a notebook with hidden cells using nbconvert, you need to add a custom template and a custom filter:
The text was updated successfully, but these errors were encountered: