PDF export for Drawio diagrams in JupyterLab
Project description
IPyDrawio Export
PDF export of drawio diagrams for JupyterLab.
See the main project repo for more information.
Installation
Note: the
mamba
/conda
installation method ensuresnodejs
is available
mamba install -c conda-forge ipydrawio-export # recommended, or...
conda install -c conda-forge ipydrawio-export # or...
pip install ipydrawio-export
Server Extension
ipydrawio-export
runs as a server extension. When installed, it
should be automatically configured. If problems arise, it can be manually
enabled:
jupyter server extension list # If you don't see it here...
jupyter server extension enable --sys-prefix --py ipydrawio_export # run this...
jupyter server extension list # ... then check it again
Note: If you are starting your server with
jupyter notebook
(notjupyter lab
), the commands above will beserverextension
instead ofserver extension
!
Command-Line Usage
Exporting PDF
PDF can also be generated from the command line:
jupyter drawio-export pdf some_file.dio
If needed, the nodejs
application will be installed into the Jupyter data
path.
jupyter config --paths # it uses the one in the environment
In the future, it's hoped this can be packaged more conveniently.
Provisioning
To ensure the nodejs
application is installed without exporting a PDF (e.g
when building a docker
container).
jupyter ipydrawio-export provision
Provision locations
If defined, these environment variables will be respected, and an
ipydrawio_export
folder will be created within:
$JUPYTER_DATA_DIR
$IPYDRAWIO_DATA_DIR
Otherwise, ipydrawio-export
will provision its files into
{sys.prefix}/share/jupyter/ipydrawio_export
.
Of note:
- access to the internet is required
- this location must be writeable by the user
- there must be about 400MiB available, primarily for
puppeteer
'schromium
The effective location can be verified with:
jupyter ipydrawio-export provision --workdir
Open Source
This work is licensed under the Apache-2.0 License.
The vendored code from @jgraph/draw-image-export2 is also licensed under the Apache-2.0 License.
Copyright 2023 ipydrawio contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ipydrawio-export-1.3.0.tar.gz
.
File metadata
- Download URL: ipydrawio-export-1.3.0.tar.gz
- Upload date:
- Size: 88.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a89abc2105e432888c41494b14f0543c4a50be50079488ea10bb624935deb453 |
|
MD5 | 8ed6ef7c57ce10cd0ed1100d72ceb56b |
|
BLAKE2b-256 | c635e341b46d5949c22b63ce83a7a7d33c42d5772ab885f09b12e0aa5faffa9d |
File details
Details for the file ipydrawio_export-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: ipydrawio_export-1.3.0-py3-none-any.whl
- Upload date:
- Size: 81.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a6ac5da36619b478bd3a0bb1a5908668ac10888bda8360761fb4e4b017c6c94 |
|
MD5 | 321a787ef715b92a84c051d0fca9b8e0 |
|
BLAKE2b-256 | 3729f95e533c126a011bac8464ab9d1e09f8ee0968e0bce6acf952d3e7450b73 |