kopia lustrzana https://github.com/deathbeds/ipydrawio
Clean up root folder (#27)
rodzic
cae1fe8257
commit
7a31ede4fb
|
@ -2,12 +2,21 @@
|
|||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
LAB_EXT = ["jupyter", "labextension"]
|
||||
doit = lambda *args: subprocess.call(["doit", *args])
|
||||
|
||||
subprocess.call([*LAB_EXT, "uninstall", "--no-build", "jupyter-offlinenotebook"])
|
||||
doit("list", "--all", "--status")
|
||||
doit("-n4")
|
||||
doit("list", "--all", "--status")
|
||||
|
||||
subprocess.call(["doit", "list", "--all", "--status"])
|
||||
subprocess.call(["doit", "-n4"])
|
||||
subprocess.call(["doit", "list", "--all", "--status"])
|
||||
sys.exit(subprocess.call(["doit"]))
|
||||
SETTINGS = Path(sys.prefix) / "share/jupyter/lab/settings"
|
||||
SETTINGS.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
shutil.copy2(".binder/overrides.json", SETTINGS / "overrides.json")
|
||||
shutil.copy2(
|
||||
".binder/jupyter_notebook_config.json",
|
||||
"jupyter_notebook_config.json"
|
||||
)
|
||||
|
||||
sys.exit(doit())
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
.yarn-packages
|
||||
**/drawio/**
|
||||
**/labextensions/
|
||||
docs/
|
||||
node_modules/
|
||||
packages/ipydrawio-pdf/lib/
|
||||
packages/ipydrawio-webpack/drawio/
|
||||
packages/ipydrawio/lib/
|
||||
py_packages/
|
|
@ -140,7 +140,7 @@ jobs:
|
|||
with:
|
||||
path: ~/conda_pkgs_dir
|
||||
key: |
|
||||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('environment.yml') }}
|
||||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('.github/environment.yml') }}
|
||||
restore-keys: |
|
||||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-${{ matrix.python-version }}-
|
||||
|
||||
|
@ -151,7 +151,7 @@ jobs:
|
|||
miniforge-variant: Mambaforge
|
||||
miniforge-version: latest
|
||||
python-version: ${{ matrix.python-version }}
|
||||
environment-file: environment.yml
|
||||
environment-file: .github/environment.yml
|
||||
use-only-tar-bz2: true
|
||||
use-mamba: true
|
||||
|
||||
|
|
|
@ -19,5 +19,7 @@ dist/
|
|||
envs/
|
||||
htmlcov/
|
||||
node_modules/
|
||||
py_packages/ipydrawio-export/ipydrawio-export-*
|
||||
py_packages/ipydrawio/ipydrawio-*
|
||||
untitled*
|
||||
Untitled*
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[settings]
|
||||
multi_line_output=3
|
||||
include_trailing_comma=True
|
||||
force_grid_wrap=0
|
||||
use_parentheses=True
|
||||
line_length=88
|
|
@ -20,10 +20,12 @@
|
|||
- Get [Miniforge/Mambaforge](https://github.com/conda-forge/miniforge/releases)
|
||||
|
||||
```bash
|
||||
mamba env update --file environment.yml
|
||||
mamba env update --file .github/environment.yml
|
||||
source activate ipydrawio
|
||||
```
|
||||
|
||||
> or use the demo environment in `.binder`
|
||||
|
||||
## Get to a working Lab
|
||||
|
||||
```bash
|
||||
|
@ -56,3 +58,24 @@ doit dist
|
|||
```
|
||||
|
||||
- validate everything looks good!
|
||||
|
||||
## Releasing
|
||||
|
||||
- [ ] start a release issue with a checklist (maybe like this one)
|
||||
- [ ] ensure the versions have been bumped (check with `doit test:integrity`)
|
||||
- [ ] validate on binder
|
||||
- [ ] wait for a successful build of `master`
|
||||
- [ ] download the `dist` archive and unpack somewhere (maybe a fresh `dist`)
|
||||
- [ ] actually upload
|
||||
```bash
|
||||
export VERSION=<the next version>
|
||||
cd dist
|
||||
twine upload ipydrawio*
|
||||
npm login
|
||||
npm publish deathbeds-ipydrawio-$VERSION.tgz
|
||||
npm publish deathbeds-ipydrawio-notebook-$VERSION.tgz
|
||||
npm publish deathbeds-ipydrawio-pdf-$VERSION.tgz
|
||||
npm publish deathbeds-ipydrawio-webpack-$VERSION.tgz
|
||||
npm logout
|
||||
```
|
||||
- [ ] handle `conda-forge` feedstock tasks
|
||||
|
|
114
README.md
114
README.md
|
@ -1,41 +1,19 @@
|
|||
# IPyDrawio
|
||||
|
||||
[![binder-badge][]][binder] [![install from pypi][pypi-badge]][pypi]
|
||||
[![reuse from npm][npm-badge]][npm] [![build][workflow-badge]][workflow]
|
||||
[![coverage][cov-badge]][cov]
|
||||
|
||||
> [Drawio][] diagrams for [JupyterLab][]. Forked with ❤️ from
|
||||
> [QuantStack/jupyterlab-drawio][].
|
||||
|
||||
---
|
||||
|
||||
**[Install](#installation)** · **[History]** · **[Roadmap]**
|
||||
· **[Contribute](./CONTRIBUTING.md)** ·
|
||||
**[Open Source](#open-source)**
|
||||
|
||||
[![install from pypi][pypi-badge]][pypi] [![reuse from npm][npm-badge]][npm]
|
||||
[![build][workflow-badge]][workflow] [![coverage][cov-badge]][cov]
|
||||
|
||||
---
|
||||
· **[Contribute][contributing]** · **[Open Source](#open-source)**
|
||||
|
||||
> > This is BETA software. Native drawio files created with these tools _should_
|
||||
> > work with any other [drawio][] client, but any UI/API is liable to change at
|
||||
> > any time.
|
||||
|
||||
[history]: https://github.com/deathbeds/ipydrawio/blob/master/CHANGELOG.md
|
||||
[binder]:
|
||||
http://mybinder.org/v2/gh/deathbeds/ipydrawio/master?urlpath=lab/tree/docs/Poster.dio.svg
|
||||
[binder-badge]: https://mybinder.org/badge_logo.svg
|
||||
[workflow-badge]:
|
||||
https://github.com/deathbeds/ipydrawio/workflows/.github/workflows/ci.yml/badge.svg
|
||||
[workflow]:
|
||||
https://github.com/deathbeds/ipydrawio/actions?query=branch%3Amaster+workflow%3A.github%2Fworkflows%2Fci.yml
|
||||
[roadmap]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/ROADMAP.dio.ipynb
|
||||
[npm]: https://npmjs.com/package/@deathbeds/ipydrawio
|
||||
[pypi-badge]: https://img.shields.io/pypi/v/ipydrawio
|
||||
[pypi]: https://pypi.org/project/ipydrawio/
|
||||
[npm-badge]: https://img.shields.io/npm/v/@deathbeds/ipydrawio
|
||||
[cov-badge]:
|
||||
https://codecov.io/gh/deathbeds/ipydrawio/branch/master/graph/badge.svg?token=9B74VKHQDK
|
||||
[cov]: https://codecov.io/gh/deathbeds/ipydrawio
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
|
@ -56,28 +34,15 @@ pip install ipydrawio ipydrawio-export
|
|||
- `ipydrawio-export`
|
||||
- Export print-quality PDF from diagrams
|
||||
- > _BEWARE: some **heavy**, maybe fragile dependencies_
|
||||
- include editable Drawio metadata
|
||||
|
||||
[documents]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Document.ipynb
|
||||
[rich display]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Rich%20Display.ipynb
|
||||
[widgets]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Widgets.ipynb
|
||||
- optionally include editable Drawio XML as a PDF attachment
|
||||
|
||||
## Examples
|
||||
|
||||
| Note | Screenshot/Example |
|
||||
| --------------------------------------------------------------------------: | :----------------------------------------------- |
|
||||
| A Binder **demo** with a full [contributing](./CONTRIBUTING.md) environment | [![binder-badge][]][binder] |
|
||||
| Screenshot of drawio "minimal" UI with export options | [![poster-min]][poster-min] |
|
||||
| The beginning of an interactive computational **poster** | [![poster][]][poster] |
|
||||
| A mixed computational/creative **roadmap** for this project | [~~Screenshot Needed~](./docs/ROADMAP.dio.ipynb) |
|
||||
|
||||
[poster-min]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/_static/images/poster.png
|
||||
[poster]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/Poster.dio.svg
|
||||
| Note | Screenshot/Example |
|
||||
| ----------------------------------------------------------: | :------------------------------- |
|
||||
| Screenshot of drawio "minimal" UI with export options | [![poster-min]][poster-min] |
|
||||
| The beginning of an interactive computational **poster** | [![poster][]][poster] |
|
||||
| A mixed computational/creative **roadmap** for this project | [~~Screenshot Needed~~][roadmap] |
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -93,13 +58,7 @@ pip install ipydrawio ipydrawio-export
|
|||
- > **NOTE**: some of the built-in UI features of drawio don't work properly
|
||||
> inside an IFrame in JupyterLab, and are difficult to robustly disable:
|
||||
> please see _Diagram_ options available in the _Command Palette_ and
|
||||
> various _Main Menu_ manus.
|
||||
|
||||
[command palette]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/commands.html?highlight=command%20palette
|
||||
[launcher]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/files.html?highlight=Launcher#creating-files-and-activities
|
||||
[file manager]: https://jupyterlab.readthedocs.io/en/stable/user/files.html
|
||||
> various _Main Menu_ menus.
|
||||
|
||||
### PDF: Lab and Server extensions
|
||||
|
||||
|
@ -109,17 +68,13 @@ headless browser, powered by [@jgraph/draw-image-export2] and ultimately
|
|||
|
||||
- **native dependencies** as required to appease `puppeteer`
|
||||
- if running in `docker`, this can be a bit trial-and-error
|
||||
- for more, see the [binder][apt-txt] and ~~CI~~.
|
||||
- for more, see the [binder][apt-txt] and CI.
|
||||
- `nodejs>10,<14` from `conda` or your system package manager
|
||||
- **NOTE**: this relies on being able to install `puppeteer` (and other
|
||||
**arbitrary dependencies** with `jlpm` for now **when first used**
|
||||
- _we'll figure out a better approach soon enough_
|
||||
- `pip install ipydrawio-export`
|
||||
|
||||
[puppeteer]: https://github.com/puppeteer/puppeteer
|
||||
[@jgraph/draw-image-export2]: https://github.com/jgraph/draw-image-export2
|
||||
[apt-txt]: https://github.com/deathbeds/ipydrawio/blob/master/binder/apt.txt
|
||||
|
||||
> For example:
|
||||
>
|
||||
> ```bash
|
||||
|
@ -134,8 +89,6 @@ headless browser, powered by [@jgraph/draw-image-export2] and ultimately
|
|||
All files herein, unless otherwise noted, are free software licensed under
|
||||
[Apache 2.0].
|
||||
|
||||
[apache 2.0]: https://github.com/deathbeds/ipydrawio/blob/master/LICENSE.txt
|
||||
|
||||
### Copyright
|
||||
|
||||
The copyright holders of this extension are the [contributors][] to this
|
||||
|
@ -152,10 +105,49 @@ The original source code vendored in this package from:
|
|||
- [@jgraph/drawio][]
|
||||
- [@jgraph/draw-image-export2][]
|
||||
|
||||
[apache 2.0]: https://github.com/deathbeds/ipydrawio/blob/master/LICENSE.txt
|
||||
[@jgraph/drawio]: https://github.com/jgraph/drawio
|
||||
[@jgraph/draw-image-export2]: https://github.com/jgraph/draw-image-export2
|
||||
[contributing.md]: ./CONTRIBUTING.md
|
||||
[jupyterlab]: https://github.com/jupyterlab/jupyterlab
|
||||
[drawio]: https://www.diagrams.net
|
||||
[quantstack/jupyterlab-drawio]: https://github.com/QuantStack/jupyterlab-drawio
|
||||
[contributors]: https://github.com/deathbeds/ipydrawio/graphs/contributors
|
||||
[history]: https://github.com/deathbeds/ipydrawio/blob/master/CHANGELOG.md
|
||||
[binder]:
|
||||
http://mybinder.org/v2/gh/deathbeds/ipydrawio/master?urlpath=lab/tree/docs/Poster.dio.svg
|
||||
[binder-badge]: https://mybinder.org/badge_logo.svg
|
||||
[workflow-badge]:
|
||||
https://github.com/deathbeds/ipydrawio/workflows/.github/workflows/ci.yml/badge.svg
|
||||
[workflow]:
|
||||
https://github.com/deathbeds/ipydrawio/actions?query=branch%3Amaster+workflow%3A.github%2Fworkflows%2Fci.yml
|
||||
[roadmap]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/ROADMAP.dio.ipynb
|
||||
[npm]: https://npmjs.com/package/@deathbeds/ipydrawio
|
||||
[pypi-badge]: https://img.shields.io/pypi/v/ipydrawio
|
||||
[pypi]: https://pypi.org/project/ipydrawio/
|
||||
[npm-badge]: https://img.shields.io/npm/v/@deathbeds/ipydrawio
|
||||
[cov-badge]:
|
||||
https://codecov.io/gh/deathbeds/ipydrawio/branch/master/graph/badge.svg?token=9B74VKHQDK
|
||||
[cov]: https://codecov.io/gh/deathbeds/ipydrawio
|
||||
[contributing]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/CONTRIBUTING.md
|
||||
[documents]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Document.ipynb
|
||||
[rich display]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Rich%20Display.ipynb
|
||||
[widgets]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Widgets.ipynb
|
||||
[puppeteer]: https://github.com/puppeteer/puppeteer
|
||||
[@jgraph/draw-image-export2]: https://github.com/jgraph/draw-image-export2
|
||||
[apt-txt]: https://github.com/deathbeds/ipydrawio/blob/master/.binder/apt.txt
|
||||
[poster-min]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/_static/images/poster.png
|
||||
[poster]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/Poster.dio.svg
|
||||
[roadmap]:
|
||||
https://nbviewer.jupyter.org/github/deathbeds/ipydrawio/blob/master/docs/ROADMAP.dio.ipynb
|
||||
[command palette]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/commands.html?highlight=command%20palette
|
||||
[launcher]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/files.html?highlight=Launcher#creating-files-and-activities
|
||||
[file manager]: https://jupyterlab.readthedocs.io/en/stable/user/files.html
|
||||
|
|
13
RELEASE.md
13
RELEASE.md
|
@ -1,13 +0,0 @@
|
|||
# Releasing
|
||||
|
||||
```bash
|
||||
git clean -dxf
|
||||
jlpm cache clean
|
||||
conda clean -yaf
|
||||
doit all
|
||||
# nothing but submodule cruft
|
||||
python -m scripts.tag
|
||||
python -m scripts.upload
|
||||
FOR_REAL=1 python -m scripts.tag
|
||||
FOR_REAL=1 python -m scripts.upload
|
||||
```
|
12
dodo.py
12
dodo.py
|
@ -198,7 +198,7 @@ if not P.TESTING_IN_CI:
|
|||
yield _ok(
|
||||
dict(
|
||||
name="isort",
|
||||
file_dep=[*P.ALL_PY],
|
||||
file_dep=[*P.ALL_PY, P.SETUP_CFG],
|
||||
actions=[["isort", *P.ALL_PY]],
|
||||
),
|
||||
P.OK_ISORT,
|
||||
|
@ -214,7 +214,7 @@ if not P.TESTING_IN_CI:
|
|||
yield _ok(
|
||||
dict(
|
||||
name="flake8",
|
||||
file_dep=[*P.ALL_PY, P.OK_BLACK],
|
||||
file_dep=[*P.ALL_PY, P.OK_BLACK, P.SETUP_CFG],
|
||||
actions=[["flake8", *P.ALL_PY]],
|
||||
),
|
||||
P.OK_FLAKE8,
|
||||
|
@ -240,7 +240,13 @@ if not P.TESTING_IN_CI:
|
|||
yield _ok(
|
||||
dict(
|
||||
name="eslint",
|
||||
file_dep=[P.YARN_INTEGRITY, *P.ALL_TS, P.OK_PRETTIER, P.ESLINTRC],
|
||||
file_dep=[
|
||||
P.YARN_INTEGRITY,
|
||||
*P.ALL_TS,
|
||||
P.OK_PRETTIER,
|
||||
P.ESLINTRC,
|
||||
P.TSCONFIGBASE,
|
||||
],
|
||||
actions=[["jlpm", "eslint"]],
|
||||
),
|
||||
P.OK_ESLINT,
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"bootstrap": "jlpm --prefer-offline && lerna bootstrap",
|
||||
"eslint": "eslint --ext .js,.ts,.tsx --fix packages",
|
||||
"eslint:check": "eslint --ext .js,.ts,.tsx packages"
|
||||
"eslint": "cd packages && eslint --ext .js,.ts,.tsx --fix .",
|
||||
"eslint:check": "cd packages && eslint --ext .js,.ts,.tsx ."
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
.eslintrc.js
|
||||
_meta/lib/**
|
||||
ipydrawio-notebook/lib/**
|
||||
ipydrawio-pdf/lib/**
|
||||
ipydrawio-webpack/drawio/**
|
||||
ipydrawio/lib/**
|
||||
**/node_modules/**
|
||||
**/drawio/**
|
||||
**/lib/**
|
|
@ -3,7 +3,7 @@ module.exports = {
|
|||
browser: true,
|
||||
es6: true,
|
||||
commonjs: true,
|
||||
node: true
|
||||
node: true,
|
||||
},
|
||||
root: true,
|
||||
extends: [
|
||||
|
@ -11,11 +11,11 @@ module.exports = {
|
|||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:react/recommended'
|
||||
'plugin:react/recommended',
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: 'packages/tsconfigbase.json'
|
||||
project: 'tsconfig.eslint.json',
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
rules: {
|
||||
|
@ -27,9 +27,9 @@ module.exports = {
|
|||
format: ['PascalCase'],
|
||||
custom: {
|
||||
regex: '^I[A-Z]',
|
||||
match: true
|
||||
}
|
||||
}
|
||||
match: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
|
@ -58,7 +58,7 @@ module.exports = {
|
|||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect'
|
||||
}
|
||||
}
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "./tsconfigbase",
|
||||
"include": [
|
||||
"**/*"
|
||||
]
|
||||
}
|
|
@ -1,25 +1,11 @@
|
|||
# IPyDrawio Export
|
||||
|
||||
[![binder-badge][]][binder] [![install from pypi][pypi-badge]][pypi]
|
||||
[![build][workflow-badge]][workflow] [![coverage][cov-badge]][cov]
|
||||
|
||||
> PDF export of [drawio](https://www.diagrams.net) diagrams for JupyterLab.
|
||||
|
||||
---
|
||||
|
||||
[![install from pypi][pypi-badge]][pypi] [![build][workflow-badge]][workflow]
|
||||
[![coverage][cov-badge]][cov]
|
||||
|
||||
[pypi-badge]: https://img.shields.io/pypi/v/ipydrawio-export
|
||||
[pypi]: https://pypi.org/project/ipydrawio-export
|
||||
[workflow-badge]:
|
||||
https://github.com/deathbeds/ipydrawio/workflows/.github/workflows/ci.yml/badge.svg
|
||||
[workflow]:
|
||||
https://github.com/deathbeds/ipydrawio/actions?query=branch%3Amaster+workflow%3A.github%2Fworkflows%2Fci.yml
|
||||
[cov-badge]:
|
||||
https://codecov.io/gh/deathbeds/ipydrawio/branch/master/graph/badge.svg?token=9B74VKHQDK
|
||||
[cov]: https://codecov.io/gh/deathbeds/ipydrawio
|
||||
|
||||
---
|
||||
|
||||
See the [project repo](https://github.com/deathbeds/ipydrawio) for more
|
||||
See the [main project repo](https://github.com/deathbeds/ipydrawio) for more
|
||||
information.
|
||||
|
||||
## Installation
|
||||
|
@ -104,3 +90,15 @@ The vendored code from [@jgraph/draw-image-export2][] is also licensed under the
|
|||
https://github.com/jgraph/draw-image-export2/blob/master/LICENSE
|
||||
[serverext]:
|
||||
https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Distributing%20Jupyter%20Extensions%20as%20Python%20Packages.html
|
||||
[binder]:
|
||||
http://mybinder.org/v2/gh/deathbeds/ipydrawio/master?urlpath=lab/tree/docs/Poster.dio.svg
|
||||
[binder-badge]: https://mybinder.org/badge_logo.svg
|
||||
[pypi-badge]: https://img.shields.io/pypi/v/ipydrawio-export
|
||||
[pypi]: https://pypi.org/project/ipydrawio-export
|
||||
[workflow-badge]:
|
||||
https://github.com/deathbeds/ipydrawio/workflows/.github/workflows/ci.yml/badge.svg
|
||||
[workflow]:
|
||||
https://github.com/deathbeds/ipydrawio/actions?query=branch%3Amaster+workflow%3A.github%2Fworkflows%2Fci.yml
|
||||
[cov-badge]:
|
||||
https://codecov.io/gh/deathbeds/ipydrawio/branch/master/graph/badge.svg?token=9B74VKHQDK
|
||||
[cov]: https://codecov.io/gh/deathbeds/ipydrawio
|
||||
|
|
|
@ -1,41 +1,19 @@
|
|||
# IPyDrawio
|
||||
|
||||
[![binder-badge][]][binder] [![install from pypi][pypi-badge]][pypi]
|
||||
[![reuse from npm][npm-badge]][npm] [![build][workflow-badge]][workflow]
|
||||
[![coverage][cov-badge]][cov]
|
||||
|
||||
> [Drawio][] diagrams for [JupyterLab][]. Forked with ❤️ from
|
||||
> [QuantStack/jupyterlab-drawio][].
|
||||
|
||||
---
|
||||
|
||||
**[Install](#installation)** · **[History]** · **[Roadmap]**
|
||||
· **[Contribute](./CONTRIBUTING.md)** ·
|
||||
**[Open Source](#open-source)**
|
||||
|
||||
[![install from pypi][pypi-badge]][pypi] [![reuse from npm][npm-badge]][npm]
|
||||
[![build][workflow-badge]][workflow] [![coverage][cov-badge]][cov]
|
||||
|
||||
---
|
||||
· **[Contribute][contributing]** · **[Open Source](#open-source)**
|
||||
|
||||
> > This is BETA software. Native drawio files created with these tools _should_
|
||||
> > work with any other [drawio][] client, but any UI/API is liable to change at
|
||||
> > any time.
|
||||
|
||||
[history]: https://github.com/deathbeds/ipydrawio/blob/master/CHANGELOG.md
|
||||
[binder]:
|
||||
http://mybinder.org/v2/gh/deathbeds/ipydrawio/master?urlpath=lab/tree/docs/Poster.dio.svg
|
||||
[binder-badge]: https://mybinder.org/badge_logo.svg
|
||||
[workflow-badge]:
|
||||
https://github.com/deathbeds/ipydrawio/workflows/.github/workflows/ci.yml/badge.svg
|
||||
[workflow]:
|
||||
https://github.com/deathbeds/ipydrawio/actions?query=branch%3Amaster+workflow%3A.github%2Fworkflows%2Fci.yml
|
||||
[roadmap]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/ROADMAP.dio.ipynb
|
||||
[npm]: https://npmjs.com/package/@deathbeds/ipydrawio
|
||||
[pypi-badge]: https://img.shields.io/pypi/v/ipydrawio
|
||||
[pypi]: https://pypi.org/project/ipydrawio/
|
||||
[npm-badge]: https://img.shields.io/npm/v/@deathbeds/ipydrawio
|
||||
[cov-badge]:
|
||||
https://codecov.io/gh/deathbeds/ipydrawio/branch/master/graph/badge.svg?token=9B74VKHQDK
|
||||
[cov]: https://codecov.io/gh/deathbeds/ipydrawio
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
|
@ -56,28 +34,15 @@ pip install ipydrawio ipydrawio-export
|
|||
- `ipydrawio-export`
|
||||
- Export print-quality PDF from diagrams
|
||||
- > _BEWARE: some **heavy**, maybe fragile dependencies_
|
||||
- include editable Drawio metadata
|
||||
|
||||
[documents]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Document.ipynb
|
||||
[rich display]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Rich%20Display.ipynb
|
||||
[widgets]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Widgets.ipynb
|
||||
- optionally include editable Drawio XML as a PDF attachment
|
||||
|
||||
## Examples
|
||||
|
||||
| Note | Screenshot/Example |
|
||||
| --------------------------------------------------------------------------: | :----------------------------------------------- |
|
||||
| A Binder **demo** with a full [contributing](./CONTRIBUTING.md) environment | [![binder-badge][]][binder] |
|
||||
| Screenshot of drawio "minimal" UI with export options | [![poster-min]][poster-min] |
|
||||
| The beginning of an interactive computational **poster** | [![poster][]][poster] |
|
||||
| A mixed computational/creative **roadmap** for this project | [~~Screenshot Needed~](./docs/ROADMAP.dio.ipynb) |
|
||||
|
||||
[poster-min]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/_static/images/poster.png
|
||||
[poster]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/Poster.dio.svg
|
||||
| Note | Screenshot/Example |
|
||||
| ----------------------------------------------------------: | :------------------------------- |
|
||||
| Screenshot of drawio "minimal" UI with export options | [![poster-min]][poster-min] |
|
||||
| The beginning of an interactive computational **poster** | [![poster][]][poster] |
|
||||
| A mixed computational/creative **roadmap** for this project | [~~Screenshot Needed~~][roadmap] |
|
||||
|
||||
## Usage
|
||||
|
||||
|
@ -93,13 +58,7 @@ pip install ipydrawio ipydrawio-export
|
|||
- > **NOTE**: some of the built-in UI features of drawio don't work properly
|
||||
> inside an IFrame in JupyterLab, and are difficult to robustly disable:
|
||||
> please see _Diagram_ options available in the _Command Palette_ and
|
||||
> various _Main Menu_ manus.
|
||||
|
||||
[command palette]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/commands.html?highlight=command%20palette
|
||||
[launcher]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/files.html?highlight=Launcher#creating-files-and-activities
|
||||
[file manager]: https://jupyterlab.readthedocs.io/en/stable/user/files.html
|
||||
> various _Main Menu_ menus.
|
||||
|
||||
### PDF: Lab and Server extensions
|
||||
|
||||
|
@ -109,17 +68,13 @@ headless browser, powered by [@jgraph/draw-image-export2] and ultimately
|
|||
|
||||
- **native dependencies** as required to appease `puppeteer`
|
||||
- if running in `docker`, this can be a bit trial-and-error
|
||||
- for more, see the [binder][apt-txt] and ~~CI~~.
|
||||
- for more, see the [binder][apt-txt] and CI.
|
||||
- `nodejs>10,<14` from `conda` or your system package manager
|
||||
- **NOTE**: this relies on being able to install `puppeteer` (and other
|
||||
**arbitrary dependencies** with `jlpm` for now **when first used**
|
||||
- _we'll figure out a better approach soon enough_
|
||||
- `pip install ipydrawio-export`
|
||||
|
||||
[puppeteer]: https://github.com/puppeteer/puppeteer
|
||||
[@jgraph/draw-image-export2]: https://github.com/jgraph/draw-image-export2
|
||||
[apt-txt]: https://github.com/deathbeds/ipydrawio/blob/master/binder/apt.txt
|
||||
|
||||
> For example:
|
||||
>
|
||||
> ```bash
|
||||
|
@ -134,8 +89,6 @@ headless browser, powered by [@jgraph/draw-image-export2] and ultimately
|
|||
All files herein, unless otherwise noted, are free software licensed under
|
||||
[Apache 2.0].
|
||||
|
||||
[apache 2.0]: https://github.com/deathbeds/ipydrawio/blob/master/LICENSE.txt
|
||||
|
||||
### Copyright
|
||||
|
||||
The copyright holders of this extension are the [contributors][] to this
|
||||
|
@ -152,10 +105,49 @@ The original source code vendored in this package from:
|
|||
- [@jgraph/drawio][]
|
||||
- [@jgraph/draw-image-export2][]
|
||||
|
||||
[apache 2.0]: https://github.com/deathbeds/ipydrawio/blob/master/LICENSE.txt
|
||||
[@jgraph/drawio]: https://github.com/jgraph/drawio
|
||||
[@jgraph/draw-image-export2]: https://github.com/jgraph/draw-image-export2
|
||||
[contributing.md]: ./CONTRIBUTING.md
|
||||
[jupyterlab]: https://github.com/jupyterlab/jupyterlab
|
||||
[drawio]: https://www.diagrams.net
|
||||
[quantstack/jupyterlab-drawio]: https://github.com/QuantStack/jupyterlab-drawio
|
||||
[contributors]: https://github.com/deathbeds/ipydrawio/graphs/contributors
|
||||
[history]: https://github.com/deathbeds/ipydrawio/blob/master/CHANGELOG.md
|
||||
[binder]:
|
||||
http://mybinder.org/v2/gh/deathbeds/ipydrawio/master?urlpath=lab/tree/docs/Poster.dio.svg
|
||||
[binder-badge]: https://mybinder.org/badge_logo.svg
|
||||
[workflow-badge]:
|
||||
https://github.com/deathbeds/ipydrawio/workflows/.github/workflows/ci.yml/badge.svg
|
||||
[workflow]:
|
||||
https://github.com/deathbeds/ipydrawio/actions?query=branch%3Amaster+workflow%3A.github%2Fworkflows%2Fci.yml
|
||||
[roadmap]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/ROADMAP.dio.ipynb
|
||||
[npm]: https://npmjs.com/package/@deathbeds/ipydrawio
|
||||
[pypi-badge]: https://img.shields.io/pypi/v/ipydrawio
|
||||
[pypi]: https://pypi.org/project/ipydrawio/
|
||||
[npm-badge]: https://img.shields.io/npm/v/@deathbeds/ipydrawio
|
||||
[cov-badge]:
|
||||
https://codecov.io/gh/deathbeds/ipydrawio/branch/master/graph/badge.svg?token=9B74VKHQDK
|
||||
[cov]: https://codecov.io/gh/deathbeds/ipydrawio
|
||||
[contributing]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/CONTRIBUTING.md
|
||||
[documents]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Document.ipynb
|
||||
[rich display]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Rich%20Display.ipynb
|
||||
[widgets]:
|
||||
https://github.com/deathbeds/ipydrawio/blob/master/docs/Diagram%20Widgets.ipynb
|
||||
[puppeteer]: https://github.com/puppeteer/puppeteer
|
||||
[@jgraph/draw-image-export2]: https://github.com/jgraph/draw-image-export2
|
||||
[apt-txt]: https://github.com/deathbeds/ipydrawio/blob/master/.binder/apt.txt
|
||||
[poster-min]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/_static/images/poster.png
|
||||
[poster]:
|
||||
https://raw.githubusercontent.com/deathbeds/ipydrawio/master/docs/Poster.dio.svg
|
||||
[roadmap]:
|
||||
https://nbviewer.jupyter.org/github/deathbeds/ipydrawio/blob/master/docs/ROADMAP.dio.ipynb
|
||||
[command palette]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/commands.html?highlight=command%20palette
|
||||
[launcher]:
|
||||
https://jupyterlab.readthedocs.io/en/stable/user/files.html?highlight=Launcher#creating-files-and-activities
|
||||
[file manager]: https://jupyterlab.readthedocs.io/en/stable/user/files.html
|
||||
|
|
|
@ -30,22 +30,25 @@ ATEST_PROCS = int(os.environ.get("ATEST_PROCS", "4"))
|
|||
# find root
|
||||
SCRIPTS = Path(__file__).parent.resolve()
|
||||
ROOT = SCRIPTS.parent
|
||||
BINDER = ROOT / ".binder"
|
||||
PY_MAJOR = "".join(map(str, sys.version_info[:2]))
|
||||
|
||||
# demo
|
||||
BINDER = ROOT / ".binder"
|
||||
OVERRIDES = BINDER / "overrides.json"
|
||||
|
||||
# top-level stuff
|
||||
NODE_MODULES = ROOT / "node_modules"
|
||||
PACKAGE = ROOT / "package.json"
|
||||
PACKAGES = ROOT / "packages"
|
||||
YARN_INTEGRITY = NODE_MODULES / ".yarn-integrity"
|
||||
YARN_LOCK = ROOT / "yarn.lock"
|
||||
OVERRIDES = ROOT / "overrides.json"
|
||||
CI = ROOT / ".github"
|
||||
DODO = ROOT / "dodo.py"
|
||||
BUILD = ROOT / "build"
|
||||
DIST = ROOT / "dist"
|
||||
README = ROOT / "README.md"
|
||||
CHANGELOG = ROOT / "CHANGELOG.md"
|
||||
SETUP_CFG = ROOT / "setup.cfg"
|
||||
|
||||
# tools
|
||||
PY = ["python"]
|
||||
|
@ -78,6 +81,7 @@ ATEST_OUT_XML = "output.xml"
|
|||
# js packages
|
||||
JS_NS = "deathbeds"
|
||||
IPYDIO = PACKAGES / "ipydrawio"
|
||||
TSCONFIGBASE = PACKAGES / "tsconfigbase.json"
|
||||
|
||||
# so many js packages
|
||||
JS_PKG_JSON = {p.parent.name: p for p in PACKAGES.glob("*/package.json")}
|
||||
|
@ -189,6 +193,7 @@ ALL_PY = [
|
|||
*SCRIPTS.glob("*.py"),
|
||||
*sum(JS_PY_SCRIPTS.values(), []),
|
||||
*sum(PY_SRC.values(), []),
|
||||
*BINDER.glob("*.py"),
|
||||
DODO,
|
||||
]
|
||||
ALL_YML = [*ROOT.glob("*.yml"), *CI.rglob("*.yml"), *BINDER.glob("*.yml")]
|
||||
|
@ -197,17 +202,19 @@ ALL_JSON = [
|
|||
*PACKAGES.glob("*/*.json"),
|
||||
*PACKAGES.glob("*/schema/*.json"),
|
||||
*ATEST.glob("fixtures/*.json"),
|
||||
*BINDER.glob("*.json"),
|
||||
]
|
||||
ALL_MD = [
|
||||
*ROOT.glob("*.md"),
|
||||
*PACKAGES.glob("*/*.md"),
|
||||
*NOT_LABEXTENSIONS(PY_PACKAGES.glob("*/*.md")),
|
||||
]
|
||||
ALL_JS = [PACKAGES / ".eslintrc.js"]
|
||||
ALL_TS = sum(JS_TSSRC.values(), [])
|
||||
ALL_CSS = sum(JS_STYLE.values(), [])
|
||||
ALL_ROBOT = [*ATEST.rglob("*.robot")]
|
||||
ALL_PRETTIER = [*ALL_YML, *ALL_JSON, *ALL_MD, *ALL_TS, *ALL_CSS]
|
||||
ESLINTRC = ROOT / ".eslintrc.js"
|
||||
ALL_PRETTIER = [*ALL_YML, *ALL_JSON, *ALL_MD, *ALL_TS, *ALL_CSS, *ALL_JS]
|
||||
ESLINTRC = PACKAGES / ".eslintrc.js"
|
||||
|
||||
RFLINT_OPTS = sum(
|
||||
[
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
""" create release tags
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
from subprocess import check_call
|
||||
|
||||
from . import project as P
|
||||
|
||||
FOR_REAL = json.loads(os.environ.get("FOR_REAL", "0"))
|
||||
|
||||
|
||||
def tag():
|
||||
"""upload releases"""
|
||||
if not FOR_REAL:
|
||||
print("Not uploading FOR_REAL: set the environment variable for a real release")
|
||||
|
||||
for pkg, version in P.PY_VERSION.items():
|
||||
args = ["git", "tag", f"release/{pkg}/{version}"]
|
||||
print(">>>", " ".join(args), flush=True)
|
||||
if FOR_REAL:
|
||||
check_call(args)
|
||||
|
||||
for pkg, data in P.JS_PKG_DATA.items():
|
||||
if pkg.startswith("_"):
|
||||
continue
|
||||
args = ["git", "tag", f"""release/{pkg}/{data["version"]}"""]
|
||||
print(">>>", " ".join(args), flush=True)
|
||||
if FOR_REAL:
|
||||
check_call(args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
tag()
|
|
@ -1,33 +0,0 @@
|
|||
""" release on pypi and npm
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
from subprocess import check_call
|
||||
|
||||
from . import project as P
|
||||
|
||||
FOR_REAL = json.loads(os.environ.get("FOR_REAL", "0"))
|
||||
|
||||
|
||||
def upload():
|
||||
"""upload releases"""
|
||||
if not FOR_REAL:
|
||||
print("Not uploading FOR_REAL: set the environment variable for a real release")
|
||||
|
||||
for pkg, sdist in P.PY_SDIST.items():
|
||||
args = ["twine", "upload", "dist/*"]
|
||||
cwd = str(sdist.parent.parent)
|
||||
print(">>>", " ".join(args), "\n in", cwd, flush=True)
|
||||
if FOR_REAL:
|
||||
check_call(args, cwd=cwd)
|
||||
|
||||
for pkg, tgz in P.JS_TARBALL.items():
|
||||
args = ["jlpm", "upload"]
|
||||
cwd = tgz.parent
|
||||
print(">>>", " ".join(args), "\n in", cwd, flush=True)
|
||||
if FOR_REAL:
|
||||
check_call(args, cwd=cwd)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
upload()
|
|
@ -1,3 +1,7 @@
|
|||
[flake8]
|
||||
max-line-length = 88
|
||||
ignore = E203, E501, W503
|
||||
|
||||
[isort]
|
||||
profile = black
|
||||
multi_line_output = 3
|
||||
|
|
Ładowanie…
Reference in New Issue