From 1ee23ed8b70d8c241645d4d3e829d1a90b52c619 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Mon, 22 Sep 2025 09:29:49 +0100 Subject: [PATCH 1/7] Add infrastructure for project docs --- docs/Makefile | 20 ++++++++++++++++++++ docs/changelog.md | 1 + docs/conf.py | 25 +++++++++++++++++++++++++ docs/index.md | 11 +++++++++++ docs/make.bat | 35 +++++++++++++++++++++++++++++++++++ docs/requirements-docs.txt | 3 +++ 6 files changed, 95 insertions(+) create mode 100644 docs/Makefile create mode 120000 docs/changelog.md create mode 100644 docs/conf.py create mode 100644 docs/index.md create mode 100644 docs/make.bat create mode 100644 docs/requirements-docs.txt diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/changelog.md b/docs/changelog.md new file mode 120000 index 0000000..04c99a5 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..a807df0 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,25 @@ +from datetime import date +import json +from pathlib import Path + +PACKAGE_JSON_FILENAME = Path(__file__).parent.parent / "package.json" +PACKAGE_JSON = json.loads(PACKAGE_JSON_FILENAME.read_text(encoding="utf-8")) + +project = 'JupyterLite Terminal' +author = PACKAGE_JSON["author"]["name"] +copyright = f"2024-{date.today().year}, {author}" +release = PACKAGE_JSON["version"] + +extensions = [ + "myst_parser" +] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +html_static_path = ['_static'] +html_theme = "pydata_sphinx_theme" +html_theme_options = { + "github_url": PACKAGE_JSON["homepage"], +} +html_title = "JupyterLite Terminal" diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..37412ea --- /dev/null +++ b/docs/index.md @@ -0,0 +1,11 @@ +# JupyterLite Terminal + +Blah blah blah. + +## Contents + +```{toctree} +:maxdepth: 1 + +changelog +``` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt new file mode 100644 index 0000000..59cc7cd --- /dev/null +++ b/docs/requirements-docs.txt @@ -0,0 +1,3 @@ +myst-parser +pydata-sphinx-theme +sphinx From ed73508ea39d738f8ceb7fdf7c70c7dd0f4a3523 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 25 Sep 2025 13:07:50 +0100 Subject: [PATCH 2/7] Add dummy logos --- docs/_static/terminal_logo_dark.svg | 67 ++++++++++++++++++++++++++++ docs/_static/terminal_logo_light.svg | 67 ++++++++++++++++++++++++++++ docs/conf.py | 6 +++ 3 files changed, 140 insertions(+) create mode 100644 docs/_static/terminal_logo_dark.svg create mode 100644 docs/_static/terminal_logo_light.svg diff --git a/docs/_static/terminal_logo_dark.svg b/docs/_static/terminal_logo_dark.svg new file mode 100644 index 0000000..feda23d --- /dev/null +++ b/docs/_static/terminal_logo_dark.svg @@ -0,0 +1,67 @@ + + + + + + + + DummyLogo + + + diff --git a/docs/_static/terminal_logo_light.svg b/docs/_static/terminal_logo_light.svg new file mode 100644 index 0000000..de3402f --- /dev/null +++ b/docs/_static/terminal_logo_light.svg @@ -0,0 +1,67 @@ + + + + + + + + DummyLogo + + + diff --git a/docs/conf.py b/docs/conf.py index a807df0..de954ee 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,5 +21,11 @@ html_theme = "pydata_sphinx_theme" html_theme_options = { "github_url": PACKAGE_JSON["homepage"], + "logo": { + "alt_text": "JupyterLite Terminal - Home", + "image_dark": "_static/terminal_logo_dark.svg", + "image_light": "_static/terminal_logo_light.svg", + "text": "JupyterLite Terminal", + } } html_title = "JupyterLite Terminal" From c63dc37a163a113089d3faa9ee54f78cae5bf106 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 25 Sep 2025 13:23:18 +0100 Subject: [PATCH 3/7] Add jupyterlite-sphinx deployment --- docs/conf.py | 6 ++++++ docs/index.md | 2 ++ docs/requirements-docs.txt | 1 + 3 files changed, 9 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index de954ee..46c10e0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,6 +11,7 @@ release = PACKAGE_JSON["version"] extensions = [ + "jupyterlite_sphinx", "myst_parser" ] @@ -29,3 +30,8 @@ } } html_title = "JupyterLite Terminal" + +# jupyterlite_sphonx settings +jupyterlite_contents = "../deploy/contents/" +jupyterlite_dir = "../deploy/" +jupyterlite_silence = False diff --git a/docs/index.md b/docs/index.md index 37412ea..139b3e3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -9,3 +9,5 @@ Blah blah blah. changelog ``` + +Link to deployment. diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index 59cc7cd..fbc47de 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -1,3 +1,4 @@ +jupyterlite-sphinx myst-parser pydata-sphinx-theme sphinx From 0c70658a9ec14e4e1a957f00b25c7c4e85d81714 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 25 Sep 2025 14:35:58 +0100 Subject: [PATCH 4/7] Add .readthedocs.yaml --- .readthedocs.yaml | 17 +++++++++++++++++ docs/environment-docs.yml | 17 +++++++++++++++++ docs/requirements-docs.txt | 4 ---- 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 .readthedocs.yaml create mode 100644 docs/environment-docs.yml delete mode 100644 docs/requirements-docs.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..4258ed9 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +version: 2 + +build: + os: ubuntu-24.04 + tools: + python: mambaforge-23.11 + jobs: + pre_build: + - pip install -v . + +conda: + environment: docs/environment-docs.yml + +sphinx: + builder: html + configuration: docs/conf.py + fail_on_warning: true diff --git a/docs/environment-docs.yml b/docs/environment-docs.yml new file mode 100644 index 0000000..d12f41a --- /dev/null +++ b/docs/environment-docs.yml @@ -0,0 +1,17 @@ +name: terminal-docs +channels: + - conda-forge +dependencies: + # General build dependencies + - micromamba + - nodejs =20 + - python =3.13 + + # Jupyter dependencies + - jupyterlite-core >=0.6,<0.8.0 + + # Docs dependencies + - jupyterlite-sphinx + - myst-parser + - pydata-sphinx-theme + - sphinx diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt deleted file mode 100644 index fbc47de..0000000 --- a/docs/requirements-docs.txt +++ /dev/null @@ -1,4 +0,0 @@ -jupyterlite-sphinx -myst-parser -pydata-sphinx-theme -sphinx From 53d05f776274287e70e5a8b7945e895a619b3ba8 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 25 Sep 2025 15:02:48 +0100 Subject: [PATCH 5/7] Fix relative link --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 139b3e3..0042241 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,4 +10,4 @@ Blah blah blah. changelog ``` -Link to deployment. +Link to deployment. From 89245b86b1794e1ccdce9db0682d9f77ec636b3e Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 25 Sep 2025 15:14:02 +0100 Subject: [PATCH 6/7] Debug --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6fc5bf..4e1307a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -188,3 +188,5 @@ jobs: - uses: actions/checkout@v4 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 + with: + ignore_glob: docs/*.md From 7e2f2834996897b68557e21f4eb0e515d25b08bc Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 25 Sep 2025 15:39:18 +0100 Subject: [PATCH 7/7] Update readme with how to build and server docs --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 48be0c1..4624cf5 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,25 @@ or: jupyter lite serve --LiteBuildConfig.extra_http_headers=Cross-Origin-Embedder-Policy=require-corp --LiteBuildConfig.extra_http_headers=Cross-Origin-Opener-Policy=same-origin ``` +### Building the documentation + +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: + +```bash +micromamba create -f docs/environment-docs.yml +micromamba activate terminal-docs +pip install -v . +cd docs +make html +``` + +To serve this locally use: + +```bash +cd _build/html +python -m http.server +``` + ### Packaging the extension See [RELEASE](RELEASE.md)