Quickstart

Start building beautiful documentation in under 5 minutes

Docs cascade

With Fern, you can build beautiful developer documentation that matches your brand. Fern supports writing pages (written in Markdown) and generating API Reference documentation (from an OpenAPI Specification).

In this guide, we’ll show you how to get started with Fern in under 5 minutes.

1

Initialize your fern folder

All the configurations for your docs live in the fern folder. Inside, you’ll find a docs.yml file that contains all the settings for your documentation.

Get started by cloning the starter template.

$git clone git@github.com:fern-api/docs-starter.git

Next, please update the template settings to use your organization.

Edit template settings

Please edit the details fern.config.json and docs.yml with your organization name.

1{
2 "organization": "{{YOUR_ORGANIZATION}}",
3 "version": "0.x.x"
4}

Finally, run fern generate --docs to generate your documentation.

If you prefer, you can use our CLI to create a new project. Install the CLI by running

$npm install -g fern-api

Then run

$fern init --docs

You will see a new fern folder in your project with the following structure:

$ fern
> ├─ docs.yml
> └─ fern.config.json

Finally, run fern generate --docs to generate your documentation.

2

Update your docs

We provide a white-glove migration service as part of our Enterprise plan. Interested? Request it here.

Add content with MDX files.

1---
2title: "Page Title"
3description: "Subtitle (optional)"
4---
5
6Hello world!
Supported Syntax

Fern supports GitHub flavored Markdown (GFM) within MDX files, no plugin required.

In order for the Markdown page to show up, you’ll need to reference them from your docs.yml file. You can reference the Markdown page within a section or as a standalone page.

1navigation:
2 - page: "Hello World"
3 path: "pages/hello-world.mdx"
4 - section: Overview
5 content:
6 - page: QuickStart
7 path: pages/hello-world.mdx

Add an API Reference by adding an OpenAPI Specification to your project.

$fern init --openapi /path/to/openapi.yml

This will create an openapi.yml file in your project. You can reference this file in your docs.yml file by adding an api block.

1navigation:
2 - api: "API Reference"

All of the branding for your docs can be configured in the docs.yml file.

For example, to set the logos, colors, and fonts for your docs, you can add the following to your docs.yml file:

docs.yml
1colors:
2 accentPrimary:
3 dark: "#f0c193"
4 light: "#af5f1b"
5
6logo:
7 dark: ./docs/assets/logo-dark.svg
8 light: ./docs/assets/logo-light.svg
9 height: 40
10 href: https://buildwithfern.com/
11
12favicon: ./docs/assets/favicon.png
3

Publish to production

Fern supports hosting your docs website on a custom domain or on a custom subpath (e.g. https://domain.com/docs).

Please reach out to the Fern team at support@buildwithfern.com to configure this.

Fern supports integrations with a variety of providers such as PostHog, Segment, Intercom, Google Tag Manager, etc. Find out more on this page.

Below are some examples of documentation websites that have been published using Fern:

Built with