Getting Started

Project Structure

This page provides an overview of the file and folder structure of a Fern Docs project. The following structure is recommended for organizing your documentation content, but is customizable to fit your needs.

Top-level Folders

fern/
$ fern
> ├─ pages
> ├─ assets
> ├─ docs.yml
> ├─ openapi
> └─ fern.config.json

A Fern Docs project has the following top-level folders:

  • pages: Contains the Markdown (MDX) files that make up your documentation.
  • assets: Contains any images or videos used in your documentation.
  • docs.yml: The configuration file that defines the navigation, theme, and hosting details of your documentation.
  • openapi: Contains the OpenAPI specification file (if you have an API Reference section in your documentation).
  • fern.config.json: The configuration file specifying your organization name and CLI version.

Pages Folder

The pages folder contains the Markdown (MDX) files that make up your documentation. Each MDX file represents a page in your documentation.

fern/pages
$ pages
> ├─ introduction
> │ ├─ quickstart.mdx
> │ ├─ project-structure.mdx
> │ └─ showcase.mdx
> ├─ building-your-docs
> │ ├─ navigation
> │ ├─ sections.mdx
> │ ├─ tabs.mdx
> │ └─ versions.mdx
> └─ └─ configuration.mdx

The pages folder is organized into subfolders based on the sections of your documentation. Each subfolder contains the MDX files for the pages in that section.

Assets Folder

The assets folder contains any images or videos used in your documentation. You can reference these assets in your MDX files using relative paths.

fern/assets
$ assets
> ├─ favicon.ico
> ├─ product-screenshot.svg
> ├─ demo-video.mp4
> ├─ logo-dark-mode.png
> └─ logo-light-mode.png

docs.yml

The docs.yml file is the configuration file that defines the navigation, theme, and hosting details of your documentation. You can customize the appearance and behavior of your documentation by editing this file.

fern/docs.yml of this website
1instances:
2 - url: fern.docs.buildwithfern.com/learn
3 custom-domain: buildwithfern.com/learn
4
5navigation:
6 - section: Introduction
7 layout:
8 - page: QuickStart
9 path: pages/introduction/quickstart.mdx
10 - page: Project Structure
11 path: pages/introduction/project-structure.mdx
12 - page: Showcase
13 path: pages/introduction/showcase.mdx
14
15navbar-links:
16 - type: filled
17 text: Book a demo
18 url: https://buildwithfern.com/contact
19
20logo:
21 light: ./images/logo-green.png
22 dark: ./images/logo-white.png
23
24colors:
25 accentPrimary:
26 dark: "#ADFF8C"
27 light: "#209d63"
28
29favicon: ./images/favicon.ico
30
31title: Fern's Documentation

API Definitions

fern.config.json

The fern.config.json file specifies your organization name and the version of the Fern CLI used to generate the documentation. You can customize this file to reflect your organization’s details.

fern/fern.config.json
1{
2 "organization": "my-organization",
3 "version": "0.24.0"
4}