For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Edit
HomeAPI Reference
HomeAPI Reference
  • Get started
    • Welcome
    • Edit your docs
    • Manage your docs
    • Use components
    • Developer guide
    • Support
  • Changelog
    • Changelog
Edit
LogoLogo
On this page
  • Project structure
  • Configure with docs.yml
  • Writing pages in MDX
  • Editing, previewing, and publishing
  • When you open a pull request
  • Going further
Get started

Developer guide

Work with the code directly for full control over your docs
||View as Markdown|
Was this page helpful?
Edit this page
Previous

Components

Next

Support

Built with

Fern Editor is the fastest way to make changes, but when you need full control you can work with the source files directly.

Project structure

Your docs project is organized like this:

docs.yml# Navigation, theme, and site settings
fern.config.json# Organization name and CLI version
openapi.yaml# Your API specification
docs
pages# Documentation pages in MDX
assets# Logos, favicon, and images
changelog# Changelog entries

For details on each file, see the project structure documentation.

Configure with docs.yml

docs.yml is the single file that controls your site’s look, feel, and structure — no custom code needed. Here’s what you can adjust:

Colors

Brand colors for light and dark modes

Typography

Fonts for headings and body text

Logo and favicon

Your brand logo and browser icon

Layout

Page width, sidebar, and tabs placement

Navigation

Sections, pages, tabs, and versioning

Navbar links

Links and buttons in your header

For the full reference, see the site-level settings documentation.

Writing pages in MDX

Pages are MDX files — Markdown with support for Fern components. Each page starts with frontmatter:

docs/pages/my-page.mdx
1---
2title: Page title
3subtitle: Optional subtitle
4slug: my-page
5---
6
7Your content here. Use **bold**, *italic*, `code`, and standard Markdown.
8
9## Headings create sections
10
11Add components like <Note>, <Card>, and <Tabs> alongside your Markdown.

After creating a page, add it to docs.yml to include it in your navigation.

Editing, previewing, and publishing

Clone the repository and open it in your editor of choice. Install the Fern CLI to preview changes locally as you work:

$npm install -g fern-api
$fern docs dev

This starts a local dev server with hot-reloading at http://localhost:3000. Edit MDX files, update docs.yml, and see changes instantly.

When you open a pull request

When you’re ready, push your changes and open a pull request. This repository has GitHub Actions workflows (in .github/workflows/) that take it from there — your docs are validated, a shareable preview link is posted as a comment on your PR, and once merged to main, your docs are published to production automatically.

WorkflowTriggerWhat it does
check.ymlPRs and pushes to mainRuns fern check to validate your API spec and docs configuration
preview-docs.ymlPull requestsGenerates a preview URL and posts it as a PR comment so reviewers can see changes before merging
publish-docs.ymlPush to mainPublishes your docs to production automatically

These workflows require a FERN_TOKEN repository secret. Generate one with fern token and add it in your repository’s Settings → Secrets and variables → Actions.

Going further

Custom CSS and JavaScript

Add custom styles and scripts to your site

Custom React components

Build interactive components for your docs

SEO and metadata

Configure page-level SEO with frontmatter

CLI reference

Full list of CLI commands and options