Skip to content

Commit 2e2d03e

Browse files
Update file structure displays to use Files component
- Convert bash code blocks with tree characters to Files components - Update 37 files across documentation - Move inline comments to adjacent descriptive text - Use defaultOpen for immediate folder visibility Co-Authored-By: Devin Logan <[email protected]>
1 parent 473271d commit 2e2d03e

File tree

37 files changed

+995
-706
lines changed

37 files changed

+995
-706
lines changed

fern/products/api-def/asyncapi-pages/overview.mdx

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ fern/
126126
<Step title="Add your AsyncAPI specification">
127127
Add your AsyncAPI spec to the fern directory. You can place it in a subfolder called `asyncapi` or directly in the fern directory.
128128
129-
```
130-
fern/
131-
└─ asyncapi/
132-
└─ asyncapi.yml
133-
```
129+
<Files>
130+
<Folder name="fern" defaultOpen>
131+
<Folder name="asyncapi" defaultOpen>
132+
<File name="asyncapi.yml" />
133+
</Folder>
134+
</Folder>
135+
</Files>
134136
</Step>
135137
<Step title="Create a `fern.config.json` file">
136138
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:
@@ -142,12 +144,14 @@ Add a `fern.config.json` file in your fern directory that lists your organizatio
142144
}
143145
```
144146

145-
```
146-
fern/
147-
├─ fern.config.json
148-
└─ asyncapi/
149-
└─ asyncapi.yml
150-
```
147+
<Files>
148+
<Folder name="fern" defaultOpen>
149+
<File name="fern.config.json" />
150+
<Folder name="asyncapi" defaultOpen>
151+
<File name="asyncapi.yml" />
152+
</Folder>
153+
</Folder>
154+
</Files>
151155
</Step>
152156
<Step title="Create a `generators.yml` file">
153157
Create a `generators.yml` file in your fern directory and add a reference to your AsyncAPI spec:
@@ -166,12 +170,14 @@ groups:
166170

167171
Your final directory structure:
168172

169-
```
170-
fern/
171-
├─ fern.config.json
172-
├─ generators.yml
173-
└─ asyncapi/
174-
└─ asyncapi.yml
175-
```
173+
<Files>
174+
<Folder name="fern" defaultOpen>
175+
<File name="fern.config.json" />
176+
<File name="generators.yml" />
177+
<Folder name="asyncapi" defaultOpen>
178+
<File name="asyncapi.yml" />
179+
</Folder>
180+
</Folder>
181+
</Files>
176182
</Step>
177183
</Steps>

fern/products/api-def/ferndef-pages/api-yml/overview.mdx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ description: The api.yml file contains general API configuration when using the
55

66
A `fern/` folder has a special file called `api.yml`, which includes all the API-wide configuration.
77

8-
```bash {5}
9-
fern/
10-
├─ fern.config.json
11-
├─ generators.yml
12-
└─ definition/
13-
├─ api.yml
14-
├─ pet.yml
15-
├─ store.yml
16-
└─ user.yml
17-
```
8+
<Files>
9+
<Folder name="fern" defaultOpen>
10+
<File name="fern.config.json" />
11+
<File name="generators.yml" />
12+
<Folder name="definition" defaultOpen>
13+
<File name="api.yml" />
14+
<File name="pet.yml" />
15+
<File name="store.yml" />
16+
<File name="user.yml" />
17+
</Folder>
18+
</Folder>
19+
</Files>
1820

1921
## API name
2022

@@ -54,4 +56,4 @@ version:
5456
- "2.0.0"
5557
- "latest"
5658
```
57-
</CodeBlock>
59+
</CodeBlock>

fern/products/api-def/ferndef-pages/auth.mdx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@ subtitle: Model auth schemes such as bearer, basic, custom headers, and oauth.
55

66
Configuring authentication schemes happens in the `api.yml` file. All Fern-generated SDKs support both direct configuration and environment variables for authentication credentials.
77

8-
```bash {5}
9-
fern/
10-
├─ fern.config.json # root-level configuration
11-
├─ generators.yml # generators you're using
12-
└─ definition/
13-
├─ api.yml # API-level configuration
14-
└─ imdb.yml # endpoints, types, and errors
15-
```
8+
<Files>
9+
<Folder name="fern" defaultOpen>
10+
<File name="fern.config.json" />
11+
<File name="generators.yml" />
12+
<Folder name="definition" defaultOpen>
13+
<File name="api.yml" />
14+
<File name="imdb.yml" />
15+
</Folder>
16+
</Folder>
17+
</Files>
18+
19+
Key files:
20+
- **fern.config.json**: Root-level configuration
21+
- **generators.yml**: Generators you're using
22+
- **api.yml**: API-level configuration
23+
- **imdb.yml**: Endpoints, types, and errors
1624

1725
To add an authentication scheme, specify the authentication method under the `auth-schemes` section.
1826

@@ -262,4 +270,4 @@ auth-schemes:
262270
token-prefix: Fern-Bearer
263271
get-token:
264272
...
265-
```
273+
```

fern/products/api-def/ferndef-pages/depending-on-other-apis.mdx

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ $ fern register
2626
To add a dependency on another API, you must add a `dependencies.yml` to declare which
2727
APIs you wish to depend on.
2828

29-
```bash {4}
30-
fern/
31-
├─ fern.config.json
32-
├─ generators.yml
33-
├─ dependencies.yml
34-
└─ definition/
35-
├─ api.yml
36-
├─ imdb.yml
37-
```
29+
<Files>
30+
<Folder name="fern" defaultOpen>
31+
<File name="fern.config.json" />
32+
<File name="generators.yml" />
33+
<File name="dependencies.yml" />
34+
<Folder name="definition" defaultOpen>
35+
<File name="api.yml" />
36+
<File name="imdb.yml" />
37+
</Folder>
38+
</Folder>
39+
</Files>
3840

3941
Your `dependencies.yml` has a list of all the APIs you wish to depend:
4042

@@ -46,17 +48,20 @@ dependencies:
4648
Next, you need create a folder in your Fern Definition to house the dependency. Inside the folder, create a special file
4749
`__package__.yml` which specifies the dependency and version you want to add.
4850

49-
```bash {8-9}
50-
fern/
51-
├─ fern.config.json
52-
├─ generators.yml
53-
├─ dependencies.yml
54-
└─ definition/
55-
├─ api.yml
56-
├─ imdb.yml
57-
└─ my-folder
58-
└─ __package__.yml
59-
```
51+
<Files>
52+
<Folder name="fern" defaultOpen>
53+
<File name="fern.config.json" />
54+
<File name="generators.yml" />
55+
<File name="dependencies.yml" />
56+
<Folder name="definition" defaultOpen>
57+
<File name="api.yml" />
58+
<File name="imdb.yml" />
59+
<Folder name="my-folder" defaultOpen>
60+
<File name="__package__.yml" />
61+
</Folder>
62+
</Folder>
63+
</Folder>
64+
</Files>
6065

6166
```yaml __package__.yml
6267
export:

fern/products/api-def/ferndef-pages/overview.mdx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,22 @@ fern init
2121

2222
This will create the following folder structure in your project:
2323

24-
```bash
25-
fern/
26-
├─ fern.config.json # root-level configuration
27-
├─ generators.yml # generators you're using
28-
└─ definition/
29-
├─ api.yml # API-level configuration
30-
└─ imdb.yml # endpoints, types, and errors
31-
```
24+
<Files>
25+
<Folder name="fern" defaultOpen>
26+
<File name="fern.config.json" />
27+
<File name="generators.yml" />
28+
<Folder name="definition" defaultOpen>
29+
<File name="api.yml" />
30+
<File name="imdb.yml" />
31+
</Folder>
32+
</Folder>
33+
</Files>
34+
35+
Key files:
36+
- **fern.config.json**: Root-level configuration
37+
- **generators.yml**: Generators you're using
38+
- **api.yml**: API-level configuration
39+
- **imdb.yml**: Endpoints, types, and errors
3240

3341
## Definition file
3442

fern/products/api-def/ferndef-pages/packages.mdx

Lines changed: 68 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@ description: Fern Definition enables the reuse of API type and error names acros
77

88
Every folder in your API definition is a package.
99

10-
<CodeBlock title='Example of package and nested package'>
11-
```bash
12-
fern/
13-
├─ fern.config.json
14-
├─ generators.yml
15-
└─ definition/ # <--- root package
16-
├─ api.yml
17-
├─ projects.yml
18-
└─ roles/ # <--- nested package
19-
└─ admin.yml
20-
```
21-
</CodeBlock>
10+
<Files>
11+
<Folder name="fern" defaultOpen>
12+
<File name="fern.config.json" />
13+
<File name="generators.yml" />
14+
<Folder name="definition" defaultOpen>
15+
<File name="api.yml" />
16+
<File name="projects.yml" />
17+
<Folder name="roles" defaultOpen>
18+
<File name="admin.yml" />
19+
</Folder>
20+
</Folder>
21+
</Folder>
22+
</Files>
23+
24+
Note: The `definition` folder is the root package, and `roles` is a nested package.
2225

2326
The generated SDK will match the hierarchy of your API definition.
2427

@@ -54,16 +57,16 @@ client.getProjects();
5457

5558
would have a `fern/` folder:
5659

57-
<CodeBlock title='fern/'>
58-
```bash {5}
59-
fern/
60-
├─ fern.config.json
61-
├─ generators.yml
62-
└─ definition/
63-
├─ __package__.yml
64-
└─ roles.yml
65-
```
66-
</CodeBlock>
60+
<Files>
61+
<Folder name="fern" defaultOpen>
62+
<File name="fern.config.json" />
63+
<File name="generators.yml" />
64+
<Folder name="definition" defaultOpen>
65+
<File name="__package__.yml" />
66+
<File name="roles.yml" />
67+
</Folder>
68+
</Folder>
69+
</Files>
6770

6871
that contains the following `__package__.yml`:
6972

@@ -91,20 +94,25 @@ to a new package and start making changes. If the new API version reuses
9194
certain types or errors, that's okay because the two APIs live in different
9295
packages.
9396
94-
<CodeBlock title="Versioning example">
95-
```bash
96-
fern/
97-
├─ fern.config.json
98-
├─ generators.yml
99-
└─ definition/
100-
├─ api.yml
101-
└─ roles/
102-
└─ v1/
103-
└─ admin.yml # type names can overlap with v2/admin.yml
104-
└─ v2/
105-
└─ admin.yml
106-
```
107-
</CodeBlock>
97+
<Files>
98+
<Folder name="fern" defaultOpen>
99+
<File name="fern.config.json" />
100+
<File name="generators.yml" />
101+
<Folder name="definition" defaultOpen>
102+
<File name="api.yml" />
103+
<Folder name="roles" defaultOpen>
104+
<Folder name="v1">
105+
<File name="admin.yml" />
106+
</Folder>
107+
<Folder name="v2">
108+
<File name="admin.yml" />
109+
</Folder>
110+
</Folder>
111+
</Folder>
112+
</Folder>
113+
</Files>
114+
115+
Note: Type names can overlap between v1/admin.yml and v2/admin.yml because they're in different packages.
108116
109117
## Navigation
110118
@@ -114,34 +122,34 @@ of your documentation.
114122

115123
For example, let's say you have the following `fern/` folder:
116124

117-
<CodeBlock title='fern/'>
118-
```bash
119-
fern/
120-
├─ fern.config.json
121-
├─ generators.yml
122-
└─ definition/
123-
├─ projects.yml
124-
├─ roles.yml
125-
└─ users.yml
126-
```
127-
</CodeBlock>
125+
<Files>
126+
<Folder name="fern" defaultOpen>
127+
<File name="fern.config.json" />
128+
<File name="generators.yml" />
129+
<Folder name="definition" defaultOpen>
130+
<File name="projects.yml" />
131+
<File name="roles.yml" />
132+
<File name="users.yml" />
133+
</Folder>
134+
</Folder>
135+
</Files>
128136

129137
Your API will be sorted alphabetically: projects, roles, then users. If you
130138
want to control the navigation, you can add a `__package__.yml` file
131139
and configure the order:
132140

133-
<CodeBlock title='fern/'>
134-
```bash
135-
fern/
136-
├─ fern.config.json
137-
├─ generators.yml
138-
└─ definition/
139-
├─ __package__.yml # <--- New File
140-
├─ projects.yml
141-
├─ roles.yml
142-
└─ users.yml
143-
```
144-
</CodeBlock>
141+
<Files>
142+
<Folder name="fern" defaultOpen>
143+
<File name="fern.config.json" />
144+
<File name="generators.yml" />
145+
<Folder name="definition" defaultOpen>
146+
<File name="__package__.yml" />
147+
<File name="projects.yml" />
148+
<File name="roles.yml" />
149+
<File name="users.yml" />
150+
</Folder>
151+
</Folder>
152+
</Files>
145153

146154
<CodeBlock title='__package__.yml'>
147155
```yaml
@@ -150,4 +158,4 @@ navigation:
150158
- roles.yml
151159
- projects.yml
152160
```
153-
</CodeBlock>
161+
</CodeBlock>

0 commit comments

Comments
 (0)