docyard 0.2.0 → 0.4.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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -1
  3. data/LICENSE.vscode-icons +42 -0
  4. data/README.md +86 -23
  5. data/lib/docyard/asset_handler.rb +33 -0
  6. data/lib/docyard/build/asset_bundler.rb +139 -0
  7. data/lib/docyard/build/file_copier.rb +105 -0
  8. data/lib/docyard/build/sitemap_generator.rb +57 -0
  9. data/lib/docyard/build/static_generator.rb +141 -0
  10. data/lib/docyard/builder.rb +104 -0
  11. data/lib/docyard/cli.rb +19 -0
  12. data/lib/docyard/components/base_processor.rb +24 -0
  13. data/lib/docyard/components/callout_processor.rb +121 -0
  14. data/lib/docyard/components/code_block_processor.rb +55 -0
  15. data/lib/docyard/components/code_detector.rb +59 -0
  16. data/lib/docyard/components/icon_detector.rb +57 -0
  17. data/lib/docyard/components/icon_processor.rb +51 -0
  18. data/lib/docyard/components/registry.rb +34 -0
  19. data/lib/docyard/components/table_wrapper_processor.rb +18 -0
  20. data/lib/docyard/components/tabs_parser.rb +60 -0
  21. data/lib/docyard/components/tabs_processor.rb +44 -0
  22. data/lib/docyard/config/validator.rb +171 -0
  23. data/lib/docyard/config.rb +135 -0
  24. data/lib/docyard/constants.rb +5 -0
  25. data/lib/docyard/icons/LICENSE.phosphor +21 -0
  26. data/lib/docyard/icons/file_types.rb +92 -0
  27. data/lib/docyard/icons/phosphor.rb +64 -0
  28. data/lib/docyard/icons.rb +40 -0
  29. data/lib/docyard/initializer.rb +93 -9
  30. data/lib/docyard/language_mapping.rb +52 -0
  31. data/lib/docyard/markdown.rb +27 -3
  32. data/lib/docyard/preview_server.rb +72 -0
  33. data/lib/docyard/rack_application.rb +77 -8
  34. data/lib/docyard/renderer.rb +56 -9
  35. data/lib/docyard/server.rb +5 -2
  36. data/lib/docyard/sidebar/config_parser.rb +180 -0
  37. data/lib/docyard/sidebar/item.rb +58 -0
  38. data/lib/docyard/sidebar/renderer.rb +33 -6
  39. data/lib/docyard/sidebar_builder.rb +54 -2
  40. data/lib/docyard/templates/assets/css/code.css +150 -2
  41. data/lib/docyard/templates/assets/css/components/callout.css +169 -0
  42. data/lib/docyard/templates/assets/css/components/code-block.css +196 -0
  43. data/lib/docyard/templates/assets/css/components/icon.css +16 -0
  44. data/lib/docyard/templates/assets/css/components/logo.css +44 -0
  45. data/lib/docyard/templates/assets/css/{components.css → components/navigation.css} +111 -53
  46. data/lib/docyard/templates/assets/css/components/tabs.css +299 -0
  47. data/lib/docyard/templates/assets/css/components/theme-toggle.css +69 -0
  48. data/lib/docyard/templates/assets/css/layout.css +14 -4
  49. data/lib/docyard/templates/assets/css/markdown.css +27 -17
  50. data/lib/docyard/templates/assets/css/reset.css +4 -0
  51. data/lib/docyard/templates/assets/css/variables.css +94 -3
  52. data/lib/docyard/templates/assets/favicon.svg +16 -0
  53. data/lib/docyard/templates/assets/js/components/code-block.js +162 -0
  54. data/lib/docyard/templates/assets/js/components/navigation.js +221 -0
  55. data/lib/docyard/templates/assets/js/components/tabs.js +338 -0
  56. data/lib/docyard/templates/assets/js/theme.js +12 -179
  57. data/lib/docyard/templates/assets/logo-dark.svg +4 -0
  58. data/lib/docyard/templates/assets/logo.svg +12 -0
  59. data/lib/docyard/templates/config/docyard.yml.erb +42 -0
  60. data/lib/docyard/templates/layouts/default.html.erb +32 -4
  61. data/lib/docyard/templates/markdown/getting-started/installation.md.erb +46 -12
  62. data/lib/docyard/templates/markdown/guides/configuration.md.erb +202 -0
  63. data/lib/docyard/templates/markdown/guides/markdown-features.md.erb +247 -0
  64. data/lib/docyard/templates/markdown/index.md.erb +55 -59
  65. data/lib/docyard/templates/partials/_callout.html.erb +11 -0
  66. data/lib/docyard/templates/partials/_code_block.html.erb +6 -0
  67. data/lib/docyard/templates/partials/_icon.html.erb +1 -0
  68. data/lib/docyard/templates/partials/_icon_file_extension.html.erb +1 -0
  69. data/lib/docyard/templates/partials/_nav_group.html.erb +10 -4
  70. data/lib/docyard/templates/partials/_nav_leaf.html.erb +9 -1
  71. data/lib/docyard/templates/partials/_tabs.html.erb +40 -0
  72. data/lib/docyard/templates/partials/_theme_toggle.html.erb +13 -0
  73. data/lib/docyard/version.rb +1 -1
  74. data/lib/docyard.rb +8 -0
  75. metadata +91 -7
  76. data/lib/docyard/templates/markdown/core-concepts/file-structure.md.erb +0 -61
  77. data/lib/docyard/templates/markdown/core-concepts/markdown.md.erb +0 -90
  78. data/lib/docyard/templates/markdown/getting-started/introduction.md.erb +0 -30
  79. data/lib/docyard/templates/markdown/getting-started/quick-start.md.erb +0 -56
  80. data/lib/docyard/templates/partials/_icons.html.erb +0 -11
@@ -1,193 +1,26 @@
1
1
  // Docyard Theme JavaScript
2
+ // Handles dark/light theme toggling
2
3
 
3
4
  (function() {
4
5
  'use strict';
5
6
 
6
- function initMobileMenu() {
7
- const toggle = document.querySelector('.secondary-header-menu');
8
- const sidebar = document.querySelector('.sidebar');
9
- const overlay = document.querySelector('.mobile-overlay');
7
+ function initThemeToggle() {
8
+ const toggle = document.querySelector('.theme-toggle');
9
+ if (!toggle) return;
10
10
 
11
- if (!toggle || !sidebar || !overlay) return;
11
+ toggle.addEventListener('click', function() {
12
+ const html = document.documentElement;
13
+ const isDark = html.classList.contains('dark');
14
+ const newTheme = isDark ? 'light' : 'dark';
12
15
 
13
- function openMenu() {
14
- sidebar.classList.add('is-open');
15
- overlay.classList.add('is-visible');
16
- toggle.setAttribute('aria-expanded', 'true');
17
- document.body.style.overflow = 'hidden';
18
- }
19
-
20
- function closeMenu() {
21
- sidebar.classList.remove('is-open');
22
- overlay.classList.remove('is-visible');
23
- toggle.setAttribute('aria-expanded', 'false');
24
- document.body.style.overflow = '';
25
- }
26
-
27
- function toggleMenu() {
28
- if (sidebar.classList.contains('is-open')) {
29
- closeMenu();
30
- } else {
31
- openMenu();
32
- }
33
- }
34
-
35
- toggle.addEventListener('click', toggleMenu);
36
- overlay.addEventListener('click', closeMenu);
37
-
38
- document.addEventListener('keydown', function(e) {
39
- if (e.key === 'Escape' && sidebar.classList.contains('is-open')) {
40
- closeMenu();
41
- }
42
- });
43
-
44
- sidebar.querySelectorAll('a').forEach(function(link) {
45
- link.addEventListener('click', closeMenu);
16
+ html.classList.toggle('dark', !isDark);
17
+ localStorage.setItem('theme', newTheme);
46
18
  });
47
19
  }
48
20
 
49
- function initAccordion() {
50
- const toggles = document.querySelectorAll('.nav-group-toggle');
51
-
52
- toggles.forEach(function(toggle) {
53
- toggle.addEventListener('click', function() {
54
- const expanded = toggle.getAttribute('aria-expanded') === 'true';
55
- const children = toggle.nextElementSibling;
56
-
57
- if (!children || !children.classList.contains('nav-group-children')) {
58
- return;
59
- }
60
-
61
- toggle.setAttribute('aria-expanded', !expanded);
62
- children.classList.toggle('collapsed');
63
-
64
- if (expanded) {
65
- children.style.maxHeight = '0';
66
- } else {
67
- children.style.maxHeight = children.scrollHeight + 'px';
68
- }
69
- });
70
- });
71
-
72
- document.querySelectorAll('.nav-group-children.collapsed').forEach(function(el) {
73
- el.style.maxHeight = '0';
74
- });
75
- }
76
-
77
- function initSidebarScroll() {
78
- const scrollContainer = document.querySelector('.sidebar nav');
79
- if (!scrollContainer) return;
80
-
81
- const STORAGE_KEY = 'docyard_sidebar_scroll';
82
- const savedPosition = sessionStorage.getItem(STORAGE_KEY);
83
-
84
- if (savedPosition) {
85
- const position = parseInt(savedPosition, 10);
86
- scrollContainer.scrollTop = position;
87
-
88
- setTimeout(function() {
89
- scrollContainer.scrollTop = position;
90
- }, 100);
91
- } else {
92
- const activeLink = scrollContainer.querySelector('a.active');
93
- if (activeLink) {
94
- setTimeout(function() {
95
- activeLink.scrollIntoView({
96
- behavior: 'instant',
97
- block: 'center'
98
- });
99
- }, 50);
100
- }
101
- }
102
-
103
- scrollContainer.querySelectorAll('a').forEach(function(link) {
104
- link.addEventListener('click', function() {
105
- sessionStorage.setItem(STORAGE_KEY, scrollContainer.scrollTop);
106
- });
107
- });
108
-
109
- let scrollTimeout;
110
- scrollContainer.addEventListener('scroll', function() {
111
- clearTimeout(scrollTimeout);
112
- scrollTimeout = setTimeout(function() {
113
- sessionStorage.setItem(STORAGE_KEY, scrollContainer.scrollTop);
114
- }, 150);
115
- });
116
-
117
- const logo = document.querySelector('.header-logo');
118
- if (logo) {
119
- logo.addEventListener('click', function() {
120
- sessionStorage.removeItem(STORAGE_KEY);
121
- scrollContainer.scrollTop = 0;
122
- });
123
- }
124
- }
125
-
126
- function initScrollBehavior() {
127
- const header = document.querySelector('.header');
128
- const secondaryHeader = document.querySelector('.secondary-header');
129
-
130
- if (!header || !secondaryHeader) return;
131
-
132
- let lastScrollTop = 0;
133
- let ticking = false;
134
-
135
- function isMobile() {
136
- return window.innerWidth <= 1024;
137
- }
138
-
139
- function updateHeaders() {
140
- if (!isMobile()) {
141
- header.classList.remove('hide-on-scroll');
142
- secondaryHeader.classList.remove('shift-up');
143
- ticking = false;
144
- return;
145
- }
146
-
147
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
148
-
149
- if (scrollTop > lastScrollTop && scrollTop > 100) {
150
- header.classList.add('hide-on-scroll');
151
- secondaryHeader.classList.add('shift-up');
152
- } else if (scrollTop < lastScrollTop) {
153
- header.classList.remove('hide-on-scroll');
154
- secondaryHeader.classList.remove('shift-up');
155
- }
156
-
157
- lastScrollTop = scrollTop <= 0 ? 0 : scrollTop;
158
- ticking = false;
159
- }
160
-
161
- window.addEventListener('scroll', function() {
162
- if (!ticking) {
163
- window.requestAnimationFrame(updateHeaders);
164
- ticking = true;
165
- }
166
- });
167
-
168
- window.addEventListener('resize', function() {
169
- if (!isMobile()) {
170
- header.classList.remove('hide-on-scroll');
171
- secondaryHeader.classList.remove('shift-up');
172
- }
173
- });
174
- }
175
-
176
- if ('scrollRestoration' in history) {
177
- history.scrollRestoration = 'manual';
178
- }
179
-
180
21
  if (document.readyState === 'loading') {
181
- document.addEventListener('DOMContentLoaded', function() {
182
- initMobileMenu();
183
- initAccordion();
184
- initSidebarScroll();
185
- initScrollBehavior();
186
- });
22
+ document.addEventListener('DOMContentLoaded', initThemeToggle);
187
23
  } else {
188
- initMobileMenu();
189
- initAccordion();
190
- initSidebarScroll();
191
- initScrollBehavior();
24
+ initThemeToggle();
192
25
  }
193
26
  })();
@@ -0,0 +1,4 @@
1
+ <svg width="531" height="769" viewBox="0 0 531 769" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M359.643 59.1798C402.213 89.4398 449.713 123.6 502.063 160.99C510.793 167.23 515.873 170.31 519.293 178.05C523.253 187.02 521.733 198.11 515.883 205.77C513.77 208.536 510.93 211.2 507.363 213.76C379.643 305.353 309.413 355.73 296.673 364.89C287.987 371.136 282.07 374.8 278.923 375.88C269.703 379.026 260.263 378.636 250.603 374.71C248.243 373.75 244.497 371.416 239.363 367.71C199.963 339.29 177.32 322.99 171.433 318.81C128.863 288.54 81.3733 254.39 29.0233 216.99C20.2833 210.75 15.2033 207.67 11.7833 199.93C7.82332 190.96 9.34332 179.87 15.1933 172.21C17.3067 169.443 20.1467 166.78 23.7133 164.22C151.433 72.6264 221.663 22.2498 234.403 13.0898C243.09 6.84309 249.007 3.17976 252.153 2.09976C261.373 -1.04691 270.813 -0.656912 280.473 3.26976C282.833 4.22976 286.58 6.56309 291.713 10.2698C331.113 38.6898 353.757 54.9931 359.643 59.1798Z" fill="#DC2626"/>
3
+ <path d="M467.383 298.01C483.943 286.23 505.033 289.93 519.063 303.51C524.457 308.723 528.033 314.713 529.793 321.48C530.433 323.92 530.733 330.946 530.693 342.56C530.647 356.206 530.657 427.233 530.723 555.64C530.723 566.633 530.513 573 530.093 574.74C527.033 587.29 518.333 592.61 506.693 601.06C504.313 602.786 430.877 656.346 286.383 761.74C275.623 769.59 261.793 770.79 250.113 764.36C249.18 763.846 245.86 761.513 240.153 757.36C150.56 692.066 74.8667 637.046 13.0733 592.3C6.70001 587.68 2.65667 581.73 0.943337 574.45C0.316671 571.783 0.00333476 564.803 0.00333476 553.51C-0.00333191 421.323 -4.06895e-06 348.98 0.0133293 336.48C0.0133293 332.84 -0.0766665 327.18 0.783334 323.18C4.59333 305.51 20.1033 293.29 37.4533 291.15C42.9467 290.476 48.8667 291.276 55.2133 293.55C58.28 294.643 63.3533 297.8 70.4333 303.02C75.98 307.113 82.4433 311.78 89.8233 317.02C128.563 344.526 178.703 380.303 240.243 424.35C242.73 426.13 245.853 428.246 249.613 430.7C257.443 435.8 268.453 436.24 277.213 433.14C279.8 432.22 284.54 429.283 291.433 424.33C394.46 350.276 453.11 308.17 467.383 298.01Z" fill="#E5E5E5"/>
4
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg width="531" height="769" viewBox="0 0 531 769" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <style>
4
+ @media (prefers-color-scheme: dark) {
5
+ path[fill="#1E1E1D"] { fill: #E5E5E5; }
6
+ path[fill="#AB333D"] { fill: #DC2626; }
7
+ }
8
+ </style>
9
+ </defs>
10
+ <path d="M359.643 59.1798C402.213 89.4398 449.713 123.6 502.063 160.99C510.793 167.23 515.873 170.31 519.293 178.05C523.253 187.02 521.733 198.11 515.883 205.77C513.77 208.536 510.93 211.2 507.363 213.76C379.643 305.353 309.413 355.73 296.673 364.89C287.987 371.136 282.07 374.8 278.923 375.88C269.703 379.026 260.263 378.636 250.603 374.71C248.243 373.75 244.497 371.416 239.363 367.71C199.963 339.29 177.32 322.99 171.433 318.81C128.863 288.54 81.3733 254.39 29.0233 216.99C20.2833 210.75 15.2033 207.67 11.7833 199.93C7.82332 190.96 9.34332 179.87 15.1933 172.21C17.3067 169.443 20.1467 166.78 23.7133 164.22C151.433 72.6264 221.663 22.2498 234.403 13.0898C243.09 6.84309 249.007 3.17976 252.153 2.09976C261.373 -1.04691 270.813 -0.656912 280.473 3.26976C282.833 4.22976 286.58 6.56309 291.713 10.2698C331.113 38.6898 353.757 54.9931 359.643 59.1798Z" fill="#AB333D"/>
11
+ <path d="M467.383 298.01C483.943 286.23 505.033 289.93 519.063 303.51C524.457 308.723 528.033 314.713 529.793 321.48C530.433 323.92 530.733 330.946 530.693 342.56C530.647 356.206 530.657 427.233 530.723 555.64C530.723 566.633 530.513 573 530.093 574.74C527.033 587.29 518.333 592.61 506.693 601.06C504.313 602.786 430.877 656.346 286.383 761.74C275.623 769.59 261.793 770.79 250.113 764.36C249.18 763.846 245.86 761.513 240.153 757.36C150.56 692.066 74.8667 637.046 13.0733 592.3C6.70001 587.68 2.65667 581.73 0.943337 574.45C0.316671 571.783 0.00333476 564.803 0.00333476 553.51C-0.00333191 421.323 -4.06895e-06 348.98 0.0133293 336.48C0.0133293 332.84 -0.0766665 327.18 0.783334 323.18C4.59333 305.51 20.1033 293.29 37.4533 291.15C42.9467 290.476 48.8667 291.276 55.2133 293.55C58.28 294.643 63.3533 297.8 70.4333 303.02C75.98 307.113 82.4433 311.78 89.8233 317.02C128.563 344.526 178.703 380.303 240.243 424.35C242.73 426.13 245.853 428.246 249.613 430.7C257.443 435.8 268.453 436.24 277.213 433.14C279.8 432.22 284.54 429.283 291.433 424.33C394.46 350.276 453.11 308.17 467.383 298.01Z" fill="#1E1E1D"/>
12
+ </svg>
@@ -0,0 +1,42 @@
1
+ # Docyard Configuration
2
+ # Documentation: https://github.com/yourusername/docyard
3
+
4
+ # Site Information
5
+ site:
6
+ title: "My Documentation"
7
+ description: "Documentation for my project"
8
+
9
+ # Custom Branding (Optional)
10
+ # Paths relative to docs/ directory, or use URLs for CDN-hosted assets
11
+ branding:
12
+ # logo: "assets/logo.svg" # Light mode logo
13
+ # logo_dark: "assets/logo-dark.svg" # Dark mode logo (optional, falls back to 'logo')
14
+ # favicon: "assets/favicon.svg" # Browser tab icon
15
+ # appearance:
16
+ # logo: true # Show logo in header
17
+ # title: true # Show site title in header
18
+
19
+ # Sidebar Navigation (Optional)
20
+ # Customize the order and organization of your documentation pages
21
+ # Without this, sidebar is auto-generated from docs/ folder structure
22
+ # sidebar:
23
+ # items:
24
+ # - installation # Simple page reference
25
+ #
26
+ # - guides: # Nested group
27
+ # text: "User Guides"
28
+ # icon: "book-open" # Icon from phosphoricons.com
29
+ # items:
30
+ # - markdown-features
31
+ # - configuration
32
+ #
33
+ # - text: "GitHub" # External link
34
+ # link: "https://github.com/youruser/yourrepo"
35
+ # icon: "github-logo"
36
+ # target: "_blank"
37
+
38
+ # Build Configuration
39
+ build:
40
+ output_dir: "dist" # Output directory for static files
41
+ base_url: "/" # Base URL for deployment (e.g., "/docs/" for subdirectory)
42
+ clean: true # Clean output directory before building
@@ -3,8 +3,19 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta name="description" content="<%= @page_description || 'Documentation' %>">
7
- <title><%= @page_title || 'Documentation' %></title>
6
+ <meta name="description" content="<%= @site_description %>">
7
+ <title><%= @page_title %> | <%= @site_title %></title>
8
+ <link rel="icon" href="<%= asset_path(@favicon) %>" type="image/svg+xml">
9
+
10
+ <!-- Prevent flash of wrong theme -->
11
+ <script>
12
+ (function() {
13
+ const theme = localStorage.getItem('theme') ||
14
+ (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
15
+ document.documentElement.classList.toggle('dark', theme === 'dark');
16
+ })();
17
+ </script>
18
+
8
19
  <link rel="stylesheet" href="/assets/css/main.css">
9
20
  </head>
10
21
  <body>
@@ -14,9 +25,25 @@
14
25
  <!-- Primary Header -->
15
26
  <header class="header">
16
27
  <div class="header-content">
17
- <a href="/" class="header-logo">
18
- <span class="header-title"><%= @site_title || 'Documentation' %></span>
28
+ <a href="<%= link_path('/') %>" class="header-logo">
29
+ <% if @display_logo %>
30
+ <div class="site-logo-container">
31
+ <% if @logo %>
32
+ <img src="<%= asset_path(@logo) %>" alt="<%= @site_title %>" class="site-logo site-logo-light">
33
+ <% end %>
34
+ <% if @logo_dark %>
35
+ <img src="<%= asset_path(@logo_dark) %>" alt="<%= @site_title %>" class="site-logo site-logo-dark">
36
+ <% else %>
37
+ <img src="<%= asset_path(@logo) %>" alt="<%= @site_title %>" class="site-logo site-logo-dark">
38
+ <% end %>
39
+ </div>
40
+ <% end %>
41
+ <% if @display_title %>
42
+ <span class="header-title"><%= @site_title %></span>
43
+ <% end %>
19
44
  </a>
45
+
46
+ <%= render_partial('_theme_toggle') %>
20
47
  </div>
21
48
  </header>
22
49
 
@@ -46,6 +73,7 @@
46
73
  </div>
47
74
 
48
75
  <script src="/assets/js/theme.js"></script>
76
+ <script src="/assets/js/components.js"></script>
49
77
  <script src="/assets/js/reload.js"></script>
50
78
  </body>
51
79
  </html>
@@ -1,43 +1,77 @@
1
1
  # Installation
2
2
 
3
- Learn how to install Docyard on your system.
3
+ Get your documentation site up and running in minutes.
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - Ruby 3.2 or higher
8
- - Bundler (recommended)
7
+ ::: note Requirements
8
+ - Ruby 3.0 or higher
9
+ - Bundler (optional, for Gemfile-based projects)
10
+ :::
9
11
 
10
- ## Install via RubyGems
12
+ Check your Ruby version:
11
13
 
12
14
  ```bash
13
- gem install docyard
15
+ ruby --version
14
16
  ```
15
17
 
18
+ ## Install Docyard
16
19
 
17
- ## Install via Bundler
20
+ :::tabs
21
+ == Gem Install
22
+ ```bash
23
+ gem install docyard
24
+ ```
18
25
 
19
- Add to your Gemfile:
26
+ == Bundler
27
+ Add to your `Gemfile`:
20
28
 
21
29
  ```ruby
22
30
  gem 'docyard'
23
31
  ```
24
32
 
25
-
26
- Then run:
33
+ Then install:
27
34
 
28
35
  ```bash
29
36
  bundle install
30
37
  ```
38
+ :::
31
39
 
32
40
  ## Verify Installation
33
41
 
42
+ Check that Docyard was installed successfully:
43
+
34
44
  ```bash
35
- docyard --version
45
+ docyard version
36
46
  ```
37
47
 
48
+ ## Quick Start
49
+
50
+ Initialize a new documentation project:
51
+
52
+ ```bash
53
+ # Create new project
54
+ docyard init
55
+
56
+ # Start development server
57
+ docyard serve
58
+ ```
59
+
60
+ Visit [http://localhost:4200](http://localhost:4200) to see your documentation.
61
+
62
+ ## Available Commands
38
63
 
39
- You should see the version number printed to your terminal.
64
+ | Command | Description |
65
+ |---------|-------------|
66
+ | `docyard init` | Initialize a new documentation project |
67
+ | `docyard serve` | Start development server with hot reload |
68
+ | `docyard build` | Build static site for production |
69
+ | `docyard preview` | Preview production build locally |
40
70
 
41
71
  ## Next Steps
42
72
 
43
- Now that Docyard is installed, head over to the [Quick Start Guide](quick-start) to create your first documentation site.
73
+ ::: tip What's Next?
74
+ - Explore [Markdown Features](../guides/markdown-features) to see what you can do
75
+ - Learn about [Configuration](../guides/configuration) options
76
+ - Start writing your documentation!
77
+ :::
@@ -0,0 +1,202 @@
1
+ # Configuration
2
+
3
+ Customize your documentation site with `docyard.yml`.
4
+
5
+ ## Getting Started
6
+
7
+ Docyard works without any configuration, but you can customize it by creating a `docyard.yml` file in your project root.
8
+
9
+ ::: tip
10
+ The `docyard init` command creates a `docyard.yml` file with helpful examples.
11
+ :::
12
+
13
+ ## Basic Configuration
14
+
15
+ ```yaml
16
+ site:
17
+ title: "My Documentation"
18
+ description: "Documentation for my project"
19
+ ```
20
+
21
+ ## Branding
22
+
23
+ ### Custom Logo
24
+
25
+ Add your own logo:
26
+
27
+ ```yaml
28
+ branding:
29
+ logo: "assets/logo.svg" # Light mode logo
30
+ logo_dark: "assets/logo-dark.svg" # Dark mode logo (optional)
31
+ favicon: "assets/favicon.svg" # Browser tab icon
32
+ ```
33
+
34
+ ::: note File Paths
35
+ - Paths are relative to the `docs/` directory
36
+ - Or use full URLs: `https://cdn.example.com/logo.svg`
37
+ - Supported formats: SVG, PNG, JPG
38
+ :::
39
+
40
+ ### Logo Visibility
41
+
42
+ Control what appears in the header:
43
+
44
+ ```yaml
45
+ branding:
46
+ appearance:
47
+ logo: true # Show/hide logo
48
+ title: true # Show/hide site title
49
+ ```
50
+
51
+ ## Sidebar Navigation
52
+
53
+ Customize the sidebar structure and order:
54
+
55
+ ```yaml
56
+ sidebar:
57
+ items:
58
+ # Simple page reference
59
+ - installation
60
+
61
+ # Page with custom text
62
+ - quick-start:
63
+ text: "Quick Start Guide"
64
+
65
+ # Page with icon
66
+ - configuration:
67
+ text: "Configuration"
68
+ icon: "gear"
69
+
70
+ # Nested group
71
+ - guides:
72
+ text: "User Guides"
73
+ icon: "book-open"
74
+ items:
75
+ - markdown-features
76
+ - customization
77
+
78
+ # External link
79
+ - text: "GitHub"
80
+ link: "https://github.com/yourusername/yourproject"
81
+ icon: "github-logo"
82
+ target: "_blank"
83
+ ```
84
+
85
+ ::: tip Icons
86
+ Browse available icons at [phosphoricons.com](https://phosphoricons.com). Just use the icon name (e.g., `rocket-launch`, `book-open`).
87
+ :::
88
+
89
+ ### Collapsible Groups
90
+
91
+ Control whether groups start expanded or collapsed:
92
+
93
+ ```yaml
94
+ sidebar:
95
+ items:
96
+ - api:
97
+ text: "API Reference"
98
+ collapsed: true # Start collapsed
99
+ items:
100
+ - authentication
101
+ - endpoints
102
+ - errors
103
+ ```
104
+
105
+ ## Build Configuration
106
+
107
+ Configure the build output:
108
+
109
+ ```yaml
110
+ build:
111
+ output_dir: "dist" # Output directory for built site
112
+ base_url: "/" # Base URL for deployment
113
+ clean: true # Clean output directory before building
114
+ ```
115
+
116
+ ### Base URL
117
+
118
+ Set the base URL for subdirectory deployments:
119
+
120
+ ```yaml
121
+ build:
122
+ base_url: "/docs/" # For example.com/docs/
123
+ ```
124
+
125
+ ::: warning Base URL
126
+ If deploying to a subdirectory, make sure base_url matches your deployment path. Otherwise assets won't load correctly.
127
+ :::
128
+
129
+ ## Complete Example
130
+
131
+ Here's a full configuration file:
132
+
133
+ ```yaml
134
+ site:
135
+ title: "Acme API Documentation"
136
+ description: "Official API documentation for Acme"
137
+
138
+ branding:
139
+ logo: "assets/logo.svg"
140
+ logo_dark: "assets/logo-dark.svg"
141
+ favicon: "assets/favicon.svg"
142
+ appearance:
143
+ logo: true
144
+ title: true
145
+
146
+ sidebar:
147
+ items:
148
+ - index
149
+
150
+ - getting-started:
151
+ text: "Getting Started"
152
+ icon: "rocket-launch"
153
+ items:
154
+ - installation
155
+ - authentication
156
+ - quick-start
157
+
158
+ - guides:
159
+ text: "Guides"
160
+ icon: "book-open"
161
+ items:
162
+ - making-requests
163
+ - error-handling
164
+ - rate-limiting
165
+
166
+ - api:
167
+ text: "API Reference"
168
+ icon: "code"
169
+ collapsed: false
170
+ items:
171
+ - users
172
+ - products
173
+ - orders
174
+
175
+ - text: "GitHub"
176
+ link: "https://github.com/acme/api"
177
+ icon: "github-logo"
178
+ target: "_blank"
179
+
180
+ build:
181
+ output_dir: "dist"
182
+ base_url: "/api/"
183
+ clean: true
184
+ ```
185
+
186
+ ## Configuration Tips
187
+
188
+ ::: tip Best Practices
189
+ 1. **Start simple** - Add configuration as you need it
190
+ 2. **Use icons consistently** - Pick a set and stick with it
191
+ 3. **Organize logically** - Group related pages together
192
+ 4. **Test base_url** - Preview with `docyard preview` before deploying
193
+ 5. **Keep it maintainable** - Don't over-configure
194
+ :::
195
+
196
+ ## Next Steps
197
+
198
+ ::: note
199
+ - Learn about [markdown features](markdown-features)
200
+ - Check the [installation guide](../getting-started/installation)
201
+ - Start customizing your site!
202
+ :::