Try it in your browser

Page content:

Nothing to install. Press Run, and Node.js starts inside this page. It installs Postdoc, creates a site with postdoc init, checks it with postdoc check and serves it with postdoc run. Then the site is yours: the first guide page opens in the editor, and the preview follows what you type.

The install takes a minute or two the first time, and nothing is kept when you leave the page.

Things to try

  • Change the heading of content/guide/index.md, and watch the preview.
  • Add a page: right-click content/guide in the explorer, choose New File…, name it hello.md and write a heading in it. Then type /guide/hello.html in the preview's address bar.
  • Break a link in a page, open a second terminal with +, and run npx postdoc check.
  • Run npx postdoc build in a second terminal, and look at what it writes to out/.
  • Press Expand for room to work. Back to the page, Escape or the browser's back button brings you back.

What runs, and what doesn't

The container is a real Node.js, with npm and a shell, so postdoc init, postdoc check, postdoc run and postdoc build work as they do on your machine. Two things don't: postdoc test needs Chrome, and there's no browser inside a browser, so the project's Nightwatch dependencies are left out above; and Pagefind, which builds the search index, is a program of its own that can't run here, so the site is served without search.

To put a playground like this one in your own docs, for your own Node.js project, see Node.js playgrounds.

Edit this page on GitHub