Skip to content

Commit 41e54bc

Browse files
Sandeep DineshSandeep Dinesh
authored andcommitted
add code switcher and mermaid diagrams
1 parent 30c456a commit 41e54bc

2 files changed

Lines changed: 114 additions & 1 deletion

File tree

fern/docs/pages/complex/all-components.mdx

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,49 @@ function getUser(id: number): User {
8787
}
8888
```
8989

90+
### Code Groups
91+
<CodeGroup>
92+
<Code
93+
src="https://static.launchdarkly.com/app/s/ld/sdk-setup/react-native-client-sdk/install-yarn.txt"
94+
title="yarn"
95+
language="shell"
96+
for="yarn"
97+
/>
98+
<Code
99+
src="https://static.launchdarkly.com/app/s/ld/sdk-setup/react-native-client-sdk/install-npm.txt"
100+
title="npm"
101+
language="shell"
102+
for="npm"
103+
/>
104+
<Code
105+
src="https://static.launchdarkly.com/app/s/ld/sdk-setup/react-native-client-sdk/install-pnpm.txt"
106+
title="pnpm"
107+
language="shell"
108+
for="pnpm"
109+
/>
110+
</CodeGroup>
111+
112+
<CodeGroup>
113+
<Code
114+
src="https://static.launchdarkly.com/app/s/ld/sdk-setup/react-native-client-sdk/install-yarn-async-storage.txt"
115+
title="yarn"
116+
language="shell"
117+
for="yarn"
118+
/>
119+
<Code
120+
src="https://static.launchdarkly.com/app/s/ld/sdk-setup/react-native-client-sdk/install-npm-async-storage.txt"
121+
title="npm"
122+
language="shell"
123+
for="npm"
124+
/>
125+
<Code
126+
src="https://static.launchdarkly.com/app/s/ld/sdk-setup/react-native-client-sdk/install-pnpm-async-storage.txt"
127+
title="pnpm"
128+
language="shell"
129+
for="pnpm"
130+
/>
131+
</CodeGroup>
132+
90133
### Multiple Language Code Blocks
91134

92135
<CodeBlocks>
@@ -580,6 +623,76 @@ Content for the fifth accordion.
580623
</Tabs>
581624
</Accordion>
582625

626+
## Mermaid Diagrams
627+
628+
```mermaid
629+
graph TD;
630+
A-->B;
631+
A-->C;
632+
B-->D;
633+
C-->D;
634+
```
635+
636+
```mermaid
637+
sequenceDiagram
638+
autonumber
639+
participant Dev as Developer
640+
participant CLI as Fern CLI
641+
participant FDR as FDR Server
642+
participant S3 as AWS S3
643+
participant Redis as Redis Cache
644+
participant Vercel as Vercel (Next.js)
645+
participant KV as Vercel KV
646+
participant FAI as FAI Service
647+
participant Browser as End User Browser
648+
649+
rect
650+
note over Dev,CLI: Publishing Phase
651+
Dev->>CLI: fern docs publish
652+
CLI->>CLI: Parse docs.yml & markdown
653+
CLI->>CLI: Generate IR for APIs
654+
CLI->>FDR: startDocsRegister
655+
FDR->>S3: Get presigned upload URLs
656+
FDR-->>CLI: Upload URLs + registration ID
657+
CLI->>S3: Upload assets (images, files)
658+
CLI->>FDR: finishDocsRegister (docs definition)
659+
end
660+
661+
rect
662+
note over FDR,FAI: Storage & Caching Phase
663+
FDR->>FDR: Convert to DB format
664+
FDR->>FDR: Store in PostgreSQL
665+
FDR->>Redis: Cache docs definition (7-day TTL)
666+
FDR->>S3: Write LoadDocsForUrlResponse
667+
FDR->>Vercel: Trigger revalidation
668+
Vercel->>KV: Clear domain cache
669+
Vercel->>KV: Store new cache keys
670+
Vercel->>FAI: Trigger reindex for AI search
671+
end
672+
673+
rect
674+
note over Browser,FAI: Rendering Phase
675+
Browser->>Vercel: Request docs page
676+
Vercel->>KV: Check Vercel KV cache
677+
alt Cache Hit
678+
KV-->>Vercel: Return cached data
679+
else Cache Miss
680+
Vercel->>FDR: getDocsForUrl
681+
FDR->>Redis: Check Redis cache
682+
alt Redis Hit
683+
Redis-->>FDR: Return cached response
684+
else Redis Miss
685+
FDR->>FDR: Load from PostgreSQL
686+
FDR->>Redis: Cache response
687+
end
688+
FDR-->>Vercel: DocsDefinition
689+
Vercel->>KV: Cache for future requests
690+
end
691+
Vercel->>Vercel: Serialize MDX content
692+
Vercel-->>Browser: Rendered HTML
693+
end
694+
```
695+
583696
## End of Components Showcase
584697

585698
This page has demonstrated all available Fern documentation components including text formatting, code blocks, callouts, tabs, accordions, steps, cards, tables, and various nested combinations.

fern/fern.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"organization": "fern",
3-
"version": "2.1.0"
3+
"version": "2.4.0"
44
}

0 commit comments

Comments
 (0)