Valkyrian Labs

Installation

Install payload-markdown-docs and register the Payload plugin.

Installation

Install the docs workflow package together with its peer packages:

1pnpm add payload-markdown-docs payload-markdown @payloadcms/plugin-seo

payload-markdown (Markdown field and renderer) and @payloadcms/plugin-seo (docs-set SEO fields) are peer dependencies: the plugin registers admin components from both packages in your app's import map, so your app must install them directly. Installing them yourself also keeps a single copy of payload-markdown, so the payloadMarkdown() options you configure (themes, code highlighting, icons) apply to docs pages too. Register payloadMarkdown() in the same Payload config as payloadMarkdownDocs(). payload, next, react and react-dom are peers as well and are already part of every Payload app.

Package Names

Both packages are published under two names, built once and released together:

Package Preferred Also published as
This plugin payload-markdown-docs @valkyrianlabs/payload-markdown-docs
Markdown field and renderer payload-markdown @valkyrianlabs/payload-markdown

Install one name of each (any combination works) and import from the names you installed (payload-markdown-docs/next, @valkyrianlabs/payload-markdown-docs/next, and so on). Both payload-markdown names are optional peer dependencies, so install the one you use yourself. The plugin finds it on its own: the docs content field uses the admin component of the installed payload-markdown (taken from the components payloadMarkdown() registers, so list payloadMarkdown() first, or from node_modules), and docs pages render with it. Set payloadMarkdownPackage in payloadMarkdownDocs() to choose explicitly.

With webpack builds (next build --webpack), Next prints one "Module not found" warning for the payload-markdown name you did not install. It is harmless: the plugin tries the preferred name first and falls back to the other. Turbopack builds print nothing.

Switching names in an existing app: replace the dependency and the imports, update the Tailwind @source paths, and run payload generate:importmap.

Styling

Docs pages and components use Tailwind utility classes from both packages. With Tailwind v4, add both packages to your app stylesheet's sources:

1@import "tailwindcss";2@plugin "@tailwindcss/typography";3@source "../node_modules/payload-markdown/dist";4@source "../node_modules/payload-markdown-docs/dist";

Adjust the relative paths to where your stylesheet lives. The components expect --color-foreground, --color-border and --color-background theme tokens (shadcn-style text-foreground, border-border, bg-background).

payload-markdown-docs uses payload-markdown for Markdown fields and rendering. It does not duplicate the renderer.

The npm package installs the Payload plugin/runtime integration only. Install the native pmdocs CLI separately anywhere you validate, plan, install routes, generate keys, or publish docs. This keeps docs-only repos and CI jobs from needing a Node dependency install just to run operator commands.

Native CLI

Debian/Ubuntu:

1sudo install -d -m 0755 /etc/apt/keyrings2sudo curl -fsSL https://apt.valkyrianlabs.com/pubkey.gpg \3  -o /etc/apt/keyrings/valkyrianlabs.gpg4sudo chmod 0644 /etc/apt/keyrings/valkyrianlabs.gpg5 6echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/valkyrianlabs.gpg] https://apt.valkyrianlabs.com stable main" | \7  sudo tee /etc/apt/sources.list.d/valkyrianlabs.list > /dev/null8 9sudo apt-get update10sudo apt-get install -y pmdocs11 12pmdocs --version13pmdocs --help

Homebrew:

1brew install valkyrianlabs/tap/pmdocs2 3pmdocs --version4pmdocs --help

Use the full name valkyrianlabs/tap/pmdocs. Homebrew taps valkyrianlabs/tap if needed and trusts only the pmdocs formula, so there is no separate brew tap or brew trust step. Afterwards brew upgrade (or brew upgrade pmdocs) keeps it current.

Installed it earlier with brew tap valkyrianlabs/tap and brew install pmdocs? Current Homebrew refuses to load formulae from a tap you have not trusted, so brew upgrade skips pmdocs. Run brew upgrade valkyrianlabs/tap/pmdocs once; the full name trusts it from then on.

Minimal Plugin Registration

1import { payloadMarkdownDocs } from 'payload-markdown-docs'2import { buildConfig } from 'payload'3 4export default buildConfig({5  plugins: [6    payloadMarkdownDocs({7      enabled: true,8    }),9  ],10})

An enabled plugin registers the default docs infrastructure:

  • docs-sets
  • docs-groups
  • docs-access
  • docs
  • docs-sync-runs
  • docs-sync-nonces
1payloadMarkdownDocs({2  auth: {3    githubOidc: true,4  },5 6  target: {7    enableDrafts: true,8  },9 10  sync: {11    allowWrites: true,12    allowPublish: true,13    allowHardDelete: false,14    deleteBehavior: 'archive',15  },16})

Create a docs set in Payload Admin for each docs package. The docs set slug is the sync source. Routes are derived from the optional group and slug. GitHub OIDC trust records and Ed25519 keys live in Docs Globals > Access.

Writes are opt-in

mode: "sync" requests are rejected unless the server has sync.allowWrites: true. Publish requests are rejected unless sync.allowPublish: true and drafts are enabled for the dedicated docs collection.

Next, create keys with keygen, then follow the quick start.