| title | shelldocs dev |
|---|---|
| description | Start the dev server with hot-reload for .md, .razor, and .cs changes. |
| order | 3 |
shelldocs dev is the daily-driver runner : dotnet watch run under the hood, with the watch set extended to include markdown so editing a .md file re-triggers the navigation-graph rebuild without a manual restart.
shelldocs dev [--dir <dir>] [--port <n>]Run from your docs project root:
shelldocs devServes at http://localhost:5000 and watches:
.cs(C# source).razor(component source).cssand.js(styling / interop)content/**/*.md(docs pages)
Editing any watched file triggers a hot-reload : Blazor's rebuild-and-refresh for source files, ShellDocs' nav-graph rebuild for markdown.
shelldocs dev --port 5200Binds to http://localhost:5200 instead. Useful when 5000 is taken by another Blazor project.
shelldocs dev --dir docs/MyDocs.Docs --port 5200Points at a specific project directory instead of the working dir. Handy in monorepos where you're normally in ../src/ but want to spin up the docs site.
dev shells out to:
dotnet watch --project <csproj> --non-interactive run --urls http://localhost:<port>--non-interactive disables dotnet watch's prompt for "restart on non-hot-reloadable changes" : ShellDocs sites usually just want the file-watcher to rebuild without asking.
Ctrl+C in the CLI forwards to the child process's entire process tree, so dotnet watch shuts down cleanly.
shelldocs dev is a thin convenience over dotnet watch run. If you'd rather run watch yourself : cd docs/MyDocs.Docs && dotnet watch run does the same thing (minus the --non-interactive flag and the markdown-in-watch-set optimization).