You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/api-references/library-docs.mdx
+16-15Lines changed: 16 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Cross-links are automatic. When a fully qualified identifier appears in a code b
15
15
16
16
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`).
17
17
18
-
The input source can be a `git` URL (parsed remotely on Fern's servers) or a local `path` (parsed locally with the [`--local` flag](#local-generation)).
18
+
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.
19
19
20
20
<Tabs>
21
21
<Tabtitle="git input (remote)">
@@ -72,22 +72,33 @@ navigation:
72
72
73
73
Run the [`fern docs md generate`](/learn/cli-api-reference/cli-reference/commands#fern-docs-md-generate) command to generate MDX files from your library source code:
74
74
75
+
<Tabs>
76
+
<Tab title="git input (remote)">
75
77
```bash
76
78
fern docs md generate
77
79
```
78
80
79
-
For `git` inputs, the command sends the repository URL to Fern's servers for parsing. For `path` inputs, pass `--local` to parse the source locally:
80
-
81
+
The command sends the repository URL to Fern's servers for parsing.
82
+
</Tab>
83
+
<Tab title="path input (local)">
81
84
```bash
82
85
fern docs md generate --local
83
86
```
84
87
85
-
Local generation doesn't require authentication.
88
+
The `--local` flag parses the source on your machine instead of on Fern's servers.
89
+
90
+
<Note>
91
+
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.
92
+
</Note>
93
+
</Tab>
94
+
</Tabs>
86
95
87
96
<Tip>
88
97
If you have multiple libraries configured, `fern docs md generate` processes all libraries in parallel. Use `--library plant-sdk` to generate docs for a specific library only.
89
98
</Tip>
90
99
100
+
The generated docs form a navigation section with pages for each module, class, function, and type in your library.
101
+
91
102
</Step>
92
103
<Step title="Preview locally">
93
104
@@ -97,14 +108,12 @@ Run the local development server to see your library docs alongside the rest of
97
108
fern docs dev
98
109
```
99
110
100
-
You can also generate a preview URL to share with your team:
111
+
You can also generate a shareable preview URL:
101
112
102
113
```bash
103
114
fern generate --docs --preview
104
115
```
105
116
106
-
The library docs appear as a navigation section with pages for each module, class, function, and type in your library.
107
-
108
117
</Step>
109
118
<Step title="Publish">
110
119
@@ -164,14 +173,6 @@ For example, splitting `./static/plant-sdk-docs` into `getting-started/` and `re
164
173
165
174
You can also edit page content by modifying the MDX files directly — generated pages are [standard MDX](/learn/docs/writing-content/markdown-basics), so you can add prose, examples, callouts, or any [component](/learn/docs/writing-content/components/overview). Re-running `fern docs md generate` overwrites everything in `output.path`, so commit your customizations first, and keep hand-edited pages outside the output directory if you plan to regenerate.
166
175
167
-
## Local generation
168
-
169
-
The `--local` flag parses library source locally instead of on Fern's servers. This is useful for iterating on documentation without pushing to a remote repository.
170
-
171
-
<Note>
172
-
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.
0 commit comments