Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fern/products/cli-api-reference/pages/docs-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ These commands build, preview, and publish a Fern documentation site, and valida
```
</CodeBlock>

For `git` inputs, the command sends the repository URL to Fern's servers for parsing. For `path` inputs, pass `--local` to parse the source on your machine instead.
By default, the command sends the repository URL of a `git` input to Fern's servers for parsing. Pass `--local` to parse the source on your machine instead.

### local

Use `--local` to parse library source locally rather than on Fern's servers. Required when the library uses a `path` input. Local generation does not require authentication.
Use `--local` to parse library source locally rather than on Fern's servers. Required when the library uses a `path` input, and supported for `git` inputs. Local generation does not require authentication.

```bash
fern docs md generate --local
Expand Down
30 changes: 15 additions & 15 deletions fern/products/docs/pages/api-references/library-docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Cross-links are automatic. When a fully qualified identifier appears in a code b

Add a `libraries` entry to your `docs.yml` file. Each library needs an `input` source, an `output.path` (where generated MDX files are written), and a `lang` (`python` or `cpp`).

The input source can be a `git` URL, parsed remotely on Fern's servers, or a local `path`, parsed on your machine with the `--local` flag. Local parsing is useful for iterating on documentation without pushing to a remote repository, and doesn't require you to be logged in to Fern.
The input source can be a `git` URL or a local `path`. A `git` input is parsed on Fern's servers by default, or on your machine with the `--local` flag. A `path` input requires `--local`.

A `git` input reads the repository's default branch. Set `ref` to a branch or tag to generate from source that hasn't merged yet.
A `git` input reads the repository's default branch. Set `ref` to a branch, tag, or commit SHA to generate from source that hasn't merged yet.

<Tabs>
<Tab title="git input (remote)">
<Tab title="git input">
```yaml docs.yml
libraries:
plant-core:
Expand All @@ -35,15 +35,15 @@ libraries:
doxyfile: ./Doxyfile # optional, C++ only
```
</Tab>
<Tab title="path input (local)">
<Tab title="path input">
```yaml docs.yml
libraries:
plant-core:
input:
path: ../plant-core-cpp # relative to fern/ directory
path: ../plant-core-cpp # local library source, relative to fern/ directory
output:
path: ./static/plant-core-docs
lang: cpp
path: ./static/plant-core-docs # relative to fern/ directory
lang: cpp # python or cpp
config:
doxyfile: ./Doxyfile # optional, C++ only
```
Expand Down Expand Up @@ -76,26 +76,26 @@ navigation:
Run the [`fern docs md generate`](/learn/cli-api-reference/cli-reference/docs-commands#fern-docs-md-generate) command to generate MDX files from your library source code:

<Tabs>
<Tab title="git input (remote)">
<Tab title="Remote parsing">
```bash
fern docs md generate
```

The command sends the repository URL to Fern's servers for parsing.
The command sends the repository URL to Fern's servers for parsing. Requires a `git` input.
</Tab>
<Tab title="path input (local)">
<Tab title="Local parsing">
```bash
fern docs md generate --local
```

The `--local` flag parses the source on your machine instead of on Fern's servers.
The `--local` flag parses the source on your machine instead of on Fern's servers, which is useful for iterating on documentation without pushing to a remote repository, and doesn't require you to be logged in to Fern. Both input types work: a `path` input is read in place, and a `git` input is checked out at its `ref` using your local git credential configuration.

<Warning>
Local parsing runs each parser inside a Docker container, so [Docker](https://docs.docker.com/get-docker/) must be running on your machine. Verify with `docker ps`.
</Warning>

<Note>
For C++ libraries, the parser uses your `path` directory as the source root. If your Doxyfile sets its input directive to subdirectories, the effective scope is your `path` combined with those Doxyfile input entries. Ensure the Doxyfile's input paths are relative to the root of your `path` directory.
For C++ libraries, the parser uses the source root — your `path` directory, or the repository root for a `git` input — as its scope. If your Doxyfile sets its input directive to subdirectories, the effective scope is the source root combined with those Doxyfile input entries. Ensure the Doxyfile's input paths are relative to the source root.
</Note>
</Tab>
</Tabs>
Expand Down Expand Up @@ -183,15 +183,15 @@ You can also edit page content by modifying the MDX files directly — generated
## Configuration reference

<ParamField path="input.git" type="string">
GitHub URL of the repository containing the library source code. Parsed remotely on Fern's servers. Mutually exclusive with `input.path`.
GitHub URL of the repository containing the library source code. Parsed on Fern's servers, or on your machine with `--local`. Mutually exclusive with `input.path`.
</ParamField>

<ParamField path="input.subpath" type="string">
Path within the repository to the library source. Only valid with `input.git`. Useful for monorepos.
</ParamField>

<ParamField path="input.ref" type="string">
Git ref to check out: a branch or tag. Only valid with `input.git`. Defaults to the repository's default branch.
Git ref to check out: a branch, tag, or commit SHA. Only valid with `input.git`. Defaults to the repository's default branch.
</ParamField>

<ParamField path="input.path" type="string">
Expand All @@ -207,5 +207,5 @@ You can also edit page content by modifying the MDX files directly — generated
</ParamField>

<ParamField path="config.doxyfile" type="string">
Path to a custom [Doxyfile](https://www.doxygen.nl/manual/config.html). C++ only. For local generation, the Doxyfile's input paths are resolved relative to the `input.path` directory.
Path to a custom [Doxyfile](https://www.doxygen.nl/manual/config.html). C++ only. For local generation, the Doxyfile's input paths are resolved relative to the source root: the `input.path` directory, or the repository root for a `git` input.
</ParamField>
7 changes: 7 additions & 0 deletions fern/products/docs/pages/changelog/2026-08-24.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Local library docs generation from git inputs

<ChangelogTags>api-reference, local-development</ChangelogTags>

You can now iterate on library docs locally from `git` inputs, not just `path` inputs. `fern docs md generate --local` reads the library source from the repository at the configured `ref` and parses it on your machine, so you can preview generated pages without publishing or logging in to Fern.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] <FernStyles.Hedges> reported by reviewdog 🐶
Avoid hedge words and filler like 'just'. Prefer direct statements.


<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/api-references/library-reference#configuration">Read the docs</Button>
Loading