Skip to content

Commit 8e87d6c

Browse files
authored
Add infrastructure for project docs (#68)
* Add infrastructure for project docs * Add dummy logos * Add jupyterlite-sphinx deployment * Add .readthedocs.yaml * Fix relative link * Debug * Update readme with how to build and server docs
1 parent 1e6d353 commit 8e87d6c

File tree

11 files changed

+295
-0
lines changed

11 files changed

+295
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,5 @@ jobs:
188188
- uses: actions/checkout@v4
189189
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
190190
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
191+
with:
192+
ignore_glob: docs/*.md

.readthedocs.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-24.04
5+
tools:
6+
python: mambaforge-23.11
7+
jobs:
8+
pre_build:
9+
- pip install -v .
10+
11+
conda:
12+
environment: docs/environment-docs.yml
13+
14+
sphinx:
15+
builder: html
16+
configuration: docs/conf.py
17+
fail_on_warning: true

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,25 @@ or:
119119
jupyter lite serve --LiteBuildConfig.extra_http_headers=Cross-Origin-Embedder-Policy=require-corp --LiteBuildConfig.extra_http_headers=Cross-Origin-Opener-Policy=same-origin
120120
```
121121

122+
### Building the documentation
123+
124+
The project documentation includes a demo deployment, and is built on every PR so that the changes can be checked manually before merging. To build the documentation and demo locally use:
125+
126+
```bash
127+
micromamba create -f docs/environment-docs.yml
128+
micromamba activate terminal-docs
129+
pip install -v .
130+
cd docs
131+
make html
132+
```
133+
134+
To serve this locally use:
135+
136+
```bash
137+
cd _build/html
138+
python -m http.server
139+
```
140+
122141
### Packaging the extension
123142

124143
See [RELEASE](RELEASE.md)

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Lines changed: 67 additions & 0 deletions
Loading
Lines changed: 67 additions & 0 deletions
Loading

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CHANGELOG.md

docs/conf.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from datetime import date
2+
import json
3+
from pathlib import Path
4+
5+
PACKAGE_JSON_FILENAME = Path(__file__).parent.parent / "package.json"
6+
PACKAGE_JSON = json.loads(PACKAGE_JSON_FILENAME.read_text(encoding="utf-8"))
7+
8+
project = 'JupyterLite Terminal'
9+
author = PACKAGE_JSON["author"]["name"]
10+
copyright = f"2024-{date.today().year}, {author}"
11+
release = PACKAGE_JSON["version"]
12+
13+
extensions = [
14+
"jupyterlite_sphinx",
15+
"myst_parser"
16+
]
17+
18+
templates_path = ['_templates']
19+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
20+
21+
html_static_path = ['_static']
22+
html_theme = "pydata_sphinx_theme"
23+
html_theme_options = {
24+
"github_url": PACKAGE_JSON["homepage"],
25+
"logo": {
26+
"alt_text": "JupyterLite Terminal - Home",
27+
"image_dark": "_static/terminal_logo_dark.svg",
28+
"image_light": "_static/terminal_logo_light.svg",
29+
"text": "JupyterLite Terminal",
30+
}
31+
}
32+
html_title = "JupyterLite Terminal"
33+
34+
# jupyterlite_sphonx settings
35+
jupyterlite_contents = "../deploy/contents/"
36+
jupyterlite_dir = "../deploy/"
37+
jupyterlite_silence = False

docs/environment-docs.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: terminal-docs
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
# General build dependencies
6+
- micromamba
7+
- nodejs =20
8+
- python =3.13
9+
10+
# Jupyter dependencies
11+
- jupyterlite-core >=0.6,<0.8.0
12+
13+
# Docs dependencies
14+
- jupyterlite-sphinx
15+
- myst-parser
16+
- pydata-sphinx-theme
17+
- sphinx

docs/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# JupyterLite Terminal
2+
3+
Blah blah blah.
4+
5+
## Contents
6+
7+
```{toctree}
8+
:maxdepth: 1
9+
10+
changelog
11+
```
12+
13+
Link to <a href="./lite">deployment</a>.

0 commit comments

Comments
 (0)