Skip to content

Move the docs into this repo and publish them with GitHub Pages - #301

Merged
bensynapse merged 1 commit into
mainfrom
docs/pages-site
Oct 6, 2026
Merged

bensynapse merged 1 commit into
mainfrom
docs/pages-site

Conversation

@bensynapse

Copy link
Copy Markdown
Owner

Finding F2 (docs hosting) and F16 (docs errors) in the review, plus issue #287.

The docs were built from bensynapse/jsonrpcserver.docs and pushed into the previous owner's website repo with a token we don't have, so we couldn't update them. This moves them into docs/ here, the same way jsonrpcclient did, and .github/workflows/docs.yml deploys them with actions/deploy-pages on each push to main. The site will be https://bensynapse.github.io/jsonrpcserver/. Pages is already set to deploy from Actions. jsonrpcserver.docs is left as it is.

Examples. The wiki examples are now files in docs/examples/, included into the Examples page. check_examples.py starts each one and sends it real requests. The HTTP ones must answer a request with pong and a notification with 204 and no body. The list is http.server, serve(), Flask, Werkzeug, Django, FastAPI, aiohttp, Sanic, Tornado, websockets, ZeroMQ (sync and asyncio) and Socket.IO. Changes from the wiki:

  • websockets uses websockets.asyncio.server and asyncio.run (Update websockets example #287). The old example fails on Python 3.14 with "There is no current event loop".
  • The async ZeroMQ example uses pyzmq's zmq.asyncio instead of aiozmq, which is no longer maintained.
  • HTTP examples send 204 for notifications, and the async frameworks use async_dispatch.
  • Django is a single runnable file.

Code in the docs runs in CI. tests/doc_examples.py (copied from jsonrpcclient) runs every Python block in the README and docs/*.md, and checks doctest output. tests/test_docs.py runs it in the test matrix on 3.8 to 3.14, and the new docs CI job runs it again with the optional libraries installed. That job also runs mkdocs build --strict and the example servers. It's added to "CI OK".

Content fixes from the review:

  • async.md imported nothing for Result, and its notification snippet called the sync dispatch.
  • methods.md said "Value must be 1-5" for range(1, 5).
  • faq.md said validation is about 40% of dispatch time. I measured 74% for a trivial method on 3.13.
  • The pages now cover debug, max_batch_size, mixing sync and async methods, and type checking.

New pages.

  • Security: exception messages, batch limits, client-settable parameters, the global method registry, serve(), and NaN on input.
  • Roadmap: the 6.0 backlog from the review.

The README now links to the new site and to bensynapse badges. Also fixed: the docstring link in exceptions.py, which went to the old owner's discussions.

Checked locally with mkdocs build --strict, ruff, mypy and pyright. The doc examples pass on 3.8, 3.13 and 3.14. Every example server passes too. I ran those in a network namespace, since port 5000 is busy on my machine.

The docs were built from bensynapse/jsonrpcserver.docs and pushed to the
previous owner's website, which we can't update. They now live in docs/
and .github/workflows/docs.yml deploys them to GitHub Pages on every push
to main.

The framework examples move here from the wiki, as files under
docs/examples. CI starts each server and sends it a request and a
notification. The websockets example uses websockets.asyncio, since the old
one fails on Python 3.14. CI also runs every Python block in the README and
docs, and checks the output shown.

New pages: Security, and a Roadmap with the 6.0 backlog. The README now
links to the new site.
@bensynapse
bensynapse merged commit e87cb1d into main Oct 6, 2026
12 checks passed
@bensynapse
bensynapse deleted the docs/pages-site branch October 6, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant