Skip to content

Commit b3a3ffd

Browse files
feat(docs): add copy button & breadcrumbs (#761)
## Description This PR: - adds `copy button` to docs so user can copy reference docs in gpt or claude - adds breadcrumbs for easier navigation - bumps version of plugin for `llms.txt` and updates it's config (`.md` files are now enabled and only actual content is included in `llms.txt`) ### Introduces a breaking change? - [ ] Yes - [x] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [x] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions - `yarn` - `yarn build` - `yarn serve` Check: - `llms.txt` - check if `Copy page` button works - check if breadcrumbs work ### Screenshots <img width="1728" height="441" alt="Screenshot 2026-01-27 at 10 42 46" src="https://github.com/user-attachments/assets/7509fed8-c462-4293-b2c5-e7aaf5403891" /> <img width="638" height="910" alt="Screenshot 2026-01-27 at 10 42 58" src="https://github.com/user-attachments/assets/6604f302-99a1-4655-860e-e9ed87eaf941" /> <img width="1711" height="677" alt="Screenshot 2026-01-27 at 10 44 20" src="https://github.com/user-attachments/assets/f4a6dae9-1f3d-4a1b-a294-9c1e59de399d" /> <img width="1728" height="656" alt="Screenshot 2026-01-27 at 10 45 03" src="https://github.com/user-attachments/assets/846185f9-3d59-48de-99a6-71abac3c9f42" /> ### Related issues #749 ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes **NOTE:** we should update algolia crawler config to exluded routes with `.md`
1 parent 6f8f085 commit b3a3ffd

5 files changed

Lines changed: 95 additions & 23 deletions

File tree

docs/docusaurus.config.js

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const config = {
2626
/** @type {import('@docusaurus/preset-classic').Options} */
2727
({
2828
docs: {
29-
breadcrumbs: false,
29+
breadcrumbs: true,
3030
sidebarPath: require.resolve('./sidebars.js'),
3131
sidebarCollapsible: false,
3232
editUrl:
@@ -124,27 +124,60 @@ const config = {
124124
plugins: [
125125
[
126126
'@signalwire/docusaurus-plugin-llms-txt',
127-
/** @type {import('@signalwire/docusaurus-plugin-llms-txt').PluginOptions} */
127+
/** @type {import('@signalwire/docusaurus-plugin-llms-txt/public').PluginOptions} */
128128
({
129-
siteTitle: 'React Native ExecuTorch',
130-
siteDescription:
131-
"React Native ExecuTorch brings Meta's ExecuTorch AI framework into the React Native ecosystem, enabling developers to run AI models and LLMs locally, directly on mobile devices. It provides a declarative API for on-device inference, allowing you to use local AI models without relying on cloud infrastructure. Built on the ExecuTorch foundation - part of the PyTorch Edge ecosystem - it extends efficient on-device AI deployment to cross-platform mobile applications in React Native.",
132-
depth: 3,
133-
enableDescriptions: true,
134-
content: {
129+
markdown: {
130+
enableFiles: true,
131+
excludeRoutes: ['**/react-native-executorch/search'],
135132
includeVersionedDocs: false,
136133
relativePaths: false,
137-
enableMarkdownFiles: false,
138-
excludeRoutes: ['**/react-native-executorch/search'],
139134
},
140-
includeOrder: [
141-
'**/docs/!(category|benchmarks)**',
142-
'**/docs/benchmarks/**',
143-
'**/docs/category/**',
144-
],
135+
llmsTxt: {
136+
siteTitle: 'React Native ExecuTorch',
137+
siteDescription:
138+
"React Native ExecuTorch brings Meta's ExecuTorch AI framework into the React Native ecosystem, enabling developers to run AI models and LLMs locally, directly on mobile devices. It provides a declarative API for on-device inference, allowing you to use local AI models without relying on cloud infrastructure. Built on the ExecuTorch foundation - part of the PyTorch Edge ecosystem - it extends efficient on-device AI deployment to cross-platform mobile applications in React Native.",
139+
autoSectionDepth: 3,
140+
autoSectionPosition: 1,
141+
enableDescriptions: true,
142+
sections: [
143+
{
144+
id: 'benchmarks',
145+
name: 'Benchmarks',
146+
routes: [{ route: '**/docs/benchmarks/**' }],
147+
position: 2,
148+
},
149+
{
150+
id: 'category',
151+
name: 'Category',
152+
routes: [{ route: '**/docs/category/**' }],
153+
position: 3,
154+
},
155+
],
156+
},
157+
ui: {
158+
copyPageContent: {
159+
buttonLabel: 'Copy Page',
160+
contentStrategy: 'prefer-markdown',
161+
display: {
162+
excludeRoutes: ['**/docs/category/**'],
163+
},
164+
actions: {
165+
viewMarkdown: true,
166+
ai: {
167+
chatGPT: {
168+
prompt: 'Check this link out GPT',
169+
},
170+
claude: {
171+
prompt: 'Check this link out Claude',
172+
},
173+
},
174+
},
175+
},
176+
},
145177
}),
146178
],
147179
],
180+
themes: [require.resolve('@signalwire/docusaurus-theme-llms-txt')],
148181
};
149182

150183
module.exports = config;

docs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"@emotion/styled": "^11.14.1",
2727
"@mdx-js/react": "^3.0.0",
2828
"@mui/material": "^7.3.7",
29-
"@signalwire/docusaurus-plugin-llms-txt": "^1.2.2",
29+
"@signalwire/docusaurus-plugin-llms-txt": "2.0.0-alpha.7",
30+
"@signalwire/docusaurus-theme-llms-txt": "1.0.0-alpha.9",
3031
"@swmansion/t-rex-ui": "^1.2.1",
3132
"clsx": "^2.1.0",
3233
"copy-text-to-clipboard": "^3.2.2",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import CopyPageContent from '@theme-original/CopyPageContent';
2+
import './styles.module.css';
3+
4+
export default function CopyPageContentWrapper(props) {
5+
return (
6+
<>
7+
<CopyPageContent {...props} />
8+
</>
9+
);
10+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[class*='copyButton'] [class*='dropdown'] {
2+
background: var(--swm-dropdown-versions-background);
3+
}

docs/yarn.lock

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,7 @@ __metadata:
22622262
languageName: node
22632263
linkType: hard
22642264

2265-
"@docusaurus/core@npm:3.9.2, @docusaurus/core@npm:^3.9.2":
2265+
"@docusaurus/core@npm:3.9.2, @docusaurus/core@npm:^3.0.0, @docusaurus/core@npm:^3.9.2":
22662266
version: 3.9.2
22672267
resolution: "@docusaurus/core@npm:3.9.2"
22682268
dependencies:
@@ -2648,7 +2648,7 @@ __metadata:
26482648
languageName: node
26492649
linkType: hard
26502650

2651-
"@docusaurus/theme-common@npm:3.9.2":
2651+
"@docusaurus/theme-common@npm:3.9.2, @docusaurus/theme-common@npm:^3.0.0":
26522652
version: 3.9.2
26532653
resolution: "@docusaurus/theme-common@npm:3.9.2"
26542654
dependencies:
@@ -3757,9 +3757,9 @@ __metadata:
37573757
languageName: node
37583758
linkType: hard
37593759

3760-
"@signalwire/docusaurus-plugin-llms-txt@npm:^1.2.2":
3761-
version: 1.2.2
3762-
resolution: "@signalwire/docusaurus-plugin-llms-txt@npm:1.2.2"
3760+
"@signalwire/docusaurus-plugin-llms-txt@npm:2.0.0-alpha.7":
3761+
version: 2.0.0-alpha.7
3762+
resolution: "@signalwire/docusaurus-plugin-llms-txt@npm:2.0.0-alpha.7"
37633763
dependencies:
37643764
fs-extra: "npm:^11.0.0"
37653765
hast-util-select: "npm:^6.0.4"
@@ -3775,7 +3775,22 @@ __metadata:
37753775
unist-util-visit: "npm:^5"
37763776
peerDependencies:
37773777
"@docusaurus/core": ^3.0.0
3778-
checksum: 10/66ac57275178c86fcb060e107df4a30f6989be9d162e5c1f77e104c1ae99598a8b0564a45c5b795a601f3a341731eed3293804b9ee2fe628fe0485c05a3a5d3d
3778+
checksum: 10/501174d4913db22aa44bfc803fa6b01d5c3f6bb1f92761ebfcb0c2482539b504688d183ec8c722b0ee611834965058740d0e848a59413d53a929e1df99fef331
3779+
languageName: node
3780+
linkType: hard
3781+
3782+
"@signalwire/docusaurus-theme-llms-txt@npm:1.0.0-alpha.9":
3783+
version: 1.0.0-alpha.9
3784+
resolution: "@signalwire/docusaurus-theme-llms-txt@npm:1.0.0-alpha.9"
3785+
dependencies:
3786+
"@docusaurus/core": "npm:^3.0.0"
3787+
"@docusaurus/theme-common": "npm:^3.0.0"
3788+
clsx: "npm:^2.0.0"
3789+
react-icons: "npm:^5.5.0"
3790+
peerDependencies:
3791+
react: ^18.0.0
3792+
react-dom: ^18.0.0
3793+
checksum: 10/2b9329a6bba390db27ac2d4bad9e8e4bc2e749cdc66d1a7d7f74cfc5e2af390bff1199819220581516f9182e4629066fcb65af4b7e9834d33bdc36fe73e5c9ac
37793794
languageName: node
37803795
linkType: hard
37813796

@@ -6327,7 +6342,8 @@ __metadata:
63276342
"@emotion/styled": "npm:^11.14.1"
63286343
"@mdx-js/react": "npm:^3.0.0"
63296344
"@mui/material": "npm:^7.3.7"
6330-
"@signalwire/docusaurus-plugin-llms-txt": "npm:^1.2.2"
6345+
"@signalwire/docusaurus-plugin-llms-txt": "npm:2.0.0-alpha.7"
6346+
"@signalwire/docusaurus-theme-llms-txt": "npm:1.0.0-alpha.9"
63316347
"@swmansion/t-rex-ui": "npm:^1.2.1"
63326348
clsx: "npm:^2.1.0"
63336349
copy-text-to-clipboard: "npm:^3.2.2"
@@ -11485,6 +11501,15 @@ __metadata:
1148511501
languageName: node
1148611502
linkType: hard
1148711503

11504+
"react-icons@npm:^5.5.0":
11505+
version: 5.5.0
11506+
resolution: "react-icons@npm:5.5.0"
11507+
peerDependencies:
11508+
react: "*"
11509+
checksum: 10/67d5b311c23f74829cb90d58b78ddc87959d2087eda7f29b78d1ab6e337b04b0358a00724d73ab60652469d9a2c66ba3c034b8b7d4f32caae942592f92f59a84
11510+
languageName: node
11511+
linkType: hard
11512+
1148811513
"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0":
1148911514
version: 16.13.1
1149011515
resolution: "react-is@npm:16.13.1"

0 commit comments

Comments
 (0)