Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m-rossi/jupyter-docx-bundler
Jupyter bundler extension to export notebook as a docx file
https://github.com/m-rossi/jupyter-docx-bundler
docx jupyter jupyter-notebook jupyter-notebook-extension jupyterlab
Last synced: 3 months ago
JSON representation
Jupyter bundler extension to export notebook as a docx file
- Host: GitHub
- URL: https://github.com/m-rossi/jupyter-docx-bundler
- Owner: m-rossi
- License: mit
- Created: 2017-11-02T12:11:04.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T09:44:42.000Z (about 1 year ago)
- Last Synced: 2024-10-31T19:41:43.280Z (4 months ago)
- Topics: docx, jupyter, jupyter-notebook, jupyter-notebook-extension, jupyterlab
- Language: Python
- Homepage:
- Size: 249 KB
- Stars: 39
- Watchers: 5
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Jupyter docx bundler extension
[](https://pypi.org/project/jupyter-docx-bundler/)
[](https://anaconda.org/conda-forge/jupyter-docx-bundler)
[](https://anaconda.org/mrossi/jupyter-docx-bundler)
[](https://github.com/m-rossi/jupyter-docx-bundler/actions)
[](https://codecov.io/gh/m-rossi/jupyter-docx-bundler)Jupyter bundler extension to export notebook as a docx file
## Installation
### Using conda
```
conda install -c conda-forge jupyter-docx-bundler
```### Using pip
Make sure you have [Pandoc](https://pandoc.org) installed, see [installing-pandoc](https://github.com/bebraw/pypandoc#installing-pandoc) for instructions.
```
pip install jupyter-docx-bundler
```## Usage
### Adding Metadata
The bundle extension uses metadata of the notebook, if you you provide it.
* `"title": "Notebook title"`
* `"authors": [{"name": "author1"}, {"name": "author2"}]`
* `"subtitle": "Notebook subtitle"`
* `"date": "Notebook date"`The notebook metadata can be edited under _Edit_ -> _Edit Notebook Metadata_.
### Hiding inputs or complete code cells
You can hide individual code cells or just their inputs by defining cell tags:
* `nbconvert-remove-cell`: Remove the entire cell
* `nbconvert-remove-input`: Remove the input code of the cell_(Currently there are no default values configured for these tags, the ones listed above are defined in my code and not in [nbconvert](https://github.com/jupyter/nbconvert). This may will change in the future.)_
Cell tags can be shown by activating the cell toolbar under _View_ -> _Cell Toolbar_ -> _Tags_.
#### Hiding all inputs
It is also possible to hide all inputs. To achive this you need to add the following lines to your notebook metadata:
```json
{
"jupyter-docx-bundler": {
"exclude_input": "True"
}
}
```The notebook metadata can be edited under _Edit_ -> _Edit Notebook Metadata_.
### Direct call from console (nbconvert)
To use the bundler direct from console the nbconvert utility can be used with target format docx:
* `jupyter nbconvert --execute --to=docx .ipynb --output .docx`
The `--execute` option should be used to ensure that the notebook is run before generation.
## Development
See [CONTRIBUTING](CONTRIBUTING.md)