@clidey/dory 1.0.8 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +59 -164
  2. package/bin/chat-server.ts +270 -0
  3. package/bin/dist/analytics-server.d.ts +11 -0
  4. package/bin/dist/analytics-server.d.ts.map +1 -0
  5. package/bin/dist/analytics-server.js +121 -0
  6. package/bin/dist/analytics-server.js.map +1 -0
  7. package/bin/dist/automation.d.ts +35 -0
  8. package/bin/dist/automation.d.ts.map +1 -0
  9. package/bin/dist/automation.js +259 -0
  10. package/bin/dist/automation.js.map +1 -0
  11. package/bin/dist/chat-server.d.ts +8 -0
  12. package/bin/dist/chat-server.d.ts.map +1 -0
  13. package/bin/dist/chat-server.js +322 -0
  14. package/bin/dist/chat-server.js.map +1 -0
  15. package/bin/dist/check.d.ts +16 -0
  16. package/bin/dist/check.d.ts.map +1 -0
  17. package/bin/dist/check.js +247 -0
  18. package/bin/dist/check.js.map +1 -0
  19. package/bin/dist/dependency-overlay.d.ts +7 -0
  20. package/bin/dist/dependency-overlay.d.ts.map +1 -0
  21. package/bin/dist/dependency-overlay.js +137 -0
  22. package/bin/dist/dependency-overlay.js.map +1 -0
  23. package/bin/dist/dory.js +254 -402
  24. package/bin/dist/dory.js.map +1 -1
  25. package/bin/dist/i18n-init.d.ts +6 -0
  26. package/bin/dist/i18n-init.d.ts.map +1 -0
  27. package/bin/dist/i18n-init.js +56 -0
  28. package/bin/dist/i18n-init.js.map +1 -0
  29. package/bin/dist/mcp-http.d.ts +8 -0
  30. package/bin/dist/mcp-http.d.ts.map +1 -0
  31. package/bin/dist/mcp-http.js +72 -0
  32. package/bin/dist/mcp-http.js.map +1 -0
  33. package/bin/dist/mcp.d.ts +2 -0
  34. package/bin/dist/mcp.d.ts.map +1 -0
  35. package/bin/dist/mcp.js +81 -0
  36. package/bin/dist/mcp.js.map +1 -0
  37. package/bin/dist/preview-entry.d.ts +2 -0
  38. package/bin/dist/preview-entry.d.ts.map +1 -0
  39. package/bin/dist/preview-entry.js +6 -0
  40. package/bin/dist/preview-entry.js.map +1 -0
  41. package/bin/dist/preview-server.d.ts +5 -0
  42. package/bin/dist/preview-server.d.ts.map +1 -0
  43. package/bin/dist/preview-server.js +146 -0
  44. package/bin/dist/preview-server.js.map +1 -0
  45. package/bin/dist/preview-static.d.ts +7 -0
  46. package/bin/dist/preview-static.d.ts.map +1 -0
  47. package/bin/dist/preview-static.js +70 -0
  48. package/bin/dist/preview-static.js.map +1 -0
  49. package/bin/dist/project-config.d.ts +22 -0
  50. package/bin/dist/project-config.d.ts.map +1 -0
  51. package/bin/dist/project-config.js +44 -0
  52. package/bin/dist/project-config.js.map +1 -0
  53. package/dist/index.html +57 -0
  54. package/dist/runtime/dory-runtime.css +2 -0
  55. package/dist/runtime/dory-runtime.html +14 -0
  56. package/dist/runtime/dory-runtime.js +5490 -0
  57. package/docs/api-playground-demo.mdx +119 -0
  58. package/docs/api-reference/asyncapi.json +324 -0
  59. package/docs/api-reference/openapi.json +366 -0
  60. package/docs/api-reference/operations/create.mdx +5 -0
  61. package/docs/api-reference/operations/delete.mdx +5 -0
  62. package/docs/api-reference/operations/get.mdx +5 -0
  63. package/docs/api-reference/operations/update.mdx +5 -0
  64. package/docs/api-reference/websocket-operations/receive-chat-message.mdx +5 -0
  65. package/docs/api-reference/websocket-operations/receive-notifications.mdx +5 -0
  66. package/docs/api-reference/websocket-operations/receive-presence-update.mdx +5 -0
  67. package/docs/api-reference/websocket-operations/send-chat-message.mdx +5 -0
  68. package/docs/api-reference/websocket-operations/send-presence-update.mdx +5 -0
  69. package/docs/assets/dory.jpeg +0 -0
  70. package/docs/components/accordion.mdx +145 -0
  71. package/docs/components/callouts.mdx +134 -0
  72. package/docs/components/cards.mdx +153 -0
  73. package/docs/components/code-blocks.mdx +281 -0
  74. package/docs/components/expandable.mdx +189 -0
  75. package/docs/components/icons.mdx +71 -0
  76. package/docs/components/images.mdx +82 -0
  77. package/docs/components/latex.mdx +148 -0
  78. package/docs/components/layout.mdx +178 -0
  79. package/docs/components/lists.mdx +134 -0
  80. package/docs/components/mermaid.mdx +149 -0
  81. package/docs/components/overview.mdx +81 -0
  82. package/docs/components/source.mdx +130 -0
  83. package/docs/components/steps.mdx +122 -0
  84. package/docs/components/tables.mdx +114 -0
  85. package/docs/components/tags.mdx +179 -0
  86. package/docs/components/typography.mdx +185 -0
  87. package/docs/configuration/analytics.mdx +45 -0
  88. package/docs/configuration/chat.mdx +59 -0
  89. package/docs/configuration/dory-json.mdx +278 -0
  90. package/docs/configuration/embed.mdx +73 -0
  91. package/docs/configuration/fonts.mdx +86 -0
  92. package/docs/configuration/internationalization.mdx +61 -0
  93. package/docs/configuration/navigation.mdx +217 -0
  94. package/docs/configuration/theming.mdx +166 -0
  95. package/docs/contributing.mdx +47 -0
  96. package/docs/dory.json +136 -0
  97. package/docs/embed-example.html +176 -0
  98. package/docs/favicon.svg +18 -0
  99. package/docs/features.mdx +440 -0
  100. package/docs/getting-started/automation.mdx +76 -0
  101. package/docs/getting-started/configuration.mdx +95 -0
  102. package/docs/getting-started/custom-components.mdx +60 -0
  103. package/docs/getting-started/installation.mdx +88 -0
  104. package/docs/getting-started/quick-start.mdx +53 -0
  105. package/docs/introduction.mdx +50 -0
  106. package/docs/logo/logo.svg +18 -0
  107. package/docs/playgrounds/api-playground.mdx +122 -0
  108. package/docs/playgrounds/websocket-playground.mdx +98 -0
  109. package/docs/social-card.png +0 -0
  110. package/docs/social-card.svg +17 -0
  111. package/docs/websocket-playground-demo.mdx +135 -0
  112. package/package.json +23 -17
  113. package/scripts/verify-component-examples.mjs +126 -0
  114. package/scripts/verify-runtime-parity.mjs +147 -0
  115. package/src/app.css +22 -1
  116. package/src/assets/fonts/HankenGrotesk.ttf +0 -0
  117. package/src/assets/fonts/OFL.txt +94 -0
  118. package/src/components/chat-assistant.tsx +229 -0
  119. package/src/components/dropdown.tsx +3 -3
  120. package/src/components/error-boundary.tsx +2 -2
  121. package/src/components/hooks.tsx +20 -1
  122. package/src/components/navigation.tsx +82 -51
  123. package/src/components/notification.tsx +2 -3
  124. package/src/components/routes.tsx +17 -19
  125. package/src/components/search-index.test.ts +15 -0
  126. package/src/components/search-index.ts +49 -48
  127. package/src/components/search.tsx +208 -104
  128. package/src/components/store.ts +27 -9
  129. package/src/config/mdx-common.ts +11 -0
  130. package/src/config/mdx.ts +10 -11
  131. package/src/embed/loader.ts +0 -3
  132. package/src/embed/types.ts +0 -2
  133. package/src/embed/widget-iframe.ts +19 -21
  134. package/src/embedded-runtime/config.ts +138 -0
  135. package/src/embedded-runtime/index.tsx +680 -0
  136. package/src/embedded-runtime/runtime.html +14 -0
  137. package/src/entry-server.tsx +46 -124
  138. package/src/main.tsx +17 -5
  139. package/src/mdx/accordion.tsx +3 -3
  140. package/src/mdx/api-playground.tsx +18 -16
  141. package/src/mdx/async-api.tsx +2 -2
  142. package/src/mdx/card.tsx +3 -2
  143. package/src/mdx/code.tsx +11 -9
  144. package/src/mdx/fence.tsx +6 -5
  145. package/src/mdx/icon-grid.tsx +4 -1
  146. package/src/mdx/icon-names.test.ts +15 -0
  147. package/src/mdx/icon-names.ts +60 -0
  148. package/src/mdx/icon-source-variants.ts +102 -0
  149. package/src/mdx/icon.tsx +12 -73
  150. package/src/mdx/latex.test.ts +38 -0
  151. package/src/mdx/latex.tsx +42 -64
  152. package/src/mdx/mdx.tsx +1 -1
  153. package/src/mdx/mermaid.tsx +12 -6
  154. package/src/mdx/open-api.tsx +130 -74
  155. package/src/mdx/preprocess.test.ts +16 -0
  156. package/src/mdx/preprocess.ts +61 -0
  157. package/src/mdx/processor.test.ts +135 -37
  158. package/src/mdx/processor.ts +54 -92
  159. package/src/mdx/source.tsx +5 -4
  160. package/src/mdx/specimen.tsx +57 -43
  161. package/src/mdx/tabs.tsx +32 -21
  162. package/src/mdx/text.tsx +11 -11
  163. package/src/mdx/try-it-panel.tsx +284 -0
  164. package/src/mdx/type-scale.tsx +7 -7
  165. package/src/mdx/websocket-playground.tsx +21 -14
  166. package/src/plugins/analytics-injector.ts +8 -0
  167. package/src/plugins/chat-dev-server.ts +32 -0
  168. package/src/plugins/docs-assets.test.ts +25 -0
  169. package/src/plugins/docs-assets.ts +6 -2
  170. package/src/plugins/frontmatter-dev-server.ts +2 -2
  171. package/src/plugins/frontmatter-generator.ts +1 -1
  172. package/src/plugins/html-files-middleware.test.ts +21 -1
  173. package/src/plugins/html-files-middleware.ts +26 -6
  174. package/src/plugins/html-metadata-injector.ts +24 -4
  175. package/src/plugins/llm-txt-dev-server.ts +2 -2
  176. package/src/plugins/llm-txt-generator.ts +21 -4
  177. package/src/plugins/prerender.ts +47 -20
  178. package/src/plugins/robots-generator.ts +1 -1
  179. package/src/plugins/sanitize.ts +6 -5
  180. package/src/plugins/shared.ts +6 -18
  181. package/src/plugins/sitemap-generator.ts +1 -1
  182. package/src/plugins/social-preview.test.ts +71 -0
  183. package/src/plugins/social-preview.ts +87 -0
  184. package/src/plugins/unified-mdx-plugin.ts +1 -1
  185. package/src/theme.scss +630 -207
  186. package/src/types/config.ts +53 -1
  187. package/src/ui/breadcrumb.tsx +17 -0
  188. package/src/ui/docs-header-view.tsx +32 -0
  189. package/src/ui/docs-navigation-view.tsx +69 -0
  190. package/src/ui/docs-page-frame.tsx +50 -0
  191. package/src/ui/dory-mark.tsx +9 -0
  192. package/src/ui/header.tsx +33 -90
  193. package/src/ui/layout.tsx +99 -153
  194. package/src/ui/mobile-navigation.tsx +10 -8
  195. package/src/ui/page-actions.tsx +67 -0
  196. package/src/ui/page-feedback.tsx +50 -0
  197. package/src/ui/page-footer.tsx +23 -0
  198. package/src/ui/prev-next-link.tsx +15 -69
  199. package/src/ui/prev-next-view.tsx +27 -0
  200. package/src/ui/table-of-content-view.tsx +167 -0
  201. package/src/ui/table-of-content.tsx +25 -183
  202. package/src/utils/analytics.test.ts +36 -0
  203. package/src/utils/analytics.ts +35 -0
  204. package/src/utils/colors.ts +7 -0
  205. package/src/utils/content-scope.test.ts +26 -0
  206. package/src/utils/content-scope.ts +39 -0
  207. package/src/utils/search-content.ts +12 -0
  208. package/src/utils/theme.ts +1 -7
  209. package/vite.config.ssr.ts +4 -4
  210. package/vite.config.ts +22 -16
@@ -0,0 +1,176 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Dory Embedded Documentation Example</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: system-ui, -apple-system, sans-serif;
16
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
17
+ min-height: 100vh;
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ padding: 2rem;
22
+ }
23
+
24
+ .container {
25
+ max-width: 800px;
26
+ background: white;
27
+ border-radius: 1rem;
28
+ padding: 3rem;
29
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
30
+ }
31
+
32
+ h1 {
33
+ font-size: 2.5rem;
34
+ margin-bottom: 1rem;
35
+ color: #1f2937;
36
+ }
37
+
38
+ p {
39
+ font-size: 1.125rem;
40
+ color: #6b7280;
41
+ margin-bottom: 2rem;
42
+ line-height: 1.6;
43
+ }
44
+
45
+ .buttons {
46
+ display: flex;
47
+ flex-wrap: wrap;
48
+ gap: 1rem;
49
+ margin-bottom: 2rem;
50
+ }
51
+
52
+ button {
53
+ padding: 0.75rem 1.5rem;
54
+ font-size: 1rem;
55
+ font-weight: 600;
56
+ border: none;
57
+ border-radius: 0.5rem;
58
+ cursor: pointer;
59
+ transition: all 0.2s;
60
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
61
+ }
62
+
63
+ .btn-primary {
64
+ background: #3b82f6;
65
+ color: white;
66
+ }
67
+
68
+ .btn-primary:hover {
69
+ background: #2563eb;
70
+ transform: translateY(-2px);
71
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
72
+ }
73
+
74
+ .btn-secondary {
75
+ background: #f3f4f6;
76
+ color: #374151;
77
+ }
78
+
79
+ .btn-secondary:hover {
80
+ background: #e5e7eb;
81
+ }
82
+
83
+ .code-block {
84
+ background: #1f2937;
85
+ color: #f9fafb;
86
+ padding: 1.5rem;
87
+ border-radius: 0.5rem;
88
+ overflow-x: auto;
89
+ margin-bottom: 2rem;
90
+ font-family: 'Monaco', 'Menlo', monospace;
91
+ font-size: 0.875rem;
92
+ line-height: 1.6;
93
+ }
94
+
95
+ .status {
96
+ padding: 1rem;
97
+ background: #f0fdf4;
98
+ border: 1px solid #86efac;
99
+ border-radius: 0.5rem;
100
+ color: #166534;
101
+ margin-bottom: 1rem;
102
+ }
103
+ </style>
104
+ </head>
105
+ <body>
106
+ <div class="container">
107
+ <h1>🐟 Dory Embedded Documentation</h1>
108
+ <p>
109
+ This example demonstrates how to embed Dory documentation in your application.
110
+ </p>
111
+
112
+ <div id="status" class="status" style="display: none;"></div>
113
+
114
+ <div class="buttons">
115
+ <button class="btn-primary" onclick="DoryDocs.open()">
116
+ 📚 Open Documentation
117
+ </button>
118
+ <button class="btn-secondary" onclick="DoryDocs.open('/features')">
119
+ ⚡ Open Features
120
+ </button>
121
+ <button class="btn-secondary" onclick="DoryDocs.toggle()">
122
+ 🔄 Toggle
123
+ </button>
124
+ </div>
125
+
126
+ <h2 style="margin-top: 2rem; margin-bottom: 1rem; color: #1f2937;">Integration Code</h2>
127
+ <div class="code-block">
128
+ &lt;script src="http://localhost:3000/dist/embed.js"&gt;&lt;/script&gt;
129
+
130
+ &lt;script&gt;
131
+ DoryDocs.init({
132
+ baseUrl: 'http://localhost:3000',
133
+ position: 'right',
134
+ width: 600,
135
+ closeOnEscape: true,
136
+ });
137
+ &lt;/script&gt;
138
+
139
+ &lt;button onclick="DoryDocs.open()"&gt;Help&lt;/button&gt;
140
+ </div>
141
+ </div>
142
+
143
+ <!-- Load Dory Embed Script -->
144
+ <script src="http://localhost:3000/dist/embed.js"></script>
145
+
146
+ <!-- Initialize Dory -->
147
+ <script>
148
+ window.addEventListener('dory:ready', () => {
149
+ const status = document.getElementById('status');
150
+ status.style.display = 'block';
151
+ status.textContent = '✅ DoryDocs loaded and ready!';
152
+
153
+ DoryDocs.init({
154
+ baseUrl: 'http://localhost:3000',
155
+ position: 'right',
156
+ width: 400,
157
+ theme: 'inherit',
158
+ closeOnEscape: true,
159
+ closeOnOverlayClick: true,
160
+ onOpen: () => {
161
+ console.log('Docs opened');
162
+ status.textContent = '📖 Documentation opened';
163
+ },
164
+ onClose: () => {
165
+ console.log('Docs closed');
166
+ status.textContent = '✅ DoryDocs ready';
167
+ },
168
+ });
169
+ });
170
+
171
+ if (window.DoryDocs) {
172
+ window.dispatchEvent(new Event('dory:ready'));
173
+ }
174
+ </script>
175
+ </body>
176
+ </html>
@@ -0,0 +1,18 @@
1
+ <svg width="22" height="24" viewBox="0 0 22 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M21.9941 4.99951C19.9947 3.00079 19.9947 3.00079 16.9956 0.00271368V4.99951H21.9941Z" fill="#92BFFA"/>
3
+ <path d="M7.49782 3.91843C7.49782 4.5155 7.98183 4.99951 8.5789 4.99951H16.9951V0.00271606H8.5789C7.98183 0.00271606 7.49782 0.486733 7.49782 1.0838V3.91843Z" fill="url(#paint0_linear_66_680)"/>
4
+ <path d="M21.9932 5.01123C22.0049 8.20987 21.9983 17.7036 21.9951 21.9995C21.9943 23.1041 21.0977 23.9995 19.9932 23.9995H2C0.895431 23.9995 3.87055e-07 23.1041 0 21.9995V8.59131C0 7.99426 0.48401 7.51028 1.08105 7.51025H3.91797C4.51481 7.51052 4.99902 7.99441 4.99902 8.59131V19.5024H16.9951V5.01123H21.9932Z" fill="url(#paint1_linear_66_680)"/>
5
+ <ellipse cx="12.3217" cy="14.276" rx="1.2973" ry="1.29647" fill="#1967D2"/>
6
+ <path d="M5 0.00634813C5.55157 0.00730227 5.99805 0.454718 5.99805 1.00635V4.01221C5.99805 4.64068 6.29707 5.23179 6.80273 5.60498L7.46777 6.09619C7.81171 6.35003 8.22878 6.48682 8.65625 6.48682H14.4951C15.0472 6.48682 15.4949 6.93475 15.4951 7.48682V16.98C15.4951 17.5322 15.0474 17.98 14.4951 17.98H7.49805C6.94583 17.9799 6.49808 17.5322 6.49805 16.98V8.67139C6.49806 8.23724 6.35689 7.81407 6.0957 7.46729L5.58691 6.79248C5.21558 6.29954 4.63759 6.00515 4.02051 5.99561H1C0.447722 5.9956 0 5.54789 0 4.99561V1.00049C0.000165845 0.447951 0.448441 -4.60729e-05 1.00098 0.00048876L5 0.00634813Z" fill="#FFC236"/>
7
+ <ellipse cx="12.9961" cy="15.505" rx="1" ry="0.999359" fill="#3630C4"/>
8
+ <defs>
9
+ <linearGradient id="paint0_linear_66_680" x1="10.9999" y1="0.00271606" x2="10.9999" y2="23.9995" gradientUnits="userSpaceOnUse">
10
+ <stop stop-color="#528FF4"/>
11
+ <stop offset="1" stop-color="#92BFFA"/>
12
+ </linearGradient>
13
+ <linearGradient id="paint1_linear_66_680" x1="10.9999" y1="0.00271606" x2="10.9999" y2="23.9995" gradientUnits="userSpaceOnUse">
14
+ <stop stop-color="#528FF4"/>
15
+ <stop offset="1" stop-color="#92BFFA"/>
16
+ </linearGradient>
17
+ </defs>
18
+ </svg>
@@ -0,0 +1,440 @@
1
+ ---
2
+ title: 'Features'
3
+ description: 'Overview of available components and features'
4
+ ---
5
+
6
+ ## Headings Examples
7
+
8
+ ```mdx
9
+ # Heading 1
10
+ ```
11
+ # Heading 1
12
+
13
+ ```mdx
14
+ ## Heading 2
15
+ ```
16
+ # Heading 2
17
+
18
+ ```mdx
19
+ ### Heading 3
20
+ ```
21
+ # Heading 3
22
+ ```mdx
23
+ #### Heading 4
24
+ ```
25
+ # Heading 4
26
+ ```mdx
27
+ ##### Heading 5
28
+ ```
29
+ # Heading 5
30
+ ```mdx
31
+ ###### Heading 6
32
+ ```
33
+ # Heading 6
34
+
35
+ <br />
36
+
37
+ ## Lists Examples
38
+
39
+ ```mdx
40
+ - List item 1
41
+ - List item 2
42
+ - List item 3
43
+ ```
44
+
45
+ - List item 1
46
+ - List item 2
47
+ - List item 3
48
+
49
+ ```mdx
50
+ 1. List item 1
51
+ 2. List item 2
52
+ 3. List item 3
53
+ ```
54
+
55
+ 1. List item 1
56
+ 2. List item 2
57
+ 3. List item 3
58
+
59
+
60
+
61
+ <br />
62
+
63
+ ### Images
64
+
65
+ ```mdx
66
+ <img src="./assets/dory.jpeg" alt="Example image" className="object-cover w-64 h-64" />
67
+ ```
68
+
69
+ <img src="./assets/dory.jpeg" alt="Example image" className="object-cover w-64 h-64" />
70
+
71
+
72
+ <br />
73
+ <br />
74
+ <br />
75
+
76
+ ## Code Components
77
+
78
+ ### Code Block
79
+ ```typescript
80
+ function example() {
81
+ return "Hello World";
82
+ }
83
+ ```
84
+
85
+ ### Code Group Block
86
+
87
+ <CodeGroup>
88
+ ```typescript
89
+ function example(): string {
90
+ return "Hello World";
91
+ }
92
+ ```
93
+ ```javascript
94
+ function example() {
95
+ return "Hello World";
96
+ }
97
+ ```
98
+ </CodeGroup>
99
+
100
+
101
+ <br />
102
+ <br />
103
+ <br />
104
+
105
+
106
+ ## Interactive Components
107
+
108
+ ### Mermaid
109
+
110
+ ```mdx
111
+ mermaid
112
+ graph TD
113
+
114
+ %% Main Start
115
+ Start([Start Process]) --> Validate[Validate Input]
116
+
117
+ %% Decision Point
118
+ Validate -->|Valid| ProcessData{Is Data Clean?}
119
+ Validate -->|Invalid| Error[Show Error Message]
120
+
121
+ %% Clean Data Branch
122
+ ProcessData -->|Yes| Clean[Clean Data]
123
+ Clean --> Analyze[Analyze Data]
124
+
125
+ %% Dirty Data Branch
126
+ ProcessData -->|No| Notify[Notify User]
127
+ Notify --> Wait[Wait for Input]
128
+ Wait --> Validate
129
+
130
+ %% Parallel Branches After Analysis
131
+ Analyze --> Split1 & Split2
132
+
133
+ subgraph Parallel Tasks
134
+ Split1[Generate Report] --> Merge
135
+ Split2[Update Dashboard] --> Merge
136
+ end
137
+
138
+ Merge --> Decision2{Is More Input Needed?}
139
+ Decision2 -->|Yes| WaitMore[Wait for More Input]
140
+ WaitMore --> Validate
141
+ Decision2 -->|No| End([End Process])
142
+
143
+ %% Style and Class Definitions
144
+ classDef decision fill:#f9f,stroke:#333,stroke-width:2px;
145
+ class ProcessData,Decision2 decision;
146
+
147
+ ```
148
+
149
+ <strong>
150
+ <p>Note: Mermaid should be inside a code block with type "mermaid"</p>
151
+ </strong>
152
+
153
+ ```mermaid
154
+ graph TD
155
+
156
+ %% Main Start
157
+ Start([Start Process]) --> Validate[Validate Input]
158
+
159
+ %% Decision Point
160
+ Validate -->|Valid| ProcessData{Is Data Clean?}
161
+ Validate -->|Invalid| Error[Show Error Message]
162
+
163
+ %% Clean Data Branch
164
+ ProcessData -->|Yes| Clean[Clean Data]
165
+ Clean --> Analyze[Analyze Data]
166
+
167
+ %% Dirty Data Branch
168
+ ProcessData -->|No| Notify[Notify User]
169
+ Notify --> Wait[Wait for Input]
170
+ Wait --> Validate
171
+
172
+ %% Parallel Branches After Analysis
173
+ Analyze --> Split1 & Split2
174
+
175
+ subgraph Parallel Tasks
176
+ Split1[Generate Report] --> Merge
177
+ Split2[Update Dashboard] --> Merge
178
+ end
179
+
180
+ Merge --> Decision2{Is More Input Needed?}
181
+ Decision2 -->|Yes| WaitMore[Wait for More Input]
182
+ WaitMore --> Validate
183
+ Decision2 -->|No| End([End Process])
184
+
185
+ %% Style and Class Definitions
186
+ classDef decision fill:#f9f,stroke:#333,stroke-width:2px;
187
+ class ProcessData,Decision2 decision;
188
+
189
+ ```
190
+
191
+ ### Accordion
192
+
193
+ ```mdx
194
+ <AccordionGroup>
195
+ <Accordion title="First Section" icon="FileText">
196
+ This is the content of the first accordion section.
197
+ </Accordion>
198
+ <Accordion title="Second Section" icon="Code">
199
+ This is the content of the second accordion section.
200
+ </Accordion>
201
+ </AccordionGroup>
202
+ ```
203
+
204
+ <AccordionGroup>
205
+ <Accordion title="First Section" icon="FileText">
206
+ This is the content of the first accordion section.
207
+ </Accordion>
208
+ <Accordion title="Second Section" icon="Code">
209
+ This is the content of the second accordion section.
210
+ </Accordion>
211
+ </AccordionGroup>
212
+
213
+ ### Callouts
214
+
215
+ ```mdx
216
+ <Note>
217
+ This is a note callout with important information.
218
+ </Note>
219
+ ```
220
+
221
+ <Note>
222
+ This is a note callout with important information.
223
+ </Note>
224
+
225
+ ```mdx
226
+ <Warning>
227
+ This is a warning callout for critical information.
228
+ </Warning>
229
+ ```
230
+
231
+ <Warning>
232
+ This is a warning callout for critical information.
233
+ </Warning>
234
+
235
+ ```mdx
236
+ <Info>
237
+ This is an info callout for general information.
238
+ </Info>
239
+ ```
240
+
241
+ <Info>
242
+ This is an info callout for general information.
243
+ </Info>
244
+
245
+ ```mdx
246
+ <Tip>
247
+ This is a tip callout for helpful suggestions.
248
+ </Tip>
249
+ ```
250
+
251
+ <Tip>
252
+ This is a tip callout for helpful suggestions.
253
+ </Tip>
254
+
255
+ ```mdx
256
+ <Check>
257
+ This is a check callout for completed items.
258
+ </Check>
259
+ ```
260
+
261
+ <Check>
262
+ This is a check callout for completed items.
263
+ </Check>
264
+
265
+
266
+ <br />
267
+
268
+ ### Cards
269
+ ```mdx
270
+ <CardGroup cols={2}>
271
+ <Card
272
+ title="Example Card"
273
+ description="This is an example card component with an icon and title."
274
+ icon="FileText"
275
+ href="#"
276
+ />
277
+ <Card
278
+ title="Another Card"
279
+ description="This is another example card with different content."
280
+ icon="Code"
281
+ href="#"
282
+ />
283
+ </CardGroup>
284
+ ```
285
+
286
+ <CardGroup cols={2}>
287
+ <Card
288
+ title="Example Card"
289
+ description="This is an example card component with an icon and title."
290
+ icon="FileText"
291
+ href="#"
292
+ />
293
+ <Card
294
+ title="Another Card"
295
+ description="This is another example card with different content."
296
+ icon="Code"
297
+ href="#"
298
+ />
299
+ </CardGroup>
300
+
301
+ <br />
302
+
303
+ ### Expandable
304
+
305
+ ```mdx
306
+ <Expandable title="Click to Expand">
307
+ This is an expandable section that can be toggled.
308
+ </Expandable>
309
+ ```
310
+
311
+ <Expandable title="Click to Expand">
312
+ This is an expandable section that can be toggled.
313
+ </Expandable>
314
+
315
+ ### Source
316
+
317
+ ```mdx
318
+ <Source url="https://github.com/clidey/dory" paths={[
319
+ { path: "src/mdx/source.tsx", range: "1-46" },
320
+ { path: "docs/features.mdx", range: "318-322" },
321
+ ]} />
322
+ ```
323
+
324
+ <Source url="https://github.com/clidey/dory" paths={[
325
+ { path: "src/mdx/source.tsx", range: "1-46" },
326
+ { path: "docs/features.mdx", range: "318-322" },
327
+ ]} />
328
+
329
+ <br />
330
+ <br />
331
+ <br />
332
+
333
+
334
+ ## Special Components
335
+
336
+ ### Grids
337
+
338
+ #### Rows
339
+ ```mdx
340
+ <Row cols={2}>
341
+ <Icon icon="FileText" />
342
+ <Icon icon="CheckCircle" />
343
+ </Row>
344
+ ```
345
+
346
+ <Row cols={2}>
347
+ <Icon icon="FileText" />
348
+ <Icon icon="CheckCircle" />
349
+ </Row>
350
+
351
+ <br />
352
+
353
+ #### Columns
354
+
355
+ ```mdx
356
+ <Col>
357
+ <Icon icon="FileText" />
358
+ <Icon icon="FileText" />
359
+ </Col>
360
+ ```
361
+
362
+ <Col>
363
+ <Icon icon="FileText" />
364
+ <Icon icon="FileText" />
365
+ </Col>
366
+
367
+ <br />
368
+ <br />
369
+ <br />
370
+
371
+ ### Latex
372
+
373
+ ```mdx
374
+ <Latex>
375
+ E = mc^2
376
+ </Latex>
377
+ ```
378
+
379
+ <Latex>
380
+ E = mc^2
381
+ </Latex>
382
+
383
+ <br />
384
+ <br />
385
+ <br />
386
+
387
+ ### Tables
388
+
389
+ ```mdx
390
+ | Property | Description |
391
+ | -------- | ------------------------------------- |
392
+ | Name | Full name of user |
393
+ | Age | Reported age |
394
+ | Joined | Whether the user joined the community |
395
+ ```
396
+
397
+ | Property | Description |
398
+ | -------- | ------------------------------------- |
399
+ | Name | Full name of user |
400
+ | Age | Reported age |
401
+ | Joined | Whether the user joined the community |
402
+
403
+
404
+ ### Steps
405
+
406
+ ```mdx
407
+ <Steps>
408
+ <Step title="First Step">
409
+ This is the first step in the process.
410
+ </Step>
411
+ <Step title="Second Step">
412
+ This is the second step in the process.
413
+ </Step>
414
+ </Steps>
415
+ ```
416
+
417
+ <Steps>
418
+ <Step title="First Step">
419
+ This is the first step in the process.
420
+ </Step>
421
+ <Step title="Second Step">
422
+ This is the second step in the process.
423
+ </Step>
424
+ </Steps>
425
+
426
+ ### Icons
427
+
428
+ ```mdx
429
+ <Col rows={2}>
430
+ <Icon icon="Code" />
431
+ <Icon icon="FileText" />
432
+ <Icon icon="CheckCircle" />
433
+ </Col>
434
+ ```
435
+
436
+ <Row cols={3}>
437
+ <Icon icon="Code" />
438
+ <Icon icon="FileText" />
439
+ <Icon icon="CheckCircle" />
440
+ </Row>
@@ -0,0 +1,76 @@
1
+ ---
2
+ title: 'CLI and MCP automation'
3
+ description: 'Build, inspect, capture, and iterate on Dory documentation from a CLI or MCP client.'
4
+ ---
5
+
6
+ # CLI and MCP automation
7
+
8
+ Dory can expose a local documentation project to an MCP client. The client can inspect `dory.json`, read and write MDX pages, validate compilation, build the site, and capture screenshots of the result.
9
+
10
+ ## Connect an MCP client
11
+
12
+ From the directory containing `dory.json`, run:
13
+
14
+ ```bash
15
+ dory mcp config
16
+ ```
17
+
18
+ Add the printed `mcpServers.dory` entry to your MCP client's configuration. It pins the current project with `DORY_PROJECT_ROOT`, so the client does not need to launch from that directory. To start it directly:
19
+
20
+ ```bash
21
+ dory mcp serve --project /path/to/docs-project
22
+ ```
23
+
24
+ The server uses stdio. Its stdout carries MCP messages; build logs are returned inside tool results.
25
+
26
+ ## Connect to hosted documentation
27
+
28
+ A Dory site served with `dory preview` also exposes a public, read-only Streamable HTTP MCP endpoint at `/mcp` (or `/docs/mcp` when `basePath` is `/docs`). It provides `site_guide`, `list_pages`, `search_docs`, and `read_page`. These tools read only files in the built `dist/` directory. The local stdio MCP server above remains the way to write pages, build, and take screenshots.
29
+
30
+ Add the endpoint once in your MCP client:
31
+
32
+ ```bash
33
+ codex mcp add example-docs --url https://docs.example.com/mcp
34
+ claude mcp add --transport http example-docs https://docs.example.com/mcp
35
+ ```
36
+
37
+ Replace the example URL with your Dory site. If the docs run behind a reverse proxy, forward `/mcp` to the Dory preview server. Its `dory.json` `url` must match the public hostname; for an additional preview hostname, set `DORY_MCP_ALLOWED_HOSTS` to a comma-separated list. The endpoint rejects other hostnames and cross-origin browser requests.
38
+
39
+ You can also give a browsing agent just the documentation URL. Dory advertises `llms.txt` in its HTML, with links to the published `.mdx` pages and `llms-full.txt`. MCP clients still need the one-time connector command above before they can call MCP tools.
40
+
41
+ ## Build and review loop
42
+
43
+ Ask the MCP client to call `dory_guide` first. A typical loop is:
44
+
45
+ 1. `dory_project` reads the site configuration and page list.
46
+ 2. `dory_reference` provides Dory's packaged component and configuration guides.
47
+ 3. `dory_read_page` and `dory_write_page` update the relevant MDX.
48
+ 4. `dory_verify_page` checks MDX compilation.
49
+ 5. `dory_check` catches broken navigation and links, then `dory_build` generates the site.
50
+ 6. `dory_screenshot` captures a route in light and dark themes; review the images and repeat as needed.
51
+
52
+ The same operations are available from the CLI:
53
+
54
+ ```bash
55
+ dory inspect
56
+ dory reference components/cards.mdx
57
+ dory check
58
+ dory verify:content --file getting-started/quick-start.mdx
59
+ dory build
60
+ dory screenshot --route /getting-started/quick-start --theme light
61
+ dory screenshot --route /getting-started/quick-start --theme dark --width 390 --height 844
62
+ ```
63
+
64
+ Screenshot capture uses Chrome or Chromium. Set `DORY_CHROME_PATH` if the browser is outside the standard installation paths. Screenshots are written as PNG files under `.dory/screenshots/`; `--output` must stay in that directory.
65
+
66
+ ## Discover published MDX from one URL
67
+
68
+ Dory sites advertise their `llms.txt` index in the page HTML. The index links to every navigation page's published `.mdx` source and to `llms-full.txt` for combined text. Give a hosted site URL to the CLI or MCP client:
69
+
70
+ ```bash
71
+ dory discover https://docs.example.com
72
+ ```
73
+
74
+ The `dory_discover_site` MCP tool returns the index and MDX URLs. `dory_read_remote_page` retrieves an individual published MDX page. For sites hosted under a path such as `/docs`, the HTML discovery link points to the correct index automatically. Remote discovery accepts public HTTP or HTTPS sites; local and private network addresses are blocked.
75
+
76
+ The server only edits local project pages. Hosted URL discovery reads published source; it does not change the remote site.