Skip to content
Docent Docs

Writing Docs

Markdown for tools

Let browsers keep the help center while other tools read clean, permission-aware Markdown.

Docent is built for people reading application guides and help docs. It also serves the same pages as plain Markdown, which makes the help center easier for search tools, assistants, and other automated readers to use. Nothing new is added to the reader interface.

Available URLs

Add .md to a page URL to get a clean Markdown response:

text
/docs/getting-started/installation.md

A client can also request text/markdown from the normal page URL. Docent publishes two indexes alongside the site:

  • /docs/llms.txt lists pages in navigation order.

  • /docs/llms-full.txt combines the pages into one Markdown document.

When the help center has top-level sections, llms.txt uses the same section headings and llms-full.txt follows the same order. Persistent sidebar links aren't included; the feeds remain a map of help content, not utility navigation.

HTML pages advertise both indexes in their Link response header. If you want the conventional root URL too, redirect /llms.txt to Docent's prefixed URL in your application routes:

php
Route::redirect('/llms.txt', '/docs/llms.txt');

Every site publishes its own pair of feeds under its own prefix, so a multi-site install has /help/llms.txt next to /admin/docs/llms.txt, each covering only that site's corpus. Point the root redirect at whichever site should own the conventional URL.

The same visibility rules apply

These are alternate representations of the help center, not a second copy of it. Page permissions, audiences, and conditional blocks are evaluated before Markdown is returned. Includes are expanded, internal links become absolute, and dynamic values are shown as labeled placeholders instead of account data.

Pages marked hidden: true still have a direct .md URL but stay out of llms.txt, just as they stay out of navigation. Pages marked search.exclude: true stay out of llms-full.txt, which keeps the full-corpus feed aligned with the site's harvesting rules.

Agents that write docs

The feeds above serve agents that read your help center. When a coding agent writes it — documenting a new feature inside the same pull request that builds it — give the agent one command:

bash
php artisan docent:guide

It prints a compact reference for the authoring dialect (front matter, directives, dynamic tokens) followed by an inventory of your application: every site with its content directory, and the values, links, conditions, audiences, and components registered in your code, each with its label. That inventory is the part no generic documentation can supply; it's what stops an agent from inventing a {{ value:plan }} your app never registered.

docent:install already wired this up: it writes a short Docent pointer into your project's AGENTS.md (or CLAUDE.md), so a coding agent opening the repo learns to run docent:guide before writing docs and docent:check after. The block is marked with comments and rewritten in place on re-install, so it stays current without ever duplicating or clobbering the rest of the file.

The write-then-check loop is the point: docent:check catches broken links, unknown integration names, missing includes, and malformed front matter, so the agent can fix its own work before you review the PR. Add --format=json for diagnostics the agent parses directly. The same authoring reference also ships in the package at vendor/stechstudio/laravel-docent/resources/guides/authoring.md, matched to your installed version and readable offline.