diff --git a/.gitignore b/.gitignore
index 410758a..8503fab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,6 +70,7 @@ instance/
# Sphinx documentation
docs/_build/
+javascript/docs
# PyBuilder
target/
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..c056f27
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,25 @@
+# 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 = source
+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)
+
+clean:
+ # clean api build as well
+ -rm -rf "$(SOURCEDIR)/../api"
+ @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/make.bat b/docs/make.bat
new file mode 100644
index 0000000..747ffb7
--- /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=source
+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/source/_static/jupyter_logo.svg b/docs/source/_static/jupyter_logo.svg
new file mode 100644
index 0000000..b85d1f4
--- /dev/null
+++ b/docs/source/_static/jupyter_logo.svg
@@ -0,0 +1,42 @@
+
diff --git a/docs/source/_static/logo-icon.png b/docs/source/_static/logo-icon.png
new file mode 100644
index 0000000..a65b84f
Binary files /dev/null and b/docs/source/_static/logo-icon.png differ
diff --git a/docs/source/api/index.html b/docs/source/api/index.html
new file mode 100644
index 0000000..24ece5d
--- /dev/null
+++ b/docs/source/api/index.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ Welcome to Jupyter YDoc’s documentation!
+
+
+
diff --git a/docs/source/changelog.md b/docs/source/changelog.md
new file mode 100644
index 0000000..2aadb74
--- /dev/null
+++ b/docs/source/changelog.md
@@ -0,0 +1,318 @@
+# Changelog
+
+
+
+## 0.3.0a1
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.3.0a0...6dcc9ec61f4b022ec43bdaa7916bd58de481c761))
+
+### Enhancements made
+
+- Add path document attribute [#81](https://github.com/jupyter-server/jupyter_ydoc/pull/81) ([@davidbrochart](https://github.com/davidbrochart))
+- Make YBaseDoc an abstract base class [#74](https://github.com/jupyter-server/jupyter_ydoc/pull/74) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Bugs fixed
+
+- Removes YMap for attachements [#77](https://github.com/jupyter-server/jupyter_ydoc/pull/77) ([@fcollonval](https://github.com/fcollonval))
+- Drop `pkg_resources` [#59](https://github.com/jupyter-server/jupyter_ydoc/pull/59) ([@jtpio](https://github.com/jtpio))
+
+### Maintenance and upkeep improvements
+
+- Bump tj-actions/changed-files from 31.0.3 to 33.0.0 [#80](https://github.com/jupyter-server/jupyter_ydoc/pull/80) ([@dependabot](https://github.com/dependabot))
+- Bump pre-commit/action from 2.0.0 to 3.0.0 [#72](https://github.com/jupyter-server/jupyter_ydoc/pull/72) ([@dependabot](https://github.com/dependabot))
+- Bump actions/checkout from 2 to 3 [#71](https://github.com/jupyter-server/jupyter_ydoc/pull/71) ([@dependabot](https://github.com/dependabot))
+- Bump actions/setup-python from 2 to 4 [#70](https://github.com/jupyter-server/jupyter_ydoc/pull/70) ([@dependabot](https://github.com/dependabot))
+- Bump actions/cache from 1 to 3 [#69](https://github.com/jupyter-server/jupyter_ydoc/pull/69) ([@dependabot](https://github.com/dependabot))
+- Bump actions/setup-node from 2 to 3 [#68](https://github.com/jupyter-server/jupyter_ydoc/pull/68) ([@dependabot](https://github.com/dependabot))
+- Bump tj-actions/changed-files from 31.0.1 to 31.0.3 [#67](https://github.com/jupyter-server/jupyter_ydoc/pull/67) ([@dependabot](https://github.com/dependabot))
+
+### Other merged PRs
+
+- Add workflows to ease maintenance [#64](https://github.com/jupyter-server/jupyter_ydoc/pull/64) ([@fcollonval](https://github.com/fcollonval))
+- Test a case with plotly renderer [#63](https://github.com/jupyter-server/jupyter_ydoc/pull/63) ([@fcollonval](https://github.com/fcollonval))
+- Pin @jupyterlab/shared-models >=4.0.0-alpha.10,\<4.0.0-alpha.14 [#61](https://github.com/jupyter-server/jupyter_ydoc/pull/61) ([@davidbrochart](https://github.com/davidbrochart))
+- Cast only if number has same value [#57](https://github.com/jupyter-server/jupyter_ydoc/pull/57) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-09-26&to=2022-10-26&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-09-26..2022-10-26&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adependabot+updated%3A2022-09-26..2022-10-26&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Afcollonval+updated%3A2022-09-26..2022-10-26&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ajtpio+updated%3A2022-09-26..2022-10-26&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2022-09-26..2022-10-26&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Awelcome+updated%3A2022-09-26..2022-10-26&type=Issues)
+
+
+
+## 0.3.0a0
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.2.0...63af4d7c91f1ba101612f0e52c24855a21eafedc))
+
+### Merged PRs
+
+- Add back YMap for cell metadata [#53](https://github.com/jupyter-server/jupyter_ydoc/pull/53) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-09-26&to=2022-09-26&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-09-26..2022-09-26&type=Issues)
+
+## 0.2.0
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.17...55dc65afafb669d0a5552e485cf860d402740dc7))
+
+### Merged PRs
+
+- Use hatch [#51](https://github.com/jupyter-server/jupyter_ydoc/pull/51) ([@davidbrochart](https://github.com/davidbrochart))
+- Removes YMap for cell metadata [#50](https://github.com/jupyter-server/jupyter_ydoc/pull/50) ([@hbcarlos](https://github.com/hbcarlos))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-08-01&to=2022-09-26&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-08-01..2022-09-26&type=Issues) | [@hbcarlos](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ahbcarlos+updated%3A2022-08-01..2022-09-26&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2022-08-01..2022-09-26&type=Issues)
+
+## 0.1.17
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.16...106ee079e2ad9ed7c8b25693932ad921e3ea3e20))
+
+### Merged PRs
+
+- Handle missing attachment key [#43](https://github.com/jupyter-server/jupyter_ydoc/pull/43) ([@jimgoo](https://github.com/jimgoo))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-07-27&to=2022-08-01&type=c))
+
+[@jimgoo](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ajimgoo+updated%3A2022-07-27..2022-08-01&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Awelcome+updated%3A2022-07-27..2022-08-01&type=Issues)
+
+## 0.1.16
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.15...780f8b8e898e31b6e82017a2bc2d04475728890f))
+
+### Merged PRs
+
+- Move ypy-websocket dependency to test [#41](https://github.com/jupyter-server/jupyter_ydoc/pull/41) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-07-27&to=2022-07-27&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-07-27..2022-07-27&type=Issues)
+
+## 0.1.15
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.14...41a1ad194b5cd26dc405ef9d774c05dde494a489))
+
+### Merged PRs
+
+- Add YNotebook get_cell, set_cell, append_cell [#35](https://github.com/jupyter-server/jupyter_ydoc/pull/35) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-07-26&to=2022-07-27&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-07-26..2022-07-27&type=Issues)
+
+## 0.1.14
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.13...523dc9e3ff9aed516ff0b0e3f2f7528f6da02faa))
+
+### Merged PRs
+
+- Align notebook schema with JupyterLab HEAD [#38](https://github.com/jupyter-server/jupyter_ydoc/pull/38) ([@davidbrochart](https://github.com/davidbrochart))
+- [pre-commit.ci] pre-commit autoupdate [#37](https://github.com/jupyter-server/jupyter_ydoc/pull/37) ([@pre-commit-ci](https://github.com/pre-commit-ci))
+- [pre-commit.ci] pre-commit autoupdate [#36](https://github.com/jupyter-server/jupyter_ydoc/pull/36) ([@pre-commit-ci](https://github.com/pre-commit-ci))
+- [pre-commit.ci] pre-commit autoupdate [#28](https://github.com/jupyter-server/jupyter_ydoc/pull/28) ([@pre-commit-ci](https://github.com/pre-commit-ci))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-07-04&to=2022-07-26&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-07-04..2022-07-26&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2022-07-04..2022-07-26&type=Issues)
+
+## 0.1.13
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.12...807dc511e2d3536c62d0710d2b97a21c6e704337))
+
+### Merged PRs
+
+- Update API [#32](https://github.com/jupyter-server/jupyter_ydoc/pull/32) ([@hbcarlos](https://github.com/hbcarlos))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-06-30&to=2022-07-04&type=c))
+
+[@hbcarlos](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ahbcarlos+updated%3A2022-06-30..2022-07-04&type=Issues)
+
+## 0.1.12
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.11...05c97a4b32b826f7c5224d8807340314a7df832d))
+
+### Merged PRs
+
+- Fix type checking when casting [#30](https://github.com/jupyter-server/jupyter_ydoc/pull/30) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-06-09&to=2022-06-30&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-06-09..2022-06-30&type=Issues)
+
+## 0.1.11
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.10...9329161e338ac999a1c342bce89bf4f642b426aa))
+
+### Merged PRs
+
+- Changes the schema [#27](https://github.com/jupyter-server/jupyter_ydoc/pull/27) ([@hbcarlos](https://github.com/hbcarlos))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-19&to=2022-06-09&type=c))
+
+[@hbcarlos](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ahbcarlos+updated%3A2022-05-19..2022-06-09&type=Issues)
+
+## 0.1.10
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.9...142953275358ce675203d3de479cf8f2a4413fe8))
+
+### Merged PRs
+
+- Remove document apply_update method [#25](https://github.com/jupyter-server/jupyter_ydoc/pull/25) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-19&to=2022-05-19&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-19..2022-05-19&type=Issues)
+
+## 0.1.9
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.8...4654f6176af5c6f26f18646283e9eec16b1f013f))
+
+### Merged PRs
+
+- Add document apply_update method [#23](https://github.com/jupyter-server/jupyter_ydoc/pull/23) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-12&to=2022-05-19&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-12..2022-05-19&type=Issues)
+
+## 0.1.8
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.7...3662d97fadde04e70dd599523666f2716dcd14de))
+
+### Merged PRs
+
+- Move nbformat and nbformat_minor to meta YMap [#21](https://github.com/jupyter-server/jupyter_ydoc/pull/21) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-11&to=2022-05-12&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-11..2022-05-12&type=Issues) | [@hbcarlos](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ahbcarlos+updated%3A2022-05-11..2022-05-12&type=Issues)
+
+## 0.1.7
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.6...b382a35a052da5b99c94d9bedaaa92634b5d1fb4))
+
+### Merged PRs
+
+- Also observe the state YMap [#19](https://github.com/jupyter-server/jupyter_ydoc/pull/19) ([@davidbrochart](https://github.com/davidbrochart))
+- Change URL to point to jupyter-server [#18](https://github.com/jupyter-server/jupyter_ydoc/pull/18) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-11&to=2022-05-11&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-11..2022-05-11&type=Issues)
+
+## 0.1.6
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.5...09cf7997439a7ca2a36041390a4e93984277a36c))
+
+### Merged PRs
+
+- Allow to set dirty whatever the previous value [#16](https://github.com/jupyter-server/jupyter_ydoc/pull/16) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-10&to=2022-05-11&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-10..2022-05-11&type=Issues)
+
+## 0.1.5
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.4...5b36f6bed6c4d5a789b9dd7b06a526889e515511))
+
+### Merged PRs
+
+- Adds id to cells [#13](https://github.com/jupyter-server/jupyter_ydoc/pull/13) ([@hbcarlos](https://github.com/hbcarlos))
+- [pre-commit.ci] pre-commit autoupdate [#12](https://github.com/jupyter-server/jupyter_ydoc/pull/12) ([@pre-commit-ci](https://github.com/pre-commit-ci))
+- Transfer repo to jupyter-server org [#11](https://github.com/jupyter-server/jupyter_ydoc/pull/11) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-09&to=2022-05-10&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-09..2022-05-10&type=Issues) | [@hbcarlos](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ahbcarlos+updated%3A2022-05-09..2022-05-10&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2022-05-09..2022-05-10&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Awelcome+updated%3A2022-05-09..2022-05-10&type=Issues)
+
+## 0.1.4
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.3...d6e754a8c957582029d923cadc4e6547a324718c))
+
+### Merged PRs
+
+- Update ypy>=0.5.0 [#9](https://github.com/jupyter-server/jupyter_ydoc/pull/9) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-05&to=2022-05-09&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-05..2022-05-09&type=Issues)
+
+## 0.1.3
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.2...c68ebe54e500edde4eb34aa598dfb7bbb4d22b63))
+
+### Merged PRs
+
+- Add setuptools to install_requires [#7](https://github.com/jupyter-server/jupyter_ydoc/pull/7) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-05&to=2022-05-05&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-05..2022-05-05&type=Issues)
+
+## 0.1.2
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/v0.1.1...6a1fc44531344e1f930a7fd52b62cbd289873be0))
+
+### Merged PRs
+
+- Improve jupyter_ydoc.ydocs [#5](https://github.com/jupyter-server/jupyter_ydoc/pull/5) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-04&to=2022-05-05&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-04..2022-05-05&type=Issues)
+
+## 0.1.1
+
+([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/0.1.0...9db91b826c38116ab1e00b26140dd49950e1a793))
+
+### Merged PRs
+
+- Add test [#3](https://github.com/jupyter-server/jupyter_ydoc/pull/3) ([@davidbrochart](https://github.com/davidbrochart))
+- Update README [#1](https://github.com/jupyter-server/jupyter_ydoc/pull/1) ([@davidbrochart](https://github.com/davidbrochart))
+
+### Contributors to this release
+
+([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2022-05-02&to=2022-05-04&type=c))
+
+[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2022-05-02..2022-05-04&type=Issues)
+
+## 0.1.0
diff --git a/docs/source/conf.py b/docs/source/conf.py
new file mode 100644
index 0000000..025c294
--- /dev/null
+++ b/docs/source/conf.py
@@ -0,0 +1,101 @@
+# Configuration file for the Sphinx documentation builder.
+#
+# For the full list of built-in configuration values, see the documentation:
+# https://www.sphinx-doc.org/en/master/usage/configuration.html
+
+import shutil
+from pathlib import Path
+from subprocess import check_call
+
+HERE = Path(__file__).parent.resolve()
+
+# -- Project information -----------------------------------------------------
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
+
+project = "jupyter-ydoc"
+copyright = "2022, Jupyter Development Team"
+author = "Jupyter Development Team"
+release = "0.3.0"
+
+# -- General configuration ---------------------------------------------------
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
+
+extensions = ["myst_parser", "sphinx.ext.autodoc"]
+
+templates_path = ["_templates"]
+exclude_patterns = ["_static/api/**"]
+source_suffix = {
+ ".rst": "restructuredtext",
+ ".md": "markdown",
+}
+
+# -- Options for HTML output -------------------------------------------------
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
+
+# html_static_path = ['_static']
+
+html_theme = "pydata_sphinx_theme"
+html_logo = "_static/jupyter_logo.svg"
+html_favicon = "_static/logo-icon.png"
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#
+html_theme_options = {
+ "logo": {
+ "text": "Jupyter YDoc",
+ "image_dark": "_static/jupyter_logo.svg",
+ "alt_text": "Jupyter YDoc",
+ },
+ "icon_links": [
+ {
+ "name": "jupyter.org",
+ "url": "https://jupyter.org",
+ "icon": "_static/jupyter_logo.svg",
+ "type": "local",
+ }
+ ],
+ "github_url": "https://github.com/jupyter-server/jupyter_ydoc",
+ "use_edit_page_button": True,
+ "show_toc_level": 1,
+ "navbar_align": "left",
+ "navbar_end": ["navbar-icon-links.html"],
+ "footer_items": ["copyright.html"],
+}
+
+# Output for github to be used in links
+html_context = {
+ "github_user": "jupyter-server", # Username
+ "github_repo": "jupyter_ydoc", # Repo name
+ "github_version": "main", # Version
+ "conf_py_path": "/docs/source/", # Path in the checkout to the docs root
+}
+
+myst_heading_anchors = 3
+
+
+def setup(app):
+ # Copy changelog.md file
+ dest = HERE / "changelog.md"
+ shutil.copy(str(HERE.parent.parent / "CHANGELOG.md"), str(dest))
+
+ # Build JavaScript Docs
+ js = HERE.parent.parent / "javascript"
+ js_docs = js / "docs"
+ dest_dir = Path(app.outdir) / "api"
+
+ if js_docs.exists():
+ # avoid rebuilding docs because it takes forever
+ # `make clean` to force a rebuild
+ print(f"already have {js_docs!s}")
+ else:
+ print("Building jupyterlab API docs")
+ check_call(["npm", "install"], cwd=str(js))
+ check_call(["yarn", "run", "build"], cwd=str(js))
+ check_call(["yarn", "run", "docs"], cwd=str(js))
+
+ # Copy JavaScript Docs
+ print(f"Copying {js_docs!s} -> {dest_dir!s}")
+ if dest_dir.exists():
+ shutil.rmtree(str(dest_dir))
+ shutil.copytree(str(js_docs), str(dest_dir))
diff --git a/docs/source/custom.md b/docs/source/custom.md
new file mode 100644
index 0000000..8cbaaeb
--- /dev/null
+++ b/docs/source/custom.md
@@ -0,0 +1,3 @@
+# Custom documents
+
+Coming soon!
diff --git a/docs/source/index.md b/docs/source/index.md
new file mode 100644
index 0000000..7234bf3
--- /dev/null
+++ b/docs/source/index.md
@@ -0,0 +1,20 @@
+
+
+# Welcome to Jupyter YDoc's documentation!
+
+```{toctree}
+:maxdepth: 2
+:caption: Contents
+
+overview
+schema
+custom
+javascript_api
+python_api
+changelog
+```
diff --git a/docs/source/javascript_api.rst b/docs/source/javascript_api.rst
new file mode 100644
index 0000000..cee1733
--- /dev/null
+++ b/docs/source/javascript_api.rst
@@ -0,0 +1,8 @@
+JavaScript API
+==============
+
+.. meta::
+ :http-equiv=refresh: 0;url=./api/index.html
+
+The `@jupyter/ydoc` API reference docs are `here <./api/index.html>`_
+if you are not redirected automatically.
diff --git a/docs/source/overview.md b/docs/source/overview.md
new file mode 100644
index 0000000..f7ec83a
--- /dev/null
+++ b/docs/source/overview.md
@@ -0,0 +1,3 @@
+# Overview
+
+Coming soon!
diff --git a/docs/source/python_api.rst b/docs/source/python_api.rst
new file mode 100644
index 0000000..6e1fbc5
--- /dev/null
+++ b/docs/source/python_api.rst
@@ -0,0 +1,6 @@
+Python API
+==========
+
+.. automodule:: jupyter_ydoc.ydoc
+ :members:
+ :inherited-members:
diff --git a/docs/source/schema.md b/docs/source/schema.md
new file mode 100644
index 0000000..3791987
--- /dev/null
+++ b/docs/source/schema.md
@@ -0,0 +1,10 @@
+# Schemas
+
+## YFile
+
+Coming soon!
+
+
+## YNotebook
+
+Coming soon!
diff --git a/javascript/.eslintignore b/javascript/.eslintignore
index 491fc35..a6f7393 100644
--- a/javascript/.eslintignore
+++ b/javascript/.eslintignore
@@ -1,2 +1,3 @@
node_modules
lib
+docs
diff --git a/javascript/.prettierignore b/javascript/.prettierignore
index 5ed954b..6c0416d 100644
--- a/javascript/.prettierignore
+++ b/javascript/.prettierignore
@@ -1,3 +1,4 @@
node_modules
lib
+docs
package.json
diff --git a/javascript/package.json b/javascript/package.json
index 66e6fed..53cdc95 100644
--- a/javascript/package.json
+++ b/javascript/package.json
@@ -25,7 +25,7 @@
"build": "tsc -b",
"build:test": "tsc --build tsconfig.test.json",
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
- "docs": "typedoc src",
+ "docs": "typedoc --out ./docs src",
"eslint": "eslint --ext .js,.jsx,.ts,.tsx --cache --fix .",
"eslint:check": "eslint --ext .js,.jsx,.ts,.tsx --cache .",
"lint": "yarn prettier && yarn eslint",
@@ -57,6 +57,7 @@
"jest": "^29.0.0",
"prettier": "^2.6.0",
"rimraf": "^3.0.0",
+ "typedoc": "^0.23.21",
"typescript": "^4.8.0"
},
"publishConfig": {
diff --git a/javascript/yarn.lock b/javascript/yarn.lock
index 7abd7f3..f5f2c31 100644
--- a/javascript/yarn.lock
+++ b/javascript/yarn.lock
@@ -1058,6 +1058,13 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
+brace-expansion@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
+ integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
+ dependencies:
+ balanced-match "^1.0.0"
+
braces@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
@@ -2221,6 +2228,11 @@ json5@^2.2.1:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c"
integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==
+jsonc-parser@^3.0.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76"
+ integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==
+
kleur@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
@@ -2277,6 +2289,11 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
+lunr@^2.3.9:
+ version "2.3.9"
+ resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1"
+ integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==
+
make-dir@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
@@ -2291,6 +2308,11 @@ makeerror@1.0.12:
dependencies:
tmpl "1.0.5"
+marked@^4.0.19:
+ version "4.2.3"
+ resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.3.tgz#bd76a5eb510ff1d8421bc6c3b2f0b93488c15bea"
+ integrity sha512-slWRdJkbTZ+PjkyJnE30Uid64eHwbwa1Q25INCAYfZlK4o6ylagBy/Le9eWntqJFoFT93ikUKMv47GZ4gTwHkw==
+
merge-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@@ -2321,6 +2343,13 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
dependencies:
brace-expansion "^1.1.7"
+minimatch@^5.1.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7"
+ integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==
+ dependencies:
+ brace-expansion "^2.0.1"
+
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
@@ -2614,6 +2643,15 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
+shiki@^0.11.1:
+ version "0.11.1"
+ resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.11.1.tgz#df0f719e7ab592c484d8b73ec10e215a503ab8cc"
+ integrity sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==
+ dependencies:
+ jsonc-parser "^3.0.0"
+ vscode-oniguruma "^1.6.1"
+ vscode-textmate "^6.0.0"
+
signal-exit@^3.0.3, signal-exit@^3.0.7:
version "3.0.7"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
@@ -2784,6 +2822,16 @@ type-fest@^0.21.3:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
+typedoc@^0.23.21:
+ version "0.23.21"
+ resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.21.tgz#2a6b0e155f91ffa9689086706ad7e3e4bc11d241"
+ integrity sha512-VNE9Jv7BgclvyH9moi2mluneSviD43dCE9pY8RWkO88/DrEgJZk9KpUk7WO468c9WWs/+aG6dOnoH7ccjnErhg==
+ dependencies:
+ lunr "^2.3.9"
+ marked "^4.0.19"
+ minimatch "^5.1.0"
+ shiki "^0.11.1"
+
typescript@^4.8.0:
version "4.8.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
@@ -2813,6 +2861,16 @@ v8-to-istanbul@^9.0.1:
"@types/istanbul-lib-coverage" "^2.0.1"
convert-source-map "^1.6.0"
+vscode-oniguruma@^1.6.1:
+ version "1.6.2"
+ resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz#aeb9771a2f1dbfc9083c8a7fdd9cccaa3f386607"
+ integrity sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==
+
+vscode-textmate@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-6.0.0.tgz#a3777197235036814ac9a92451492f2748589210"
+ integrity sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==
+
walker@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f"
diff --git a/jupyter_ydoc/ydoc.py b/jupyter_ydoc/ydoc.py
index 2aff3e5..eab6921 100644
--- a/jupyter_ydoc/ydoc.py
+++ b/jupyter_ydoc/ydoc.py
@@ -9,6 +9,10 @@
class YBaseDoc(ABC):
+ """
+ Base class
+ """
+
def __init__(self, ydoc: Y.YDoc):
self._ydoc = ydoc
self._ystate = self._ydoc.get_map("state")
@@ -67,14 +71,27 @@ def unobserve(self):
class YFile(YBaseDoc):
+ """
+ YFile class
+ """
+
def __init__(self, *args, **kwargs):
+ """
+ Constructor
+ """
super().__init__(*args, **kwargs)
self._ysource = self._ydoc.get_text("source")
def get(self):
+ """
+ get source
+ """
return str(self._ysource)
def set(self, value):
+ """
+ set source
+ """
with self._ydoc.begin_transaction() as t:
# clear document
source_len = len(self._ysource)
@@ -85,6 +102,9 @@ def set(self, value):
self._ysource.extend(t, value)
def observe(self, callback):
+ """
+ observe changes
+ """
self.unobserve()
self._subscriptions[self._ystate] = self._ystate.observe(callback)
self._subscriptions[self._ysource] = self._ysource.observe(callback)
diff --git a/pyproject.toml b/pyproject.toml
index 64e5eef..004010c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -25,6 +25,9 @@ name = "Jupyter Development Team"
email = "jupyter@googlegroups.com"
[project.optional-dependencies]
+dev = [
+ "pre-commit"
+]
test = [
"pre-commit",
"pytest",
@@ -32,6 +35,11 @@ test = [
"websockets >=10.0",
"ypy-websocket >=0.3.1,<0.4.0",
]
+docs = [
+ "sphinx",
+ "myst-parser",
+ "pydata-sphinx-theme"
+]
[project.entry-points.jupyter_ydoc]
file = "jupyter_ydoc.ydoc:YFile"
diff --git a/readthedocs.yml b/readthedocs.yml
new file mode 100644
index 0000000..ffb6560
--- /dev/null
+++ b/readthedocs.yml
@@ -0,0 +1,17 @@
+version: 2
+
+build:
+ os: ubuntu-20.04
+ tools:
+ python: "3.8"
+ nodejs: "14"
+
+sphinx:
+ configuration: docs/source/conf.py
+
+python:
+ install:
+ - method: pip
+ path: .
+ extra_requirements:
+ - docs