Skip to content

Commit 0281a58

Browse files
committed
standardize structure, make more readable, add colored frame for example
1 parent 3132015 commit 0281a58

26 files changed

+562
-607
lines changed

fern/assets/styles.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,3 +1107,24 @@ h1, h2, h3 {
11071107
.fern-sidebar-link[href$="changelog"] > svg {
11081108
display: none;
11091109
}
1110+
1111+
/*** START -- HIGHLIGHTED FRAME STYLING ***/
1112+
.highlight-frame {
1113+
background-color: var(--accent-a2);
1114+
border-radius: 0.75rem;
1115+
padding: 1.5rem;
1116+
margin: 1rem 0;
1117+
}
1118+
1119+
.highlight-frame > *:first-child {
1120+
margin-top: 0;
1121+
}
1122+
1123+
.highlight-frame > *:last-child {
1124+
margin-bottom: 0;
1125+
}
1126+
1127+
:is(.dark) .highlight-frame {
1128+
background-color: var(--accent-a3);
1129+
}
1130+
/*** END -- HIGHLIGHTED FRAME STYLING ***/

fern/docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ redirects:
304304
destination: /learn/docs/preview-publish/publishing-your-docs
305305

306306
# Building and Customizing Your Docs redirects - specific cases first
307+
- source: /learn/docs/writing-content/components/accordion-groups
308+
destination: /learn/docs/writing-content/components/accordions
309+
- source: /learn/docs/writing-content/components/card-groups
310+
destination: /learn/docs/writing-content/components/cards
307311
- source: /learn/docs/building-and-customizing-your-docs/navigation
308312
destination: /learn/docs/configuration/navigation
309313
- source: /learn/docs/navigation/overview

fern/products/docs/docs.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ navigation:
3838
- page: Accordions
3939
path: ./pages/component-library/default-components/accordions.mdx
4040
icon: fa-duotone fa-chevron-down
41-
- page: Accordion Groups
42-
path: ./pages/component-library/default-components/accordion-groups.mdx
43-
icon: fa-duotone fa-chevrons-down
4441
- page: Anchor
4542
path: ./pages/component-library/default-components/anchor.mdx
4643
icon: fa-duotone fa-link
@@ -59,9 +56,6 @@ navigation:
5956
- page: Cards
6057
path: ./pages/component-library/default-components/cards.mdx
6158
icon: fa-duotone fa-id-card
62-
- page: Card Groups
63-
path: ./pages/component-library/default-components/card-groups.mdx
64-
icon: fa-duotone fa-grid-2
6559
- page: Code Blocks
6660
path: ./pages/component-library/default-components/code-blocks.mdx
6761
icon: fa-duotone fa-code
@@ -80,9 +74,6 @@ navigation:
8074
path: ./pages/component-library/default-components/endpoint-schema-snippet.mdx
8175
icon: fa-duotone fa-sitemap
8276
slug: schema-snippet
83-
- page: Runnable Endpoint
84-
path: ./pages/component-library/default-components/runnable-endpoint.mdx
85-
icon: fa-duotone fa-play-circle
8677
- page: Frames
8778
path: ./pages/component-library/default-components/frames.mdx
8879
icon: fa-duotone fa-window-maximize
@@ -92,6 +83,9 @@ navigation:
9283
- page: Parameter Fields
9384
path: ./pages/component-library/default-components/parameter-fields.mdx
9485
icon: fa-duotone fa-list
86+
- page: Runnable Endpoint
87+
path: ./pages/component-library/default-components/runnable-endpoint.mdx
88+
icon: fa-duotone fa-play-circle
9589
- page: Steps
9690
path: ./pages/component-library/default-components/steps.mdx
9791
icon: fa-duotone fa-list-ol

fern/products/docs/pages/component-library/default-components/accordion-groups.mdx

Lines changed: 0 additions & 55 deletions
This file was deleted.

fern/products/docs/pages/component-library/default-components/accordions.mdx

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,81 @@
11
---
2-
title: 'Accordions'
3-
description: 'Expand or collapse to reveal more information'
2+
title: Accordions
3+
description: Display expandable/collapsible options with browser search functionality
44
---
55

6-
The Accordion component allows you to create expandable sections in your documentation. Content within accordions is searchable using browser search (cmd+f) even when collapsed. The component is optimized for SEO with server-side HTML generation, ensuring search engines can properly index all content within accordions.
6+
The Accordion component creates expandable sections with searchable, SEO-friendly content that remains accessible even when collapsed.
77

8-
<Accordion title='Single accordion'>
9-
This is an example of an accordion component. When clicked, it expands to reveal this additional content.
10-
</Accordion>
8+
<div className="highlight-frame">
9+
<AccordionGroup>
10+
<Accordion title="Section 1" defaultOpen={true}>
11+
Content for section 1, expanded by default
12+
</Accordion>
13+
<Accordion title="Section 2">
14+
Content for section 2
15+
</Accordion>
16+
</AccordionGroup>
17+
</div>
1118

1219
## Usage
1320

21+
You can have single Accordions, or multiple Accordions enclosed in an Accordion Group.
22+
23+
```jsx Markdown syntax
24+
<AccordionGroup>
25+
<Accordion title="Section 1" defaultOpen={true}>
26+
Content for section 1, expanded by default
27+
</Accordion>
28+
<Accordion title="Section 2">
29+
Content for section 2
30+
</Accordion>
31+
</AccordionGroup>
32+
```
33+
34+
## Variants
35+
36+
Within each Accordion, you can embed images, videos, and other components (Callouts, Code Blocks, etc) within accordions for rich interactive content.
37+
38+
### Multimedia
39+
40+
<Accordion title="Text content with multimedia">
41+
<Frame caption="Sample image">
42+
<img src="https://images.pexels.com/photos/1867601/pexels-photo-1867601.jpeg" alt="A sample image" />
43+
</Frame>
44+
</Accordion>
45+
1446
```jsx
15-
<Accordion title='Single accordion'>
16-
This is an example of an accordion component. When clicked, it expands to reveal this additional content.
47+
<Accordion title="Text content with multimedia">
48+
<Frame caption="Sample image">
49+
<img src="https://images.pexels.com/photos/1867601/pexels-photo-1867601.jpeg" alt="A sample image" />
50+
</Frame>
1751
</Accordion>
1852
```
1953

20-
## Variants
54+
### Nested components
55+
56+
<Accordion title="Nested components">
57+
<Note>
58+
Here's a callout nested in an Accordion
59+
</Note>
60+
</Accordion>
61+
62+
```jsx
63+
<Accordion title="Nested components">
64+
<Note>
65+
Here's a callout nested in an Accordion
66+
</Note>
67+
</Accordion>
68+
```
2169
2270
### Default open
2371
2472
<Accordion title='Accordion open by default' defaultOpen={true}>
25-
You can use the `defaultOpen` property to have specific accordions expanded by default when the page loads. This is useful for highlighting important information or frequently accessed content.
73+
Use the `defaultOpen` property to have specific accordions expanded by default when the page loads. This is useful for highlighting important information or frequently accessed content.
2674
</Accordion>
2775
2876
```jsx
2977
<Accordion title='Accordion open by default' defaultOpen={true}>
30-
You can use the `defaultOpen` property to have specific accordions expanded by default when the page loads. This is useful for highlighting important information or frequently accessed content.
78+
Use the `defaultOpen` property to have specific accordions expanded by default when the page loads. This is useful for highlighting important information or frequently accessed content.
3179
</Accordion>
3280
```
3381
@@ -45,4 +93,3 @@ The Accordion component allows you to create expandable sections in your documen
4593
Whether the accordion should be open when the page loads. If not specified, the accordion will be collapsed by default.
4694
</ParamField>
4795
48-

fern/products/docs/pages/component-library/default-components/anchor.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ title: Anchor
33
description: Create linkable anchors for paragraphs, tables, and other content without headings
44
---
55

6-
Use the `<Anchor>` component to create links to specific paragraphs, tables, and other sections of content that don't have headings. Wrap your content with the `<Anchor>` tag and assign it a custom anchor ID, which you can link to in URLs using the hash symbol (example: `https://website.com/page#data`).
6+
The Anchor component creates links to specific paragraphs, tables, and other sections of content that don't have headings.
77

88
<Note>
99
Headings automatically generate anchor links based on their text content, so you don't need to use the `<Anchor>` component for headings.
1010
</Note>
1111

12-
<Anchor id="data">This sentence has a custom anchor</Anchor>
13-
14-
You can link to it using `#data` in the URL.
15-
1612
## Usage
1713

18-
```jsx
19-
<Anchor id="data">This sentence has a custom anchor</Anchor>
14+
Wrap your content with the `<Anchor>` tag and assign it a custom anchor ID, which you can link to in URLs using the hash symbol (example: `https://website.com/page#data`).
15+
16+
<div className="highlight-frame">
17+
<Anchor id="data">This sentence has a custom anchor named `#data`</Anchor>. You can access it via this URL: https://buildwithfern.com/learn/docs/writing-content/components/anchor#data.
18+
</div>
2019

21-
You can link to it using `#data` in the URL.
20+
```jsx Markdown syntax
21+
<Anchor id="data">This sentence has a custom anchor named `#data`</Anchor>. You can access it via this URL: https://buildwithfern.com/learn/docs/writing-content/components/anchor#data.
2222
```
2323

2424
## Variants

fern/products/docs/pages/component-library/default-components/aside.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Aside component creates a sticky container that floats content to the right
1111

1212
## Usage
1313

14-
```jsx
14+
```jsx Markdown syntax
1515
<Aside>
1616
<EndpointRequestSnippet endpoint='POST /chat/{domain}' />
1717
</Aside>

0 commit comments

Comments
 (0)