Skip to content

Commit e7b4172

Browse files
committed
clarify and expand multiple api reference example
1 parent f3535e1 commit e7b4172

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

fern/products/docs/pages/api-references/generate-api-ref.mdx

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,50 @@ navigation:
3535
More on customizing your API Reference [here](/learn/docs/api-references/customize-api-reference-layout).
3636

3737
### Include more than one API Reference
38+
3839
To include multiple, distinct API definitions in your documentation, you can indicate which to include using the `api-name` property. The `api-name` corresponds to the name of the folder where your API definition is housed.
3940

41+
For example, your file structure might look like this:
42+
43+
```bash
44+
fern/
45+
├─ fern.config.json
46+
├─ docs.yml
47+
├─ plant-api/
48+
│ └─ api.yml # API definition
49+
└─ garden-api/
50+
└─ api.yml # API definition
51+
```
52+
53+
For a simple setup without tabs, you can include multiple API references directly in your navigation:
54+
4055
```yaml title="docs.yml"
4156
navigation:
4257
- api: Plant Store
43-
api-name: plant-api
58+
api-name: plant-api # Matches folder name containing your API definition
4459
- api: Garden
45-
api-name: garden-api
60+
api-name: garden-api # Matches folder name containing your API definition
4661
```
4762

63+
When using tabs, each API reference must be placed within a tab's `layout`:
4864

65+
```yaml title="docs.yml" {12, 17}
66+
tabs:
67+
plant-api:
68+
display-name: Plant Store API
69+
icon: leaf
70+
garden-api:
71+
display-name: Garden API
72+
icon: tree
73+
navigation:
74+
- tab: plant-api # References the tab defined above
75+
layout:
76+
- api: Plant Store API
77+
api-name: plant-api # Matches folder name containing your API definition
78+
skip-slug: true
79+
- tab: garden-api # References the tab defined above
80+
layout:
81+
- api: Garden API
82+
api-name: garden-api # Matches folder name containing your API definition
83+
skip-slug: true
84+
```

0 commit comments

Comments
 (0)