Skip to content
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

“Using as a command line tool” docs list outdated template names #1384

Closed
Kwpolska opened this issue Sep 13, 2020 · 3 comments · Fixed by #1386
Closed

“Using as a command line tool” docs list outdated template names #1384

Kwpolska opened this issue Sep 13, 2020 · 3 comments · Fixed by #1386

Comments

@Kwpolska
Copy link

The Using as a command line tool documentation page lists full and basic as valid options for --template with the HTML exporter. Those templates are no longer supported in v6.0.2:

$ jupyter nbconvert --to html --template full hello.ipynb
Traceback (most recent call last):
  File "venv/lib/python3.8/site-packages/traitlets/traitlets.py", line 528, in get
    value = obj._trait_values[self.name]
KeyError: 'template_paths'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/bin/jupyter-nbconvert", line 8, in <module>
    sys.exit(main())
  File "venv/lib/python3.8/site-packages/jupyter_core/application.py", line 270, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "venv/lib/python3.8/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "venv/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 350, in start
    self.convert_notebooks()
  File "venv/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 519, in convert_notebooks
    self.exporter = cls(config=self.config)
  File "venv/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 323, in __init__
    super().__init__(config=config, **kw)
  File "venv/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 115, in __init__
    self._init_preprocessors()
  File "venv/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 489, in _init_preprocessors
    conf = self._get_conf()
  File "venv/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 505, in _get_conf
    for path in map(Path, self.template_paths):
  File "venv/lib/python3.8/site-packages/traitlets/traitlets.py", line 556, in __get__
    return self.get(obj, cls)
  File "venv/lib/python3.8/site-packages/traitlets/traitlets.py", line 535, in get
    value = self._validate(obj, dynamic_default())
  File "venv/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 516, in _template_paths
    template_names = self.get_template_names()
  File "venv/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 577, in get_template_names
    raise ValueError('No template sub-directory with name %r found in the following paths:\n\t%s' % (base_template, paths))
ValueError: No template sub-directory with name 'full' found in the following paths:
	/Users/[user]/Library/Jupyter
	venv/share/jupyter
	/usr/local/share/jupyter
	/usr/share/jupyter
$ jupyter nbconvert --to html --template basic hello.ipynb
[snip same traceback]
  File "venv/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 577, in get_template_names
    raise ValueError('No template sub-directory with name %r found in the following paths:\n\t%s' % (base_template, paths))
ValueError: No template sub-directory with name 'basic' found in the following paths:
	/Users/[user]/Library/Jupyter
	venv/share/jupyter
	/usr/local/share/jupyter
	/usr/share/jupyter
$ jupyter nbconvert --to html --template lab hello.ipynb
[NbConvertApp] Converting notebook hello.ipynb to html
[NbConvertApp] Writing 566556 bytes to hello.html

Please update the docs to list the new templates, as well as the upgrade paths from basic and full. (It would be even better if the old names were supported by the new version.)

Nbconvert version: 6.0.2

@MSeal
Copy link
Contributor

MSeal commented Sep 13, 2020

Thanks for raising -- I'll get a PR up now to update to docs. Should be --template lab and --template classic now unless you're using a custom template.

We changed the names explicitly because basic and full are confusing now as compared to when they were first introduced as the ecosystem around them has changed dramatically. Given the major version change and the fact that the default changed substantially I think we'll leave the old names not working so users know there's a difference and that it'll look dramatically different.

@MSeal
Copy link
Contributor

MSeal commented Sep 13, 2020

Hmm though reading the code from that change there is actually supposed to be a working backwards compatibility layer that prints big warning about the old names being changed. I'll look into why that didn't work in this instance.

@MSeal
Copy link
Contributor

MSeal commented Sep 13, 2020

Still one PR open about this that would fix the backwards compatibility for old names with a warning, but the docs are updated now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants