Skip to content

Commit 6e83c06

Browse files
authored
Enhance the documentation (#154)
* Remove api/index.html * Fix Python API doc & improve JavaScript API doc * Ignore link to transient file * more check link fix * Prettify
1 parent 08877c4 commit 6e83c06

File tree

8 files changed

+81
-352
lines changed

8 files changed

+81
-352
lines changed

.github/workflows/check-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
check_release:
1313
runs-on: ubuntu-latest
1414
strategy:
15+
fail-fast: false
1516
matrix:
1617
group: [check_release, link_check]
1718
python-version: ["3.9"]
@@ -27,6 +28,8 @@ jobs:
2728
- name: Check Links
2829
if: ${{ matrix.group == 'link_check' }}
2930
uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1
31+
with:
32+
ignore_links: "./api/index.html"
3033
- name: Check Release
3134
if: ${{ matrix.group == 'check_release' }}
3235
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,5 @@ jupyter_ydoc/_version.py
145145
!.yarn/releases
146146
!.yarn/sdks
147147
!.yarn/versions
148+
docs/source/api
149+
docs/source/changelog.md

docs/source/api/index.html

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

docs/source/changelog.md

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

docs/source/conf.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,14 @@ def setup(app):
8484

8585
# Build JavaScript Docs
8686
js = HERE.parent.parent / "javascript"
87-
js_docs = js / "docs"
8887
dest_dir = Path(app.outdir) / "api"
8988

90-
if js_docs.exists():
91-
# avoid rebuilding docs because it takes forever
92-
# `make clean` to force a rebuild
93-
print(f"already have {js_docs!s}")
94-
else:
95-
print("Building jupyterlab API docs")
96-
check_call(["npm", "install"], cwd=str(js))
97-
check_call(["npm", "run", "build"], cwd=str(js))
98-
check_call(["npm", "run", "docs"], cwd=str(js))
99-
100-
# Copy JavaScript Docs
101-
print(f"Copying {js_docs!s} -> {dest_dir!s}")
89+
print("Building @jupyter/ydoc API docs")
90+
cmd = ["yarn"] if shutil.which("yarn") is not None else ["npm"]
91+
check_call(cmd + ["install"], cwd=str(js))
92+
check_call(cmd + ["run", "build"], cwd=str(js))
93+
check_call(cmd + ["run", "docs"], cwd=str(js))
94+
10295
if dest_dir.exists():
103-
shutil.rmtree(str(dest_dir))
104-
shutil.copytree(str(js_docs), str(dest_dir))
96+
shutil.rmtree(dest_dir)
97+
shutil.copytree(str(js / "docs"), str(dest_dir))

docs/source/python_api.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44
Python API
55
==========
66

7-
.. automodule:: jupyter_ydoc.ydoc
7+
.. automodule:: jupyter_ydoc.ybasedoc
8+
:members:
9+
:inherited-members:
10+
11+
.. automodule:: jupyter_ydoc.yblob
12+
:members:
13+
:inherited-members:
14+
15+
.. automodule:: jupyter_ydoc.yfile
16+
:members:
17+
:inherited-members:
18+
19+
.. automodule:: jupyter_ydoc.ynotebook
20+
:members:
21+
:inherited-members:
22+
23+
.. automodule:: jupyter_ydoc.yunicode
824
:members:
925
:inherited-members:

javascript/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"scripts": {
2525
"build": "tsc -b",
2626
"build:test": "tsc --build tsconfig.test.json",
27-
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
28-
"docs": "typedoc --out ./docs src",
27+
"clean": "rimraf lib tsconfig.tsbuildinfo docs",
28+
"docs": "typedoc src",
2929
"eslint": "eslint --ext .js,.jsx,.ts,.tsx --cache --fix .",
3030
"eslint:check": "eslint --ext .js,.jsx,.ts,.tsx --cache .",
3131
"lint": "yarn integrity && yarn prettier && yarn eslint",

javascript/typedoc.json

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
11
{
2-
"out": "../docs/api/shared-models"
2+
"externalSymbolLinkMappings": {
3+
"@jupyterlab/nbformat": {
4+
"CellType": "https://jupyterlab.readthedocs.io/en/latest/api/types/nbformat.CellType.html",
5+
"ExecutionCount": "https://jupyterlab.readthedocs.io/en/latest/api/types/nbformat.ExecutionCount.html",
6+
"IAttachments": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.IAttachments.html",
7+
"IBaseCell": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.IBaseCell.html",
8+
"IBaseCellMetadata": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.IBaseCellMetadata.html",
9+
"ICodeCell": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.ICodeCell.html",
10+
"IMarkdownCell": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.IMarkdownCell.html",
11+
"INotebookContent": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.INotebookContent.html",
12+
"INotebookMetadata": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.INotebookMetadata.html",
13+
"IOutput": "https://jupyterlab.readthedocs.io/en/latest/api/types/nbformat.IOutput.html",
14+
"IRawCell": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.IRawCell.html",
15+
"IUnrecognizedCell": "https://jupyterlab.readthedocs.io/en/latest/api/interfaces/nbformat.IUnrecognizedCell.html"
16+
},
17+
"@lumino/coreutils": {
18+
"JSONObject": "https://lumino.readthedocs.io/en/latest/api/interfaces/coreutils.JSONObject.html",
19+
"JSONValue": "https://lumino.readthedocs.io/en/latest/api/types/coreutils.JSONValue.html",
20+
"PartialJSONValue": "https://lumino.readthedocs.io/en/latest/api/types/coreutils.PartialJSONValue.html"
21+
},
22+
"@lumino/disposable": {
23+
"IObservableDisposable": "https://lumino.readthedocs.io/en/latest/api/interfaces/disposable.IObservableDisposable.html"
24+
},
25+
"@lumino/signaling": {
26+
"ISignal": "https://lumino.readthedocs.io/en/latest/api/interfaces/signaling.ISignal.html",
27+
"Signal": "https://lumino.readthedocs.io/en/latest/api/classes/signaling.Signal-1.html"
28+
},
29+
"y-protocols": {
30+
"Awareness": "https://docs.yjs.dev/api/about-awareness"
31+
},
32+
"yjs": {
33+
"Array": "https://docs.yjs.dev/api/shared-types/y.array",
34+
"Doc": "https://docs.yjs.dev/api/y.doc",
35+
"Map": "https://docs.yjs.dev/api/shared-types/y.map",
36+
"Text": "https://docs.yjs.dev/api/shared-types/y.text",
37+
"UndoManager": "https://docs.yjs.dev/api/undo-manager",
38+
"YArrayEvent": "https://docs.yjs.dev/api/shared-types/y.array#y.arrayevent-api",
39+
"YEvent": "https://docs.yjs.dev/api/y.event",
40+
"YMapEvent": "https://docs.yjs.dev/api/shared-types/y.map#y.mapevent-api",
41+
"YTextEvent": "https://docs.yjs.dev/api/shared-types/y.text#y.textevent-api"
42+
}
43+
},
44+
"githubPages": false,
45+
"navigationLinks": {
46+
"GitHub": "https://github.com/jupyter-server/jupyter_ydoc",
47+
"Jupyter": "https://jupyter.org"
48+
},
49+
"titleLink": "https://jupyter-ydoc.readthedocs.io/en/latest",
50+
"out": "./docs"
351
}

0 commit comments

Comments
 (0)