-
Notifications
You must be signed in to change notification settings - Fork 568
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
Comprehensive edit doc files for grammar and understanding #1389
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,7 +349,7 @@ | |
"source": [ | ||
"There are an endless number of transformations that you may want to apply to a notebook. In particularly complicated cases, you may want to actually create your own `Preprocessor`. Above, when we customized the list of preprocessors accepted by the `HTMLExporter`, we passed in a string -- this can be any valid module name. So, if you create your own preprocessor, you can include it in that same list and it will be used by the exporter.\n", | ||
"\n", | ||
"To create your own preprocessor, you will need to subclass from `nbconvert.preprocessors.Preprocessor` and overwrite either the `preprocess` and/or `preprocess_cell` methods." | ||
"To create your own preprocessor, you will need to subclass from `nbconvert.preprocessors.Preprocessor` and overwrite either the `preprocess` and/or `preprocess_cell` methods. As of version 6.0, subclasses likely will need to call `super().preprocess_cell()` or something functionally equivalent to `NotebookClient.async_execute_cell`. In general, `super().preprocess_cell()` is best to minimize the complexity and subtlety of the multi-inheritance and overrides at play." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
] | ||
}, | ||
{ | ||
|
@@ -508,7 +508,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.2" | ||
"version": "3.8.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
.. highlight:: none | ||
|
||
Using as a command line tool | ||
============================ | ||
Using the command line tool | ||
=========================== | ||
|
||
The command-line syntax to run the ``nbconvert`` script is:: | ||
``nbconvert`` can be run from the command line using:: | ||
|
||
$ jupyter nbconvert --to FORMAT notebook.ipynb | ||
|
||
This will convert the Jupyter notebook file ``notebook.ipynb`` into the output | ||
For example, nbconvert will convert the Jupyter notebook file ``notebook.ipynb`` into the output | ||
format given by the ``FORMAT`` string. | ||
|
||
Default output format - HTML | ||
---------------------------- | ||
The default output format is HTML, for which the ``--to`` argument may be | ||
nbconvert's default output format is HTML, and the ``--to`` argument may be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh this changed actually -- if you do not specify a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That probably means we need to find all the |
||
omitted:: | ||
|
||
$ jupyter nbconvert notebook.ipynb | ||
|
@@ -206,7 +206,7 @@ Markdown | |
.. _convert_ascii: | ||
|
||
Ascii | ||
~~~~~~~~ | ||
~~~~~ | ||
* ``--to asciidoc`` | ||
|
||
Ascii output. | ||
|
@@ -301,18 +301,19 @@ the output may be sent to standard output with:: | |
|
||
Converting multiple notebooks | ||
----------------------------- | ||
Multiple notebooks can be specified from the command line:: | ||
Multiple notebooks can be specified from the command line for execution:: | ||
|
||
$ jupyter nbconvert notebook*.ipynb | ||
$ jupyter nbconvert notebook1.ipynb notebook2.ipynb | ||
|
||
or via a list in a configuration file, say ``mycfg.py``, containing the text: | ||
A list in a configuration file may also be used. For example, in a config file ``mycfg.py``, | ||
a list of notebooks can be specified: | ||
|
||
.. code-block:: python | ||
|
||
c = get_config() | ||
c.NbConvertApp.notebooks = ["notebook1.ipynb", "notebook2.ipynb"] | ||
|
||
and using the command:: | ||
and then executed using the command:: | ||
|
||
$ jupyter nbconvert --config mycfg.py |
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 we should add a note that nbclient is the natural successor for programmatic execution of notebooks, but that the interface remains here in nbconvert for extension and mixin of the preprocessor concept, and that papermill has a more extensive and robust command line interface than nbconvert for stand alone notebook execution. Many people using nbconvert execute don't know about those other options or when one is better to use.