docyard 0.9.0 → 1.0.1

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 (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -1
  3. data/README.md +8 -253
  4. data/exe/docyard +6 -0
  5. data/lib/docyard/build/asset_bundler.rb +24 -2
  6. data/lib/docyard/build/error_page_generator.rb +33 -0
  7. data/lib/docyard/build/file_copier.rb +12 -5
  8. data/lib/docyard/build/file_writer.rb +19 -0
  9. data/lib/docyard/build/llms_txt_generator.rb +103 -0
  10. data/lib/docyard/build/root_fallback_generator.rb +66 -0
  11. data/lib/docyard/build/sitemap_generator.rb +1 -1
  12. data/lib/docyard/build/static_generator.rb +119 -81
  13. data/lib/docyard/builder.rb +6 -2
  14. data/lib/docyard/cli.rb +14 -4
  15. data/lib/docyard/components/processors/callout_processor.rb +1 -1
  16. data/lib/docyard/components/processors/code_block_extended_fence_postprocessor.rb +24 -0
  17. data/lib/docyard/components/processors/code_block_extended_fence_preprocessor.rb +44 -0
  18. data/lib/docyard/components/processors/code_block_options_preprocessor.rb +11 -1
  19. data/lib/docyard/components/processors/code_block_processor.rb +5 -24
  20. data/lib/docyard/components/processors/code_group_processor.rb +6 -22
  21. data/lib/docyard/components/processors/code_snippet_import_preprocessor.rb +1 -0
  22. data/lib/docyard/components/processors/file_tree_processor.rb +1 -2
  23. data/lib/docyard/components/processors/icon_processor.rb +8 -2
  24. data/lib/docyard/components/processors/include_processor.rb +10 -10
  25. data/lib/docyard/components/processors/video_embed_processor.rb +14 -3
  26. data/lib/docyard/components/support/code_block/feature_extractor.rb +3 -1
  27. data/lib/docyard/components/support/code_block/icon_detector.rb +5 -12
  28. data/lib/docyard/components/support/code_block/line_number_resolver.rb +30 -0
  29. data/lib/docyard/components/support/code_detector.rb +2 -12
  30. data/lib/docyard/components/support/code_group/html_builder.rb +2 -6
  31. data/lib/docyard/components/support/tabs/icon_detector.rb +6 -2
  32. data/lib/docyard/components/support/tabs/parser.rb +6 -23
  33. data/lib/docyard/config/analytics_resolver.rb +24 -0
  34. data/lib/docyard/config/branding_resolver.rb +58 -27
  35. data/lib/docyard/config/key_validator.rb +30 -0
  36. data/lib/docyard/config/logo_detector.rb +8 -8
  37. data/lib/docyard/config/schema.rb +39 -0
  38. data/lib/docyard/config/section.rb +21 -0
  39. data/lib/docyard/config/validation_helpers.rb +83 -0
  40. data/lib/docyard/config/validator.rb +45 -144
  41. data/lib/docyard/config/validators/navigation.rb +43 -0
  42. data/lib/docyard/config/validators/section.rb +114 -0
  43. data/lib/docyard/config.rb +46 -102
  44. data/lib/docyard/constants.rb +59 -0
  45. data/lib/docyard/{utils/errors.rb → errors.rb} +6 -0
  46. data/lib/docyard/initializer.rb +100 -49
  47. data/lib/docyard/navigation/breadcrumb_builder.rb +45 -6
  48. data/lib/docyard/navigation/page_navigation_builder.rb +65 -0
  49. data/lib/docyard/navigation/sidebar/auto_builder.rb +107 -0
  50. data/lib/docyard/navigation/sidebar/cache.rb +96 -0
  51. data/lib/docyard/navigation/sidebar/config_builder.rb +179 -0
  52. data/lib/docyard/navigation/sidebar/distributed_builder.rb +145 -0
  53. data/lib/docyard/navigation/sidebar/local_config_loader.rb +69 -3
  54. data/lib/docyard/navigation/sidebar/renderer.rb +12 -1
  55. data/lib/docyard/navigation/sidebar_builder.rb +43 -81
  56. data/lib/docyard/rendering/branding_variables.rb +65 -0
  57. data/lib/docyard/rendering/icon_helpers.rb +14 -1
  58. data/lib/docyard/rendering/icons/devicons.rb +63 -0
  59. data/lib/docyard/rendering/icons.rb +26 -27
  60. data/lib/docyard/rendering/markdown.rb +5 -23
  61. data/lib/docyard/rendering/og_helpers.rb +36 -0
  62. data/lib/docyard/rendering/renderer.rb +96 -61
  63. data/lib/docyard/rendering/template_resolver.rb +14 -0
  64. data/lib/docyard/routing/fallback_resolver.rb +3 -3
  65. data/lib/docyard/search/build_indexer.rb +2 -2
  66. data/lib/docyard/search/dev_indexer.rb +36 -28
  67. data/lib/docyard/search/pagefind_support.rb +1 -1
  68. data/lib/docyard/server/asset_handler.rb +39 -15
  69. data/lib/docyard/server/dev_server.rb +90 -55
  70. data/lib/docyard/server/file_watcher.rb +68 -18
  71. data/lib/docyard/server/pagefind_handler.rb +1 -1
  72. data/lib/docyard/server/preview_server.rb +29 -33
  73. data/lib/docyard/server/rack_application.rb +39 -71
  74. data/lib/docyard/server/router.rb +11 -7
  75. data/lib/docyard/server/sse_server.rb +157 -0
  76. data/lib/docyard/server/static_file_app.rb +42 -0
  77. data/lib/docyard/templates/assets/css/components/banner.css +31 -0
  78. data/lib/docyard/templates/assets/css/components/breadcrumbs.css +2 -1
  79. data/lib/docyard/templates/assets/css/components/callout.css +26 -6
  80. data/lib/docyard/templates/assets/css/components/code-block.css +4 -2
  81. data/lib/docyard/templates/assets/css/components/code-group.css +20 -7
  82. data/lib/docyard/templates/assets/css/components/feedback.css +126 -0
  83. data/lib/docyard/templates/assets/css/components/file-tree.css +5 -4
  84. data/lib/docyard/templates/assets/css/components/heading-anchor.css +2 -2
  85. data/lib/docyard/templates/assets/css/components/icon.css +5 -0
  86. data/lib/docyard/templates/assets/css/components/nav-menu.css +20 -4
  87. data/lib/docyard/templates/assets/css/components/navigation.css +25 -3
  88. data/lib/docyard/templates/assets/css/components/page-actions.css +131 -0
  89. data/lib/docyard/templates/assets/css/components/prev-next.css +14 -7
  90. data/lib/docyard/templates/assets/css/components/search.css +6 -10
  91. data/lib/docyard/templates/assets/css/components/tab-bar.css +9 -6
  92. data/lib/docyard/templates/assets/css/components/table-of-contents.css +63 -17
  93. data/lib/docyard/templates/assets/css/components/tabs.css +12 -4
  94. data/lib/docyard/templates/assets/css/components/theme-toggle.css +3 -1
  95. data/lib/docyard/templates/assets/css/landing.css +82 -13
  96. data/lib/docyard/templates/assets/css/layout.css +32 -16
  97. data/lib/docyard/templates/assets/css/markdown.css +22 -2
  98. data/lib/docyard/templates/assets/css/variables.css +14 -1
  99. data/lib/docyard/templates/assets/js/components/code-group.js +4 -1
  100. data/lib/docyard/templates/assets/js/components/copy-page.js +115 -0
  101. data/lib/docyard/templates/assets/js/components/feedback.js +66 -0
  102. data/lib/docyard/templates/assets/js/components/file-tree.js +5 -5
  103. data/lib/docyard/templates/assets/js/components/navigation.js +3 -3
  104. data/lib/docyard/templates/assets/js/components/search.js +3 -3
  105. data/lib/docyard/templates/assets/js/components/table-of-contents.js +12 -6
  106. data/lib/docyard/templates/assets/js/components/tabs.js +45 -22
  107. data/lib/docyard/templates/assets/js/components/tooltip.js +4 -4
  108. data/lib/docyard/templates/assets/js/hot-reload.js +44 -0
  109. data/lib/docyard/templates/errors/404.html.erb +125 -5
  110. data/lib/docyard/templates/errors/500.html.erb +184 -10
  111. data/lib/docyard/templates/errors/redirect.html.erb +12 -0
  112. data/lib/docyard/templates/init/_sidebar.yml +36 -0
  113. data/lib/docyard/templates/init/docyard.yml +36 -0
  114. data/lib/docyard/templates/init/pages/components.md +146 -0
  115. data/lib/docyard/templates/init/pages/getting-started.md +94 -0
  116. data/lib/docyard/templates/init/pages/index.md +22 -0
  117. data/lib/docyard/templates/layouts/default.html.erb +10 -0
  118. data/lib/docyard/templates/layouts/splash.html.erb +14 -1
  119. data/lib/docyard/templates/partials/_analytics.html.erb +24 -0
  120. data/lib/docyard/templates/partials/_banner.html.erb +1 -1
  121. data/lib/docyard/templates/partials/_code_block.html.erb +1 -1
  122. data/lib/docyard/templates/partials/_feedback.html.erb +14 -0
  123. data/lib/docyard/templates/partials/_footer.html.erb +1 -1
  124. data/lib/docyard/templates/partials/_head.html.erb +80 -5
  125. data/lib/docyard/templates/partials/_icon_library.html.erb +8 -0
  126. data/lib/docyard/templates/partials/_page_actions.html.erb +21 -0
  127. data/lib/docyard/templates/partials/_scripts.html.erb +6 -3
  128. data/lib/docyard/templates/partials/_tabs.html.erb +4 -1
  129. data/lib/docyard/utils/git_info.rb +157 -0
  130. data/lib/docyard/utils/hash_utils.rb +31 -0
  131. data/lib/docyard/utils/html_helpers.rb +8 -0
  132. data/lib/docyard/utils/logging.rb +44 -3
  133. data/lib/docyard/utils/path_resolver.rb +0 -10
  134. data/lib/docyard/utils/path_utils.rb +73 -0
  135. data/lib/docyard/version.rb +1 -1
  136. data/lib/docyard.rb +2 -2
  137. metadata +81 -47
  138. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
  139. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
  140. data/.github/pull_request_template.md +0 -14
  141. data/.github/workflows/ci.yml +0 -49
  142. data/.rubocop.yml +0 -42
  143. data/CODE_OF_CONDUCT.md +0 -132
  144. data/CONTRIBUTING.md +0 -55
  145. data/LICENSE.vscode-icons +0 -42
  146. data/Rakefile +0 -8
  147. data/lib/docyard/config/constants.rb +0 -31
  148. data/lib/docyard/navigation/sidebar/children_discoverer.rb +0 -51
  149. data/lib/docyard/navigation/sidebar/config_parser.rb +0 -208
  150. data/lib/docyard/navigation/sidebar/file_resolver.rb +0 -90
  151. data/lib/docyard/navigation/sidebar/file_system_scanner.rb +0 -78
  152. data/lib/docyard/navigation/sidebar/metadata_extractor.rb +0 -71
  153. data/lib/docyard/navigation/sidebar/metadata_reader.rb +0 -51
  154. data/lib/docyard/navigation/sidebar/path_prefixer.rb +0 -34
  155. data/lib/docyard/navigation/sidebar/sorter.rb +0 -21
  156. data/lib/docyard/navigation/sidebar/title_extractor.rb +0 -25
  157. data/lib/docyard/navigation/sidebar/tree_builder.rb +0 -140
  158. data/lib/docyard/rendering/icons/LICENSE.phosphor +0 -21
  159. data/lib/docyard/rendering/icons/file_types.rb +0 -79
  160. data/lib/docyard/rendering/icons/phosphor.rb +0 -93
  161. data/lib/docyard/rendering/language_mapping.rb +0 -52
  162. data/lib/docyard/templates/assets/js/reload.js +0 -98
  163. data/lib/docyard/templates/partials/_icon.html.erb +0 -1
  164. data/lib/docyard/templates/partials/_icon_file_extension.html.erb +0 -1
  165. data/sig/docyard.rbs +0 -4
@@ -0,0 +1,44 @@
1
+ (function() {
2
+ var ssePort = window.__DOCYARD_SSE_PORT__;
3
+ if (!ssePort) return;
4
+
5
+ var url = 'http://127.0.0.1:' + ssePort + '/';
6
+ var eventSource = new EventSource(url);
7
+
8
+ eventSource.addEventListener('reload', function(event) {
9
+ var data = JSON.parse(event.data);
10
+ if (data.type === 'content') {
11
+ console.log('[Docyard] Content updated');
12
+ reloadContent();
13
+ } else {
14
+ console.log('[Docyard] Full reload');
15
+ location.reload();
16
+ }
17
+ });
18
+
19
+ eventSource.onerror = function() {
20
+ eventSource.close();
21
+ };
22
+
23
+ function reloadContent() {
24
+ fetch(location.href)
25
+ .then(function(response) { return response.text(); })
26
+ .then(function(html) {
27
+ var parser = new DOMParser();
28
+ var newDoc = parser.parseFromString(html, 'text/html');
29
+ var newContent = newDoc.querySelector('.content');
30
+ var currentContent = document.querySelector('.content');
31
+
32
+ if (newContent && currentContent) {
33
+ currentContent.innerHTML = newContent.innerHTML;
34
+ if (window.Prism) window.Prism.highlightAll();
35
+ if (window.docyardTOC) window.docyardTOC.init();
36
+ } else {
37
+ location.reload();
38
+ }
39
+ })
40
+ .catch(function() {
41
+ location.reload();
42
+ });
43
+ }
44
+ })();
@@ -4,13 +4,133 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>404 - Page Not Found</title>
7
- <link rel="stylesheet" href="/_docyard/css/main.css">
7
+ <style>
8
+ @font-face {
9
+ font-family: 'Inter';
10
+ src: url('<%= base_url %>_docyard/fonts/Inter-Variable.ttf') format('truetype');
11
+ font-weight: 100 900;
12
+ font-style: normal;
13
+ }
14
+
15
+ :root {
16
+ --background: #ffffff;
17
+ --foreground: #0f0f10;
18
+ --muted-foreground: #71717a;
19
+ --border: #e4e4e7;
20
+ --primary: oklch(0.61 0.11 222);
21
+ --primary-foreground: oklch(0.98 0.02 201);
22
+ --radius: 0.5rem;
23
+ }
24
+
25
+ .dark {
26
+ --background: #09090b;
27
+ --foreground: #fafafa;
28
+ --muted-foreground: #a1a1aa;
29
+ --border: #27272a;
30
+ --primary: oklch(0.71 0.13 215);
31
+ --primary-foreground: oklch(0.30 0.05 230);
32
+ }
33
+
34
+ <% if @primary_color && (@primary_color[:light] || @primary_color[:dark]) %>
35
+ <% light_color = @primary_color[:light] %>
36
+ <% dark_color = @primary_color[:dark] || light_color %>
37
+ <% if light_color %>
38
+ :root { --primary: <%= light_color %>; }
39
+ .dark { --primary: <%= dark_color %>; }
40
+ <% elsif dark_color %>
41
+ .dark { --primary: <%= dark_color %>; }
42
+ <% end %>
43
+ <% end %>
44
+
45
+ * {
46
+ margin: 0;
47
+ padding: 0;
48
+ box-sizing: border-box;
49
+ }
50
+
51
+ body {
52
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
53
+ background: var(--background);
54
+ color: var(--foreground);
55
+ min-height: 100vh;
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ padding: 2rem;
60
+ }
61
+
62
+ .error-page {
63
+ text-align: center;
64
+ max-width: 450px;
65
+ }
66
+
67
+ .error-code {
68
+ font-size: 8rem;
69
+ font-weight: 700;
70
+ color: transparent;
71
+ -webkit-text-stroke: 2px var(--border);
72
+ line-height: 1;
73
+ }
74
+
75
+ .error-title {
76
+ font-size: 1.25rem;
77
+ font-weight: 600;
78
+ margin: 1rem 0 0.5rem;
79
+ }
80
+
81
+ .error-message {
82
+ color: var(--muted-foreground);
83
+ font-size: 0.9375rem;
84
+ margin-bottom: 1.5rem;
85
+ }
86
+
87
+ .btn {
88
+ display: inline-flex;
89
+ align-items: center;
90
+ gap: 0.5rem;
91
+ padding: 0.5rem 1rem;
92
+ font-size: 0.875rem;
93
+ font-weight: 500;
94
+ text-decoration: none;
95
+ border-radius: var(--radius);
96
+ background: var(--primary);
97
+ color: var(--primary-foreground);
98
+ transition: opacity 0.15s;
99
+ font-family: inherit;
100
+ }
101
+
102
+ .btn:hover {
103
+ opacity: 0.9;
104
+ }
105
+
106
+ .btn svg {
107
+ width: 16px;
108
+ height: 16px;
109
+ }
110
+
111
+ @media (max-width: 480px) {
112
+ .error-code {
113
+ font-size: 5rem;
114
+ }
115
+ }
116
+ </style>
117
+ <script>
118
+ (function() {
119
+ const theme = localStorage.getItem('theme') ||
120
+ (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
121
+ document.documentElement.classList.toggle('dark', theme === 'dark');
122
+ })();
123
+ </script>
8
124
  </head>
9
125
  <body>
10
- <main>
11
- <h1>404 - Page Not Found</h1>
12
- <p>The page you're looking for doesn't exist.</p>
13
- <p><a href="/">Go back home</a></p>
126
+ <main class="error-page">
127
+ <p class="error-code">404</p>
128
+ <h1 class="error-title">Page not found</h1>
129
+ <p class="error-message">This page doesn't exist or has been moved.</p>
130
+ <a href="<%= base_url %>" class="btn">
131
+ <%= icon(:house_line) %>
132
+ Back to home
133
+ </a>
14
134
  </main>
15
135
  </body>
16
136
  </html>
@@ -4,21 +4,195 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>500 - Server Error</title>
7
- <link rel="stylesheet" href="/_docyard/css/main.css">
7
+ <style>
8
+ @font-face {
9
+ font-family: 'Inter';
10
+ src: url('<%= base_url %>_docyard/fonts/Inter-Variable.ttf') format('truetype');
11
+ font-weight: 100 900;
12
+ font-style: normal;
13
+ }
14
+
15
+ :root {
16
+ --background: #ffffff;
17
+ --foreground: #0f0f10;
18
+ --muted: #f5f5f6;
19
+ --muted-foreground: #71717a;
20
+ --border: #e4e4e7;
21
+ --primary: oklch(0.61 0.11 222);
22
+ --primary-foreground: oklch(0.98 0.02 201);
23
+ --destructive: #dc2626;
24
+ --radius: 0.5rem;
25
+ }
26
+
27
+ .dark {
28
+ --background: #09090b;
29
+ --foreground: #fafafa;
30
+ --muted: #18181b;
31
+ --muted-foreground: #a1a1aa;
32
+ --border: #27272a;
33
+ --primary: oklch(0.71 0.13 215);
34
+ --primary-foreground: oklch(0.30 0.05 230);
35
+ --destructive: #f87171;
36
+ }
37
+
38
+ <% if @primary_color && (@primary_color[:light] || @primary_color[:dark]) %>
39
+ <% light_color = @primary_color[:light] %>
40
+ <% dark_color = @primary_color[:dark] || light_color %>
41
+ <% if light_color %>
42
+ :root { --primary: <%= light_color %>; }
43
+ .dark { --primary: <%= dark_color %>; }
44
+ <% elsif dark_color %>
45
+ .dark { --primary: <%= dark_color %>; }
46
+ <% end %>
47
+ <% end %>
48
+
49
+ * {
50
+ margin: 0;
51
+ padding: 0;
52
+ box-sizing: border-box;
53
+ }
54
+
55
+ body {
56
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
57
+ background: var(--background);
58
+ color: var(--foreground);
59
+ min-height: 100vh;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ padding: 2rem;
64
+ }
65
+
66
+ .error-page {
67
+ text-align: center;
68
+ max-width: 500px;
69
+ }
70
+
71
+ .error-code {
72
+ font-size: 8rem;
73
+ font-weight: 700;
74
+ color: transparent;
75
+ -webkit-text-stroke: 2px var(--border);
76
+ line-height: 1;
77
+ }
78
+
79
+ .error-title {
80
+ font-size: 1.25rem;
81
+ font-weight: 600;
82
+ margin: 1rem 0 0.5rem;
83
+ }
84
+
85
+ .error-message {
86
+ color: var(--muted-foreground);
87
+ font-size: 0.9375rem;
88
+ margin-bottom: 1.5rem;
89
+ }
90
+
91
+ .btn {
92
+ display: inline-flex;
93
+ align-items: center;
94
+ gap: 0.5rem;
95
+ padding: 0.5rem 1rem;
96
+ font-size: 0.875rem;
97
+ font-weight: 500;
98
+ text-decoration: none;
99
+ border-radius: var(--radius);
100
+ background: var(--primary);
101
+ color: var(--primary-foreground);
102
+ transition: opacity 0.15s;
103
+ font-family: inherit;
104
+ }
105
+
106
+ .btn:hover {
107
+ opacity: 0.9;
108
+ }
109
+
110
+ .btn svg {
111
+ width: 16px;
112
+ height: 16px;
113
+ }
114
+
115
+ .error-details {
116
+ margin-top: 2rem;
117
+ text-align: left;
118
+ background: var(--muted);
119
+ border: 1px solid var(--border);
120
+ border-radius: var(--radius);
121
+ overflow: hidden;
122
+ }
123
+
124
+ .error-details summary {
125
+ cursor: pointer;
126
+ padding: 0.75rem 1rem;
127
+ font-size: 0.8125rem;
128
+ font-weight: 500;
129
+ color: var(--muted-foreground);
130
+ display: flex;
131
+ align-items: center;
132
+ gap: 0.5rem;
133
+ }
134
+
135
+ .error-details summary svg {
136
+ width: 14px;
137
+ height: 14px;
138
+ }
139
+
140
+ .error-details[open] summary {
141
+ border-bottom: 1px solid var(--border);
142
+ }
143
+
144
+ .error-details pre {
145
+ margin: 0;
146
+ padding: 1rem;
147
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
148
+ font-size: 0.75rem;
149
+ line-height: 1.5;
150
+ color: var(--destructive);
151
+ white-space: pre-wrap;
152
+ word-break: break-word;
153
+ overflow-x: auto;
154
+ }
155
+
156
+ .error-details .backtrace {
157
+ border-top: 1px solid var(--border);
158
+ color: var(--muted-foreground);
159
+ }
160
+
161
+ @media (max-width: 480px) {
162
+ .error-code {
163
+ font-size: 5rem;
164
+ }
165
+ }
166
+ </style>
167
+ <script>
168
+ (function() {
169
+ const theme = localStorage.getItem('theme') ||
170
+ (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
171
+ document.documentElement.classList.toggle('dark', theme === 'dark');
172
+ })();
173
+ </script>
8
174
  </head>
9
175
  <body>
10
- <main>
11
- <h1>500 - Internal Server Error</h1>
12
- <p>Something went wrong.</p>
176
+ <main class="error-page">
177
+ <p class="error-code">500</p>
178
+ <h1 class="error-title">Something went wrong</h1>
179
+ <p class="error-message">We encountered an unexpected error. Please try again.</p>
180
+ <a href="<%= base_url %>" class="btn">
181
+ <%= icon(:house_line) %>
182
+ Back to home
183
+ </a>
13
184
 
14
185
  <% if @error_message %>
15
- <h3>Error Details:</h3>
186
+ <details class="error-details">
187
+ <summary>
188
+ <%= icon(:warning_circle) %>
189
+ Error details
190
+ </summary>
16
191
  <pre><%= @error_message %></pre>
17
- <% end %>
18
-
19
- <% if @backtrace %>
20
- <h3>Backtrace:</h3>
21
- <pre><%= @backtrace %></pre>
192
+ <% if @backtrace %>
193
+ <pre class="backtrace"><%= @backtrace %></pre>
194
+ <% end %>
195
+ </details>
22
196
  <% end %>
23
197
  </main>
24
198
  </body>
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="refresh" content="0;url=<%= @target_url %>">
6
+ <title>Redirecting...</title>
7
+ <script>window.location.href = "<%= @target_url %>";</script>
8
+ </head>
9
+ <body>
10
+ <p>Redirecting to <a href="<%= @target_url %>"><%= @target_url %></a>...</p>
11
+ </body>
12
+ </html>
@@ -0,0 +1,36 @@
1
+ # =============================================================================
2
+ # Sidebar Navigation
3
+ # =============================================================================
4
+ # This file controls the sidebar navigation for your documentation.
5
+ #
6
+ # Basic syntax:
7
+ # - page-name # Links to docs/page-name.md
8
+ # - page-name: { text: "Custom Title", icon: rocket-launch }
9
+ #
10
+ # Sections with nested pages:
11
+ # - section-name:
12
+ # text: "Section Title"
13
+ # icon: folder
14
+ # items:
15
+ # - page-one
16
+ # - page-two
17
+ #
18
+ # External links:
19
+ # - link: "https://github.com/your-org"
20
+ # text: "GitHub"
21
+ # icon: github
22
+ #
23
+ # Available icons: https://phosphoricons.com (use kebab-case names)
24
+ # =============================================================================
25
+
26
+ - index:
27
+ text: Welcome
28
+ icon: house
29
+
30
+ - getting-started:
31
+ text: Getting Started
32
+ icon: rocket-launch
33
+
34
+ - components:
35
+ text: Components
36
+ icon: package
@@ -0,0 +1,36 @@
1
+ # Docyard Configuration
2
+ # Full documentation: https://docyard.dev/configuration
3
+
4
+ title: "{{PROJECT_NAME}}"
5
+ description: "Documentation for {{PROJECT_NAME}}"
6
+
7
+ # Your production URL (for SEO and sitemaps)
8
+ # url: "https://docs.example.com"
9
+
10
+ # Branding customization
11
+ # branding:
12
+ # color: "#3b82f6" # Primary color (or use light/dark below)
13
+ # # color:
14
+ # # light: "#3b82f6"
15
+ # # dark: "#60a5fa"
16
+
17
+ # Social links (shown in footer)
18
+ # socials:
19
+ # github: "https://github.com/your-org/your-repo"
20
+ # twitter: "https://twitter.com/your-handle"
21
+
22
+ # Repository settings (enables "Edit this page" links)
23
+ # repo:
24
+ # url: "https://github.com/your-org/your-repo"
25
+ # branch: "main"
26
+ # edit_link: true
27
+
28
+ # Search (enabled by default)
29
+ search:
30
+ enabled: true
31
+ placeholder: "Search..."
32
+
33
+ # Build output
34
+ build:
35
+ output: "dist"
36
+ base: "/"
@@ -0,0 +1,146 @@
1
+ ---
2
+ title: Components
3
+ description: Available documentation components
4
+ ---
5
+
6
+ # Components
7
+
8
+ Docyard comes with a rich set of components to make your documentation shine.
9
+
10
+ ## Callouts
11
+
12
+ Use callouts to highlight important information:
13
+
14
+ :::note
15
+ This is a note callout for general information.
16
+ :::
17
+
18
+ :::tip
19
+ This is a tip callout for helpful suggestions.
20
+ :::
21
+
22
+ :::warning
23
+ This is a warning callout for things to watch out for.
24
+ :::
25
+
26
+ :::danger
27
+ This is a danger callout for critical warnings.
28
+ :::
29
+
30
+ ## Code Blocks
31
+
32
+ Syntax highlighting with copy button:
33
+
34
+ ```javascript
35
+ function greet(name) {
36
+ console.log(`Hello, ${name}!`);
37
+ }
38
+
39
+ greet('World');
40
+ ```
41
+
42
+ Code blocks can have titles:
43
+
44
+ ```ruby [config/routes.rb]
45
+ Rails.application.routes.draw do
46
+ root 'pages#home'
47
+ end
48
+ ```
49
+
50
+ And line highlighting:
51
+
52
+ ```python {2-3}
53
+ def calculate(x, y):
54
+ result = x + y # This line is highlighted
55
+ return result # This one too
56
+ ```
57
+
58
+ ## Code Groups
59
+
60
+ Group related code blocks with tabs:
61
+
62
+ :::code-group
63
+ ```bash [npm]
64
+ npm install my-package
65
+ ```
66
+
67
+ ```bash [yarn]
68
+ yarn add my-package
69
+ ```
70
+
71
+ ```bash [pnpm]
72
+ pnpm add my-package
73
+ ```
74
+ :::
75
+
76
+ ## Steps
77
+
78
+ Create step-by-step guides:
79
+
80
+ :::steps
81
+ ### Create a file
82
+
83
+ Create a new file called `example.md`.
84
+
85
+ ### Add content
86
+
87
+ Write your documentation content.
88
+
89
+ ### Preview
90
+
91
+ Run `docyard serve` to preview.
92
+ :::
93
+
94
+ ## Cards
95
+
96
+ Link to other pages with cards:
97
+
98
+ :::cards
99
+ ::card{title="Getting Started" icon="rocket-launch" href="/getting-started"}
100
+ Learn the basics
101
+ ::
102
+
103
+ ::card{title="Configuration" icon="code" href="/getting-started"}
104
+ Customize your site
105
+ ::
106
+ :::
107
+
108
+ ## Accordion
109
+
110
+ Collapsible content sections:
111
+
112
+ :::details{title="Click to expand"}
113
+ This content is hidden by default. Click the title to reveal it.
114
+
115
+ You can put any content here, including code blocks and other components.
116
+ :::
117
+
118
+ ## Badges
119
+
120
+ Inline status indicators: :badge[New]{type="success"} :badge[Beta]{type="warning"} :badge[Deprecated]{type="danger"}
121
+
122
+ ## File Tree
123
+
124
+ Display directory structures:
125
+
126
+ ```filetree
127
+ src/
128
+ components/
129
+ Button.jsx
130
+ Card.jsx
131
+ utils/
132
+ helpers.js
133
+ index.js
134
+ ```
135
+
136
+ ## Tables
137
+
138
+ | Feature | Status | Notes |
139
+ |---------|--------|-------|
140
+ | Markdown | Supported | Full GFM support |
141
+ | Dark Mode | Supported | Automatic |
142
+ | Search | Supported | Powered by Pagefind |
143
+
144
+ ## More Components
145
+
146
+ Docyard supports many more components. Visit the [documentation](https://docyard.dev) for the complete list.
@@ -0,0 +1,94 @@
1
+ ---
2
+ title: Getting Started
3
+ description: Get up and running with {{PROJECT_NAME}}
4
+ ---
5
+
6
+ # Getting Started
7
+
8
+ This guide will help you get started with {{PROJECT_NAME}}.
9
+
10
+ ## Prerequisites
11
+
12
+ Before you begin, make sure you have:
13
+
14
+ - Basic knowledge of Markdown
15
+ - A text editor
16
+
17
+ ## Installation
18
+
19
+ :::steps
20
+ ### Step 1: Install Docyard
21
+
22
+ ```bash
23
+ gem install docyard
24
+ ```
25
+
26
+ ### Step 2: Create a new project
27
+
28
+ ```bash
29
+ docyard init my-docs
30
+ cd my-docs
31
+ ```
32
+
33
+ ### Step 3: Start the development server
34
+
35
+ ```bash
36
+ docyard serve
37
+ ```
38
+
39
+ Open http://localhost:4200 in your browser.
40
+ :::
41
+
42
+ ## Project Structure
43
+
44
+ After initialization, your project will look like this:
45
+
46
+ ```filetree
47
+ my-docs/
48
+ docyard.yml # Configuration file
49
+ docs/
50
+ _sidebar.yml # Sidebar navigation
51
+ index.md # Home page
52
+ getting-started.md
53
+ components.md
54
+ public/ # Static assets (images, etc.)
55
+ ```
56
+
57
+ ## Writing Content
58
+
59
+ Create new pages by adding `.md` files to the `docs/` folder:
60
+
61
+ ```markdown
62
+ ---
63
+ title: My New Page
64
+ description: A brief description
65
+ ---
66
+
67
+ # My New Page
68
+
69
+ Your content here...
70
+ ```
71
+
72
+ Then add it to `_sidebar.yml`:
73
+
74
+ ```yaml
75
+ - my-new-page:
76
+ text: My New Page
77
+ icon: file
78
+ ```
79
+
80
+ ## Building for Production
81
+
82
+ When you're ready to deploy:
83
+
84
+ ```bash
85
+ docyard build
86
+ ```
87
+
88
+ This creates a `dist/` folder with static HTML files ready to deploy anywhere.
89
+
90
+ ## Next Steps
91
+
92
+ - Explore the [Components](/components) page to see what's available
93
+ - Configure your site in `docyard.yml`
94
+ - Deploy to GitHub Pages, Vercel, or Netlify