Skip to content

Commit 78cd80e

Browse files
committed
cut down content, move into snippet
1 parent 9bcbf8a commit 78cd80e

File tree

5 files changed

+53
-120
lines changed

5 files changed

+53
-120
lines changed

.vale/styles/FernStyles/Headings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,4 @@ exceptions:
114114
- RBAC
115115
- YAML
116116
- fern.config.json
117+
- Font Awesome

fern/products/docs/pages/customization/what-is-docs-yml.mdx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,19 +267,15 @@ navbar-links:
267267
</ParamField>
268268

269269
<ParamField path="icon" type="string" required={false} toc={true}>
270-
The icon to be used in the button. This icon will appear to the **left** of the text content. Supports three formats:
270+
The icon to be used in the button. This icon will appear to the **left** of the text content.
271271

272-
- **Font Awesome icons**: Use icon names like `fa-solid fa-rocket`. Pro and Brand Icons from Font Awesome are supported.
273-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
274-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
272+
<Markdown src="/snippets/icons.mdx" />
275273
</ParamField>
276274

277275
<ParamField path="rightIcon" type="string" required={false} toc={true}>
278-
The icon to be used in the button. This icon will appear to the **right** of the text content. Supports three formats:
279-
280-
- **Font Awesome icons**: Use icon names like `fa-solid fa-arrow-right`. Pro and Brand Icons from Font Awesome are supported.
281-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
282-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
276+
The icon to be used in the button. This icon will appear to the **right** of the text content.
277+
278+
<Markdown src="/snippets/icons.mdx" />
283279

284280
By default, the `rightIcon` for a `filled` button is set to `arrow-right`.
285281
</ParamField>

fern/products/docs/pages/navigation/overview.mdx

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -199,62 +199,27 @@ navigation:
199199

200200
## Sidebar icons
201201

202-
Add icons next to sections and pages using the `icon` key. Icons support three formats:
202+
Add icons next to sections and pages using the `icon` key.
203203

204-
- **Font Awesome icons**: Use icon names like `fa-regular fa-home`. Pro and Brand Icons from Font Awesome are supported.
205-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the YAML file where the icon is declared.
206-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
207-
208-
### Font Awesome icons
204+
<Markdown src="/snippets/icons.mdx" />
209205

210206
{/* <!-- vale off --> */}
211-
```yaml Example navigation config with Font Awesome icons
207+
```yaml Example config with different icon files {3, 6, 9}
212208
navigation:
213209
- section: Home
214-
icon: fa-regular fa-home
210+
icon: fa-regular fa-home # Font Awesome icon
215211
contents:
216-
- page: My page
217-
icon: fa-regular fa-file
218-
path: ./pages/my-page.mdx
212+
- page: Introduction
213+
icon: ./assets/icons/intro-icon.svg # Custom image file
214+
path: ./pages/intro.mdx
215+
- page: Custom Features
216+
icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z'/></svg>" # Inline SVG
217+
path: ./pages/custom.mdx
219218
- api: API Reference
220219
icon: fa-regular fa-puzzle
221220
```
222221
{/* <!-- vale on --> */}
223222

224-
### Custom image files
225-
226-
To use custom image files as icons, upload your image files to your docs assets folder, then reference them using relative paths. Paths are resolved relative to the YAML file where the icon is declared.
227-
228-
{/* <!-- vale off --> */}
229-
```yaml Example navigation config with custom image icons
230-
navigation:
231-
- section: Products
232-
icon: ./assets/icons/products-icon.svg
233-
contents:
234-
- page: Product A
235-
icon: ./assets/icons/product-a.png
236-
path: ./pages/product-a.mdx
237-
- page: Product B
238-
icon: ./assets/icons/product-b.png
239-
path: ./pages/product-b.mdx
240-
```
241-
{/* <!-- vale on --> */}
242-
243-
### Inline SVG icons
244-
245-
You can also provide inline SVG strings directly in your configuration. Wrap the SVG in quotes to ensure proper YAML parsing.
246-
247-
{/* <!-- vale off --> */}
248-
```yaml Example navigation config with inline SVG icons
249-
navigation:
250-
- section: Custom Section
251-
icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z'/></svg>"
252-
contents:
253-
- page: Custom Page
254-
path: ./pages/custom-page.mdx
255-
```
256-
{/* <!-- vale on --> */}
257-
258223
## Links
259224

260225
You can add a link to an external page within your sidebar navigation with the following configuration:
@@ -277,11 +242,9 @@ navigation:
277242

278243
## Tabs
279244

280-
Within the navigation, you can add `tabs`. Tabs are used to group sections together. The example below shows tabs for `Help Center`, `API Reference`, and an external link to `Github`. Each tab has a `title` and `icon`. Icons support three formats:
245+
Within the navigation, you can add `tabs`. Tabs are used to group sections together. The example below shows tabs for `Help Center`, `API Reference`, and an external link to `Github`. Each tab has a `title` and `icon`.
281246

282-
- **Font Awesome icons**: Use icon names like `puzzle` or `fa-solid fa-puzzle`. [Browse the icons available](https://fontawesome.com/icons) from Font Awesome. Pro and Brand Icons are supported.
283-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the YAML file where the icon is declared.
284-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
247+
<Markdown src="/snippets/icons.mdx" />
285248

286249
<CodeBlock title="docs.yml">
287250
{/* <!-- vale off --> */}
@@ -290,13 +253,13 @@ Within the navigation, you can add `tabs`. Tabs are used to group sections toget
290253
tabs:
291254
api:
292255
display-name: API Reference
293-
icon: puzzle
256+
icon: puzzle # Font Awesome icon
294257
help:
295258
display-name: Help center
296-
icon: home
259+
icon: ./assets/icons/help-icon.svg # Custom image file
297260
github:
298261
display-name: GitHub
299-
icon: brands github
262+
icon: brands github # Font Awesome icon
300263
href: https://github.com/fern-api/fern
301264
302265
navigation:

fern/products/docs/pages/navigation/products.mdx

Lines changed: 28 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ navigation:
5757
```
5858
</CodeBlock>
5959
<CodeBlock title="products/product-b.yml">
60+
6061
```yaml
6162
tabs:
6263
api:
@@ -90,65 +91,33 @@ tabs:
9091
9192
To define a product, add an item to the `products` list in `docs.yml`, specifying the `display-name` and `path`.
9293

93-
The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`.
94-
95-
<Note>If you provide both an `image` and an `icon`, the `image` will take precedence.</Note>
96-
97-
### Product icons
98-
99-
Product icons support three formats:
100-
101-
- **Font Awesome icons**: Use icon names like `fa-solid fa-leaf`. Pro and Brand Icons from Font Awesome are supported.
102-
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
103-
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).
104-
105-
#### Font Awesome icons
106-
107-
<CodeBlock title="docs.yml">
108-
```yaml
109-
products:
110-
- display-name: Product A
111-
path: ./products/product-a.yml
112-
icon: fa-solid fa-leaf
113-
slug: product-a
114-
subtitle: Product A subtitle
115-
```
116-
</CodeBlock>
117-
118-
#### Custom image files
119-
120-
To use custom image files as product icons, upload your image files to your docs assets folder, then reference them using relative paths. Paths are resolved relative to the `docs.yml` file.
121-
122-
<CodeBlock title="docs.yml">
123-
```yaml
124-
products:
125-
- display-name: Product A
126-
path: ./products/product-a.yml
127-
icon: ./assets/icons/product-a-icon.svg
128-
slug: product-a
129-
subtitle: Product A subtitle
130-
- display-name: Product B
131-
path: ./products/product-b.yml
132-
icon: ./assets/icons/product-b-icon.png
133-
slug: product-b
134-
subtitle: Product B subtitle
135-
```
136-
</CodeBlock>
137-
138-
#### Inline SVG icons
139-
140-
Wrap the SVG in quotes to ensure proper YAML parsing.
141-
142-
<CodeBlock title="docs.yml">
143-
```yaml
144-
products:
145-
- display-name: Product A
146-
path: ./products/product-a.yml
147-
icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z'/></svg>"
148-
slug: product-a
149-
subtitle: Product A subtitle
150-
```
151-
</CodeBlock>
94+
The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`. If you provide both an `image` and an `icon`, the `image` will take precedence.
95+
96+
<Note title="Product icons">
97+
98+
<Markdown src="/snippets/icons.mdx" />
99+
100+
<CodeBlock title="docs.yml">
101+
```yaml maxLines=5
102+
products:
103+
- display-name: Product A
104+
path: ./products/product-a.yml
105+
icon: fa-solid fa-leaf # Font Awesome icon
106+
slug: product-a
107+
subtitle: Product A subtitle
108+
- display-name: Product B
109+
path: ./products/product-b.yml
110+
icon: ./assets/icons/product-b-icon.svg # Custom image file
111+
slug: product-b
112+
subtitle: Product B subtitle
113+
- display-name: Product C
114+
path: ./products/product-c.yml
115+
icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 2L2 7v10c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V7l-10-5z'/></svg>" # Inline SVG
116+
slug: product-c
117+
subtitle: Product C subtitle
118+
```
119+
</CodeBlock>
120+
</Note>
152121
</Step>
153122
<Step title="Remove extra navigation from docs.yml">
154123

fern/snippets/icons.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Icons support three formats:
2+
- **Font Awesome icons**: Use icon names like `fa-solid fa-rocket`. Pro and Brand Icons from Font Awesome are supported.
3+
- **Custom image files**: Use relative paths to image files (e.g., `./assets/icons/my-icon.svg` or `../assets/icons/my-icon.png`). Paths are relative to the `docs.yml` file.
4+
- **Inline SVG**: Provide an SVG string wrapped in quotes (e.g., `"<svg>...</svg>"`).

0 commit comments

Comments
 (0)