serve

mdu serve renders the site, starts a local preview server, and opens it in your browser. It generates documentation.pdf only if a page contains [Download the PDF](mdu:pdf). While it runs, it watches the documentation folder and the folders containing referenced OpenAPI files: when you save a page, a linked image, or a referenced OpenAPI file, the affected output is refreshed and the browser reloads it. Markdown changes refresh the PDF when a PDF Link is present; adding the first link creates the PDF, and removing the last link removes it. Press Ctrl+C to stop.

Usage

mdu serve [PATH [OUTPATH]] [options]

See Paths and file search for the default folders and common options for --pattern and --hidden.

Option Effect
--port <port> Port of the preview server. Default: 4173.
--no-browser Start the server without opening a browser.
--editPageRoot <url> Add edit links and a repository button, as with mdu render.

Examples

mdu serve
mdu serve ./ProjectDocs ./site --port 8080
mdu serve --no-browser

Note

The output folder must differ from the documentation folder and must not contain it. Use mdu render to create the site you publish; serve is meant for local preview.

How live reload works describes what serve renders again after a change.

Search documentation

Press Esc to close

Start typing to search the documentation.

Media settings

Choose which providers may load videos automatically across this site. Your choices are stored in this browser.