Skip to content

Commit c46e5dc

Browse files
authored
Merge pull request #3104 from willingc/doc-landing
Make doc structure more user friendly
2 parents 10172a2 + 319b5b9 commit c46e5dc

File tree

6 files changed

+103
-60
lines changed

6 files changed

+103
-60
lines changed

docs/source/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ipywidgets changelog
1+
# ipywidgets Changelog
22

33
A summary of changes in ipywidgets. For more detailed information, see the issues and pull requests for the appropriate milestone on [GitHub](https://github.com/jupyter-widgets/ipywidgets).
44

docs/source/conf.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
master_doc = 'index'
4545
project = 'Jupyter Widgets'
46-
copyright = '2017 Project Jupyter'
46+
copyright = '2017-2021 Project Jupyter'
4747
author = 'Jupyter Team'
4848

4949
language = None
@@ -103,4 +103,11 @@
103103
# -- Theme options -----------------
104104

105105
# Options are theme-specific and customize the look and feel of the theme.
106-
html_theme_options = {}
106+
html_theme_options = {
107+
# Toc options
108+
'collapse_navigation': True,
109+
'sticky_navigation': True,
110+
'navigation_depth': 2,
111+
'includehidden': True,
112+
'titles_only': False
113+
}

docs/source/dev_docs.md

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
Building the Documentation
2-
==========================
1+
# Develop and Build Documentation
32

4-
To build the documentation you'll need [Sphinx](http://www.sphinx-doc.org/), [pandoc](http://pandoc.org/)
3+
To build the documentation you'll need [Sphinx](http://www.sphinx-doc.org/)
54
and a few other packages.
65

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:
6+
## Setup docs dev environment
87

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
16-
```
8+
### Use pip
179

1810
Alternatively, it is also possible to create a virtual environment and activate it with the following commands:
1911

@@ -31,6 +23,27 @@ In the environment, install the packages:
3123
python -m pip install -r docs/requirements.txt
3224
```
3325

26+
### Use conda
27+
28+
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:
29+
30+
```bash
31+
# create the environment
32+
conda create -n ipywidgets_docs -c conda-forge python pip
33+
```
34+
35+
Use conda to install the packages listed in `docs/requirements.txt`.
36+
37+
Then, activate the conda environment.
38+
39+
```bash
40+
# activate the environment
41+
conda activate ipywidgets_docs # Linux and OS X
42+
activate ipywidgets_docs # Windows
43+
```
44+
45+
## Build the documentation
46+
3447
Once you have installed the required packages, you can build the docs with:
3548

3649
```bash
@@ -40,15 +53,22 @@ make html
4053
```
4154

4255
After that, the generated HTML files will be available at
43-
`build/html/index.html`. You may view the docs in your browser.
56+
`build/html/index.html`. You may view the docs in your browser by entering
57+
the following in the terminal: `open build/html/index.html`. Alternatively,
58+
you can start a webserver using `python3 -m http.server` and navigate to
59+
<http://localhost:8000/build/html/index.html>.
4460

4561
Windows users can find `make.bat` in the `docs` folder.
4662

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

49-
### Cleaning notebooks for docs
65+
## Cleaning notebook output for docs
5066

51-
Notebook output and metadata should be stripped with [nbstripoutput](https://github.com/kynan/nbstripout) before commiting. For example:
52-
```
53-
nbstripoutput docs/source/examples/Widget\ List.ipynb
67+
When using notebook source files to generate documentation, it's good practice to strip
68+
notebook output and metadata with [nbstripout](https://github.com/kynan/nbstripout)
69+
before committing the notebook. For example, the following command will strip
70+
all output from a notebook:
71+
72+
```bash
73+
nbstripout docs/source/examples/Widget\ List.ipynb
5474
```

docs/source/developer_docs.rst

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Developer Docs
2-
===============
1+
ipywidgets Development
2+
======================
33

44
The Jupyter widgets packages are developed in the `https://github.com/jupyter-widgets/ipywidgets <https://github.com/jupyter-widgets/ipywidgets>`_ git repository. See the issue tracker, README, and other Github documents for the most recent information.
55

@@ -13,15 +13,3 @@ Scope of ipywidgets
1313
2. A basic, lightweight set of form controls that *use* this framework, based on standard HTML form controls. These included controls include a text area, text box, select and multiselect controls, checkbox, etc. A few more advanced controls that are very popular are also included, such as a slider and basic tab panels.
1414

1515
The framework for building rich interactive objects is the foremost purpose of the ipywidgets project, and the set of included reference form controls is purposefully kept small and self-contained to serve as something like a reference implementation. We encourage and support a robust ecosystem of packages built on top of the ipywidgets framework to provide more complicated interactive objects, such as maps or 2d and 3d visualizations, or other form control systems built on a variety of popular Javascript frameworks such as Material or Vue.
16-
17-
18-
Additional Developer Docs
19-
-------------------------
20-
21-
.. toctree::
22-
:maxdepth: 3
23-
24-
dev_install.md
25-
dev_testing.md
26-
dev_docs
27-
dev_release.md

docs/source/index.rst

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,60 @@
11
ipywidgets
22
==========
33

4-
Full Table of Contents
5-
----------------------
4+
.. only:: html
5+
6+
:Release: |release|
7+
:Date: |today|
8+
9+
**ipywidgets**, also known as jupyter-widgets or simply widgets, are
10+
`interactive HTML widgets <https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/examples/Index.ipynb>`_
11+
for Jupyter notebooks and the IPython kernel.
12+
13+
Notebooks come alive when interactive widgets are used. Users gain control of
14+
their data and can visualize changes in the data.
15+
16+
Learning becomes an immersive, fun experience. Researchers can easily see
17+
how changing inputs to a model impact the results. We hope you will add
18+
ipywidgets to your notebooks, and we're here to help you get started.
19+
620

721
.. toctree::
8-
:maxdepth: 2
22+
:caption: User Guide
23+
:maxdepth: 1
24+
25+
user_install.md
26+
examples/Widget Basics.ipynb
27+
examples/Widget List.ipynb
28+
examples/Output Widget.ipynb
29+
examples/Widget Events.ipynb
30+
examples/Widget Styling.ipynb
31+
examples/Layout Templates.ipynb
32+
examples/Widget Custom.ipynb
33+
examples/Using Interact.ipynb
34+
examples/Widget Low Level.ipynb
35+
examples/Widget Asynchronous.ipynb
36+
embedding.md
37+
38+
.. toctree::
39+
:caption: Changelog and Migration
40+
:maxdepth: 1
41+
42+
changelog.md
43+
migration_guides.md
44+
45+
.. toctree::
46+
:caption: Developer Guide
47+
:maxdepth: 1
48+
49+
developer_docs
50+
dev_install.md
51+
dev_testing.md
52+
dev_docs.md
53+
contributing.md
54+
dev_release.md
55+
56+
.. only:: html
957

10-
user_guide
11-
developer_docs
58+
* :ref:`genindex`
59+
* :ref:`modindex`
60+
* :ref:`search`

docs/source/user_guide.rst

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)