Skip to content

Commit 939e005

Browse files
author
Zerline
committed
Merge branch 'master' into borders3
2 parents 2fb38c0 + 54941b7 commit 939e005

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2354
-1714
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v1
11+
- uses: actions/checkout@v2
1212
- name: Use Node.js 10.x
1313
uses: actions/setup-node@v1
1414
with:

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
name: Documentation
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v1
10+
- uses: actions/checkout@v2
1111
- name: Set up Python
1212
uses: actions/setup-python@v1
1313
with:
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-latest
3434

3535
steps:
36-
- uses: actions/checkout@v1
36+
- uses: actions/checkout@v2
3737
- name: Use Node.js 10.x
3838
uses: actions/setup-node@v1
3939
with:
@@ -87,7 +87,7 @@ jobs:
8787
python-version: [3.5, 3.6, 3.7, 3.8]
8888

8989
steps:
90-
- uses: actions/checkout@v1
90+
- uses: actions/checkout@v2
9191
- name: Set up Python ${{ matrix.python-version }}
9292
uses: actions/setup-python@v1
9393
with:
@@ -110,7 +110,7 @@ jobs:
110110
name: Message Specification
111111
runs-on: ubuntu-latest
112112
steps:
113-
- uses: actions/checkout@v1
113+
- uses: actions/checkout@v2
114114
- name: Set up Python
115115
uses: actions/setup-python@v1
116116
with:

MANIFEST.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@ include LICENSE
22
include CONTRIBUTING.md
33
include README.md
44
include package.json
5-
include bower.json
6-
include .bowerrc
7-
include ipywidgets/build_css.js
85

96
# Documentation
107
graft docs
118
exclude docs/\#*
129

13-
# Examples
10+
# Tests
1411
graft ipywidgets/tests
12+
13+
# Static Assets
1514
graft ipywidgets/static
1615

17-
# docs subdirs we want to skip
16+
# Docs subdirs we want to skip
1817
prune docs/build
1918
prune docs/dist
2019

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# ipywidgets: Interactive HTML Widgets
22

33
[![Version](https://img.shields.io/pypi/v/ipywidgets.svg)](https://pypi.python.org/pypi/ipywidgets)
4-
[![Build Status](https://travis-ci.org/jupyter-widgets/ipywidgets.svg?branch=master)](https://travis-ci.org/jupyter-widgets/ipywidgets)
4+
![Build Status](https://img.shields.io/github/workflow/status/jupyter-widgets/ipywidgets/Test/master)
55
[![Documentation Status](http://readthedocs.org/projects/ipywidgets/badge/?version=stable)](https://ipywidgets.readthedocs.io/)
66
[![Join the chat at https://gitter.im/ipython/ipywidgets](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jupyter-widgets/Lobby)
77
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/jupyter-widgets/ipywidgets/master?filepath=docs%2Fsource%2Fexamples)
88

99
ipywidgets are [interactive HTML widgets](https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/examples/Index.ipynb)
10-
for Jupyter notebooks and the IPython kernel.
10+
for Jupyter notebooks, JupyterLab and the IPython kernel.
1111

1212
Notebooks come alive when interactive widgets are used. Users gain control of
1313
their data and can visualize changes in the data.
@@ -78,6 +78,13 @@ jupyter nbextension enable --py --sys-prefix widgetsnbextension # can be skippe
7878
conda install -c conda-forge ipywidgets
7979
```
8080

81+
- Add ipywidgets to JupyterLab after installing with pip or conda (note that this requires nodejs to be installed and that the package name is different):
82+
83+
84+
```
85+
jupyter labextension install @jupyter-widgets/jupyterlab-manager
86+
```
87+
8188
See the [Installation](docs/source/user_install.md) section of the documentation for additional details.
8289

8390
### Installing from git

docs/source/dev_docs.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,36 @@ Building the Documentation
44
To build the documentation you'll need [Sphinx](http://www.sphinx-doc.org/), [pandoc](http://pandoc.org/)
55
and a few other packages.
66

7-
To install (and activate) a [conda environment](http://conda.pydata.org/docs/using/envs.html#use-environment-from-file) named `notebook_docs`
8-
containing all the necessary packages (except pandoc), use:
7+
First create a [conda environment](http://conda.pydata.org/docs/using/envs.html#use-environment-from-file) named `ipywidgets_docs` to install all the necessary packages:
98

9+
```bash
10+
# create the environment
11+
conda create -n ipywidgets_docs -c conda-forge python pip
12+
13+
# activate the environment
14+
conda activate ipywidgets_docs # Linux and OS X
15+
activate ipywidgets_docs # Windows
1016
```
11-
conda env create -f docs/environment.yml
12-
source activate ipywidget_docs # Linux and OS X
13-
activate ipywidget_docs # Windows
14-
```
1517

16-
If you want to install the necessary packages with `pip` instead, use
17-
(omitting `--user` if working in a virtual environment):
18+
Alternatively, it is also possible to create a virtual environment and activate it with the following commands:
19+
20+
```bash
21+
# create the environment
22+
python -m venv .
1823

24+
# activate the environment
25+
source bin/activate
1926
```
20-
pip install -r docs/requirements.txt --user
27+
28+
In the environment, install the packages:
29+
30+
```bash
31+
python -m pip install -r docs/requirements.txt
2132
```
2233

2334
Once you have installed the required packages, you can build the docs with:
2435

25-
```
36+
```bash
2637
cd docs
2738
make clean
2839
make html
@@ -31,12 +42,6 @@ make html
3142
After that, the generated HTML files will be available at
3243
`build/html/index.html`. You may view the docs in your browser.
3344

34-
You can automatically check if all hyperlinks are still valid::
35-
36-
```
37-
make linkcheck
38-
```
39-
4045
Windows users can find `make.bat` in the `docs` folder.
4146

4247
You should also have a look at the [Project Jupyter Documentation Guide](https://jupyter.readthedocs.io/en/latest/contrib_docs/index.html).

docs/source/dev_release.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ First, update the relevant model specification versions. For example, the commit
2828

2929
Next, regenerate the model spec with the new version numbers by doing something like this in the repository root directory:
3030
```
31-
python ./packages/schema/generate-spec.py > packages/schema/jupyterwidgetmodels.latest.md
31+
python ./packages/schema/generate-spec.py -f json-pretty > packages/schema/jupyterwidgetmodels.latest.json
32+
python ./packages/schema/generate-spec.py -f markdown > packages/schema/jupyterwidgetmodels.latest.md
3233
```
3334

3435
Copy `packages/schema/jupyterwidgetmodels.latest.md` to an appropriately-named
@@ -47,17 +48,19 @@ git pull origin master
4748
git reset --hard origin/master
4849
git clean -fdx
4950
yarn install
51+
yarn run version
52+
# Check the latest commit to make sure it is correct
5053
yarn run publish
5154
```
5255

53-
Lerna will prompt you for version numbers for each of the changed npm packages. Lerna will then change the versions appropriately (including the interdependency versions), commit, tag, and publish the new packages to npm.
56+
Lerna will prompt you for version numbers for each of the changed npm packages in the version step. Lerna will then change the versions appropriately (including the interdependency versions), commit, and tag. The `yarn run publish` step then publishes the public packages that were versioned to npm.
5457

5558
### widgetsnbextension
5659

5760
Go into the `widgetsnbextension` directory. Change `widgetsnbextension/_version.py` to reflect the new version number.
5861
```
5962
python setup.py sdist
60-
python setup.py bdist_wheel --universal
63+
python setup.py bdist_wheel
6164
twine upload dist/*
6265
```
6366

@@ -72,7 +75,7 @@ Change `ipywidgets/_version.py` to reflect the new version number, and if necess
7275

7376
```
7477
python setup.py sdist
75-
python setup.py bdist_wheel --universal
78+
python setup.py bdist_wheel
7679
twine upload dist/*
7780
```
7881

docs/source/embedding.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This HTML snippet is composed of multiple `<script>` tags embedded into an HTML
5151

5252
- Then there are a number of script tags, each with mime type
5353
`application/vnd.jupyter.widget-view+json`, corresponding to the views which
54-
you want to display in the web page. These script tags must be in the body of
54+
you want to display on the web page. These script tags must be in the body of
5555
the page, and are replaced with the rendered widgets. The JSON schema for the
5656
content of these script tags is found in the `@jupyter-widgets/schema` npm
5757
package.
@@ -73,7 +73,7 @@ the `application/vnd.jupyter.widget-state+json` format specified in the
7373

7474
Embeddable code for the widgets can also be produced from Python. The
7575
`ipywidgets.embed` module provides several functions for embedding widgets
76-
into HTML documents programatically.
76+
into HTML documents programmatically.
7777

7878
Use `embed_minimal_html` to create a simple, stand-alone HTML page:
7979

@@ -124,6 +124,7 @@ html_template = """
124124
<!-- Load IPywidgets bundle for embedding. -->
125125
<script
126126
data-jupyter-widgets-cdn="https://cdn.jsdelivr.net/npm/"
127+
data-jupyter-widgets-cdn-only
127128
src="https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js"
128129
crossorigin="anonymous">
129130
</script>
@@ -181,6 +182,9 @@ documents, you may want to use a templating engine like
181182
We also change the CDN from its default of unpkg to use jsdelivr by setting the
182183
`data-jupyter-widgets-cdn` attribute.
183184

185+
What's more, we only load modules from the CDN by setting the
186+
`data-jupyter-widgets-cdn-only` attribute.
187+
184188
In all embedding functions in `ipywidgets.embed`, the state of all widgets
185189
known to the widget manager is included by default. You can alternatively
186190
pass a reduced state to use instead. This can be particularly relevant if you
@@ -270,6 +274,11 @@ While the default CDN is using https://unpkg.com it can be configured by
270274
setting the optional `data-jupyter-widgets-cdn` attribute for script tag which loads `embed-amd.js`,
271275
as shown in the example above.
272276

277+
While the default strategy is loading modules from the same site, and then
278+
falling back to CDN. This can be configured by setting the optional
279+
`data-jupyter-widgets-cdn-only` attribute for script tag which loads `embed-amd.js`
280+
as shown in the example above too.
281+
273282
The [widget-cookiecutter](https://github.com/jupyter/widget-cookiecutter)
274283
template project contains a template project for a custom widget library
275284
following the best practices for authoring widgets, which ensure that your

docs/source/examples/Layout Example.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,4 +316,4 @@
316316
},
317317
"nbformat": 4,
318318
"nbformat_minor": 2
319-
}
319+
}

docs/source/examples/Layout Templates.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Using Layout Templates\n",
88
"\n",
9-
"As we showed in [Layout and Styling of Jupyter widgets](Widget%20Styling.ipynb) multiple widgets can be aranged together using the flexible [GridBox](Widget%20Styling.ipynb#The-Grid-Layout) specification. However, use of the specification involves some understanding of CSS properties and may impose sharp learning curve. Here, we will describe layout templates built on top of `GridBox` that simplify creation of common widget layouts."
9+
"As we showed in [Layout and Styling of Jupyter widgets](Widget%20Styling.ipynb) multiple widgets can be arranged together using the flexible [GridBox](Widget%20Styling.ipynb#The-Grid-Layout) specification. However, use of the specification involves some understanding of CSS properties and may impose sharp learning curve. Here, we will describe layout templates built on top of `GridBox` that simplify creation of common widget layouts."
1010
]
1111
},
1212
{
@@ -43,7 +43,7 @@
4343
"cell_type": "markdown",
4444
"metadata": {},
4545
"source": [
46-
"You can easily create a layout with 4 widgets aranged on 2x2 matrix using the `TwoByTwoLayout` widget: "
46+
"You can easily create a layout with 4 widgets arranged on 2x2 matrix using the `TwoByTwoLayout` widget: "
4747
]
4848
},
4949
{
@@ -536,7 +536,7 @@
536536
"cell_type": "markdown",
537537
"metadata": {},
538538
"source": [
539-
"In this examples, we will demonstrate how to use `GridspecLayout` and `bqplot` widget to create a multipanel scatter plot. To run this example you will need to install the [bqplot](https://bqplot.readthedocs.io/en/latest/) package."
539+
"In these examples, we will demonstrate how to use `GridspecLayout` and `bqplot` widget to create a multipanel scatter plot. To run this example you will need to install the [bqplot](https://bqplot.readthedocs.io/en/latest/) package."
540540
]
541541
},
542542
{
@@ -715,4 +715,4 @@
715715
},
716716
"nbformat": 4,
717717
"nbformat_minor": 4
718-
}
718+
}

0 commit comments

Comments
 (0)