nbconflux converts Jupyter Notebooks to Atlassian Confluence pages using nbconvert.
nbconflux is useful when:
noinput
,
nooutput
, or nocell
nbconflux
to identify content that originated as notebooksThe nbconflux library requires Python 3 to run and pip
to install.
Once you've satisfied these prerequisites, run:
pip install nbconflux
(A conda package is coming soon.)
nbconflux /path/to/a.ipynb https://your/page/url
import nbconflux
html, resources = nbconflux.notebook_to_page(nb_path, url)
If you receive an error, see the project issues for known limitations on what you can post.
Run nbconflux -h
at the command line for additional options and help.
usage: nbconflux [-h] [--exclude-toc] [--exclude-ipynb] [--exclude-style]
[--include-mathjax]
notebook url
Converts Jupyter Notebooks to Atlassian Confluence pages using nbconvert
positional arguments:
notebook Path to local notebook (ipynb)
url URL of Confluence page to update
optional arguments:
-h, --help show this help message and exit
--exclude-toc Do not generate a table of contents
--exclude-ipynb Do not attach the notebook to the page
--exclude-style Do not include the Jupyter base stylesheet
--include-mathjax Enable MathJax on the page
--extra-labels EXTRA_LABELS [EXTRA_LABELS ...]
Additional labels to add to the page
Collects credentials from the following locations:
1. CONFLUENCE_USERNAME and CONFLUENCE_PASSWORD environment variables
2. ~/.nbconflux file in the format username:password
3. User prompts
We welcome issues and pull requests that help improve the variety of notebook content and Confluence installations nbconflux supports, its usability for humans, and its reusability within other tools.
We recommend creating a Python development environment using conda
or
virtualenv
, running make dev-env
to install the runtime and development
requirements, and running make test
to execute the unit test suite on your
local machine.
Q: Why not call it nbconfluence?
A: https://atlassian.com/legal/trademark
Q: Why do I have to create a page on the site first?
A: To avoid introducing the complexity of specifying a space, parent page, and title into the package.
Q: How do I use nbconflux if my organization has enabled two-factor authentication (2FA) for our Confluence Cloud instance?
A: You can login with an Atlassian API Token in place of your password as described in the API tokens documentation.
Copyright (c) 2018 Valassis Digital under the terms of the BSD 3-Clause license
To run the tests:
make dev-env
make test
To make a release:
git commit -m 'REL: 0.6.0' --allow-empty
git tag -a 0.6.0 -m 'REL: 0.6.0'
git push origin master
and git push origin master --tags
or use a PRmake release
.