Developing mdNotebook

The code

Directory What's in it
src/mdNotebook.core The rules the server and the apps both follow, written once: names, what each path is (PathKinds), metadata, the manifest and hashes, and markdown rendering.
src/mdNotebook.server The server: configuration, logins, reading and changing notebooks, hooks, and the web pages (docs, downloads).
tests/mdNotebook.server.tests The tests (xUnit).
docs This documentation, which is itself a notebook.
lib/bulma Bulma, the stylesheet every page and app uses, as a git submodule following its main branch (git submodule update --remote updates it). Only its built css/bulma.min.css is used; the server serves it at /assets/bulma.min.css.
PLAN.md Where the project is up to, and every decision made, with why.

The protocol is the contract between the server and the apps. It's changed before the code that implements it, and its version goes up each time.

Building and testing

Check out the submodule first (git clone --recurse-submodules, or git submodule update --init).

With the .NET SDK installed:

dotnet test mdNotebook.slnx

Or without it, in the SDK's container:

docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD":/src -w /src mcr.microsoft.com/dotnet/sdk:10.0 dotnet test mdNotebook.slnx
docker build --build-arg MDN_UID=$(id -u) --build-arg MDN_GID=$(id -g) -t mdnotebook .

Everything in the protocol can be tried with curl. A POST with no body needs -d '':

curl -u andrew:changeme http://localhost:8180/api/notebooks
curl -u andrew:changeme http://localhost:8180/api/notebooks/myDiary/manifest

Code style

Plain and easy to read: static classes and methods, loops and ifs, simple LINQ, tabs, Allman braces, explicit types, and short comments that say why. The full list is in CLAUDE.md.