docyard 0.3.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -1
  3. data/README.md +55 -33
  4. data/lib/docyard/build/asset_bundler.rb +139 -0
  5. data/lib/docyard/build/file_copier.rb +105 -0
  6. data/lib/docyard/build/sitemap_generator.rb +57 -0
  7. data/lib/docyard/build/static_generator.rb +141 -0
  8. data/lib/docyard/builder.rb +104 -0
  9. data/lib/docyard/cli.rb +19 -0
  10. data/lib/docyard/components/table_wrapper_processor.rb +18 -0
  11. data/lib/docyard/config.rb +4 -2
  12. data/lib/docyard/icons/phosphor.rb +1 -0
  13. data/lib/docyard/initializer.rb +80 -14
  14. data/lib/docyard/markdown.rb +13 -0
  15. data/lib/docyard/preview_server.rb +72 -0
  16. data/lib/docyard/rack_application.rb +1 -1
  17. data/lib/docyard/renderer.rb +17 -3
  18. data/lib/docyard/sidebar/config_parser.rb +180 -0
  19. data/lib/docyard/sidebar/item.rb +58 -0
  20. data/lib/docyard/sidebar/renderer.rb +33 -6
  21. data/lib/docyard/sidebar_builder.rb +45 -1
  22. data/lib/docyard/templates/assets/css/components/callout.css +1 -1
  23. data/lib/docyard/templates/assets/css/components/code-block.css +2 -2
  24. data/lib/docyard/templates/assets/css/components/navigation.css +65 -7
  25. data/lib/docyard/templates/assets/css/components/tabs.css +3 -2
  26. data/lib/docyard/templates/assets/css/components/theme-toggle.css +8 -0
  27. data/lib/docyard/templates/assets/css/markdown.css +20 -11
  28. data/lib/docyard/templates/assets/js/components/navigation.js +221 -0
  29. data/lib/docyard/templates/assets/js/theme.js +2 -185
  30. data/lib/docyard/templates/config/docyard.yml.erb +32 -10
  31. data/lib/docyard/templates/layouts/default.html.erb +1 -1
  32. data/lib/docyard/templates/markdown/getting-started/installation.md.erb +46 -12
  33. data/lib/docyard/templates/markdown/guides/configuration.md.erb +202 -0
  34. data/lib/docyard/templates/markdown/guides/markdown-features.md.erb +247 -0
  35. data/lib/docyard/templates/markdown/index.md.erb +55 -59
  36. data/lib/docyard/templates/partials/_nav_group.html.erb +10 -4
  37. data/lib/docyard/templates/partials/_nav_leaf.html.erb +9 -1
  38. data/lib/docyard/version.rb +1 -1
  39. data/lib/docyard.rb +8 -0
  40. metadata +55 -10
  41. data/lib/docyard/templates/markdown/components/callouts.md.erb +0 -204
  42. data/lib/docyard/templates/markdown/components/icons.md.erb +0 -125
  43. data/lib/docyard/templates/markdown/components/tabs.md.erb +0 -686
  44. data/lib/docyard/templates/markdown/configuration.md.erb +0 -202
  45. data/lib/docyard/templates/markdown/core-concepts/file-structure.md.erb +0 -61
  46. data/lib/docyard/templates/markdown/core-concepts/markdown.md.erb +0 -90
  47. data/lib/docyard/templates/markdown/getting-started/introduction.md.erb +0 -30
  48. data/lib/docyard/templates/markdown/getting-started/quick-start.md.erb +0 -56
  49. data/lib/docyard/templates/partials/_icons.html.erb +0 -11
@@ -1,202 +0,0 @@
1
- ---
2
- title: Configuration
3
- ---
4
-
5
- # Configuration
6
-
7
- Docyard uses convention over configuration. You can start using Docyard without any configuration file - it just works!
8
-
9
- ## Optional Configuration
10
-
11
- Create a `docyard.yml` file in your project root to customize your documentation site.
12
-
13
- ```yaml
14
- site:
15
- title: "My Documentation"
16
- description: "Documentation for my project"
17
-
18
- build:
19
- output_dir: "dist"
20
- base_url: "/"
21
- ```
22
-
23
- ## Configuration Reference
24
-
25
- ### Site Settings
26
-
27
- Configure your site metadata and branding.
28
-
29
- #### `site.title`
30
-
31
- The title of your documentation site. Shown in the browser tab and header.
32
-
33
- - **Type:** String
34
- - **Default:** `"Documentation"`
35
-
36
- ```yaml
37
- site:
38
- title: "My Project Docs"
39
- ```
40
-
41
- #### `site.description`
42
-
43
- Meta description for SEO and social sharing.
44
-
45
- - **Type:** String
46
- - **Default:** `""`
47
-
48
- ```yaml
49
- site:
50
- description: "Complete documentation for My Project"
51
- ```
52
-
53
- #### `site.logo`
54
-
55
- Path to your logo image. Displayed in the site header.
56
-
57
- - **Type:** String (file path)
58
- - **Default:** None
59
- - **Supported formats:** SVG, PNG, JPG
60
-
61
- ```yaml
62
- site:
63
- logo: "docs/assets/logo.svg"
64
- ```
65
-
66
- ::: tip
67
- Use SVG format for your logo for best quality at all screen sizes.
68
- :::
69
-
70
- #### `site.logo_dark`
71
-
72
- Optional dark mode variant of your logo.
73
-
74
- - **Type:** String (file path)
75
- - **Default:** None
76
-
77
- ```yaml
78
- site:
79
- logo: "docs/assets/logo.svg"
80
- logo_dark: "docs/assets/logo-dark.svg"
81
- ```
82
-
83
- #### `site.favicon`
84
-
85
- Path to your favicon.
86
-
87
- - **Type:** String (file path)
88
- - **Default:** None
89
- - **Supported formats:** `.ico`, `.png`
90
-
91
- ```yaml
92
- site:
93
- favicon: "docs/assets/favicon.ico"
94
- ```
95
-
96
- ### Build Settings
97
-
98
- Configure static site generation.
99
-
100
- #### `build.output_dir`
101
-
102
- Directory where the built site will be generated.
103
-
104
- - **Type:** String
105
- - **Default:** `"dist"`
106
- - **Note:** Cannot contain slashes
107
-
108
- ```yaml
109
- build:
110
- output_dir: "dist" # or "_site", "public", etc.
111
- ```
112
-
113
- #### `build.base_url`
114
-
115
- Base URL for your site. Important for subdirectory deployments.
116
-
117
- - **Type:** String
118
- - **Default:** `"/"`
119
- - **Note:** Must start with `/`
120
-
121
- ```yaml
122
- # For root deployment
123
- build:
124
- base_url: "/"
125
-
126
- # For GitHub Pages project site
127
- build:
128
- base_url: "/my-repo/"
129
- ```
130
-
131
- ::: important
132
- Set `base_url` correctly for subdirectory deployments (like GitHub Pages project sites) or your assets won't load correctly.
133
- :::
134
-
135
- #### `build.clean`
136
-
137
- Whether to clean the output directory before building.
138
-
139
- - **Type:** Boolean
140
- - **Default:** `true`
141
-
142
- ```yaml
143
- build:
144
- clean: true # Recommended
145
- ```
146
-
147
- ## Examples
148
-
149
- ### Basic Configuration
150
-
151
- Minimal config with just a custom title:
152
-
153
- ```yaml
154
- site:
155
- title: "Acme Documentation"
156
- ```
157
-
158
- ### Full Branding
159
-
160
- Complete branding with logo and favicon:
161
-
162
- ```yaml
163
- site:
164
- title: "Acme Inc."
165
- description: "API documentation for Acme services"
166
- logo: "docs/assets/logo.svg"
167
- logo_dark: "docs/assets/logo-dark.svg"
168
- favicon: "docs/assets/favicon.ico"
169
- ```
170
-
171
- ### GitHub Pages Deployment
172
-
173
- Configuration for GitHub Pages subdirectory:
174
-
175
- ```yaml
176
- site:
177
- title: "My Project"
178
-
179
- build:
180
- base_url: "/my-repo/"
181
- ```
182
-
183
- ### Custom Output Directory
184
-
185
- Using a different output directory:
186
-
187
- ```yaml
188
- build:
189
- output_dir: "public"
190
- base_url: "/"
191
- ```
192
-
193
- ## No Configuration Required
194
-
195
- If you don't create a `docyard.yml` file, Docyard will work with sensible defaults:
196
-
197
- - Site title: `"Documentation"`
198
- - Output directory: `dist/`
199
- - Base URL: `/`
200
- - Clean build: `true`
201
-
202
- This means you can run `docyard serve` immediately after `docyard init` without any additional configuration!
@@ -1,61 +0,0 @@
1
- # File Structure
2
-
3
- Understanding how Docyard organizes your documentation.
4
-
5
- ## Basic Structure
6
-
7
- ```bash
8
- docs/
9
- ├── index.md # Home page
10
- ├── getting-started/ # Section folder
11
- │ ├── introduction.md
12
- │ └── quick-start.md
13
- └── guides/ # Another section
14
- └── tutorial.md
15
- ```
16
-
17
- ## Navigation Rules
18
-
19
- - **Folders become sections** in the sidebar navigation
20
- - **Files become pages** within those sections
21
- - Files are sorted alphabetically
22
- - `index.md` in the root is your home page
23
-
24
- ## File Naming
25
-
26
- File names are automatically converted to page titles:
27
-
28
- - `quick-start.md` → "Quick Start"
29
- - `api-reference.md` → "Api Reference"
30
- - `getting_started.md` → "Getting Started"
31
-
32
- ## Custom Titles
33
-
34
- Override the auto-generated title using an H1 heading:
35
-
36
- ```markdown
37
- # Custom Page Title
38
-
39
- Your content here...
40
- ```
41
-
42
- ## Hidden Files
43
-
44
- Files and folders starting with `_` or `.` are ignored:
45
-
46
- - `_draft.md` - Not included
47
- - `.notes.md` - Not included
48
- - `published.md` - Included
49
-
50
- ## Nested Sections
51
-
52
- You can nest folders to create sub-sections:
53
-
54
- ```bash
55
- docs/
56
- └── api/
57
- ├── classes/
58
- │ └── generator.md
59
- └── modules/
60
- └── utils.md
61
- ```
@@ -1,90 +0,0 @@
1
- # Markdown Support
2
-
3
- Docyard supports GitHub Flavored Markdown with syntax highlighting.
4
-
5
- ## Headings
6
-
7
- ```markdown
8
- # H1 Heading
9
- ## H2 Heading
10
- ### H3 Heading
11
- ```
12
-
13
-
14
- ## Text Formatting
15
-
16
- **Bold text** with `**bold**`
17
- *Italic text* with `*italic*`
18
- ~~Strikethrough~~ with `~~strikethrough~~`
19
-
20
- ## Lists
21
-
22
- Unordered lists:
23
-
24
- - Item 1
25
- - Item 2
26
- - Nested item
27
- - Another nested
28
-
29
- Ordered lists:
30
-
31
- 1. First step
32
- 2. Second step
33
- 3. Third step
34
-
35
- ## Code
36
-
37
- Inline code: `const x = 42`
38
-
39
- Code blocks with syntax highlighting:
40
-
41
- ```ruby
42
- class DocumentationGenerator
43
- def initialize(title)
44
- @title = title
45
- end
46
-
47
- def build
48
- puts "Building #{@title}..."
49
- end
50
- end
51
- ```
52
-
53
- ```javascript
54
- function generateDocs(title) {
55
- console.log(`Building ${title}...`);
56
- return { success: true };
57
- }
58
- ```
59
-
60
-
61
- ## Tables
62
-
63
- | Feature | Status | Priority |
64
- |---------|--------|----------|
65
- | Sidebar | Done | High |
66
- | Search | Planned | Medium |
67
- | Dark Mode | Planned | High |
68
-
69
- ## Links
70
-
71
- [External link](https://github.com)
72
- [Internal link](file-structure)
73
- [Link to section](../getting-started/installation)
74
-
75
- ## Blockquotes
76
-
77
- > This is a blockquote. Use it to highlight important information or callouts.
78
-
79
- ## Images
80
-
81
- ```markdown
82
- ![Alt text](/path/to/image.png)
83
- ```
84
-
85
-
86
- ## Task Lists
87
-
88
- - [x] Completed task
89
- - [ ] Incomplete task
90
- - [ ] Another task
@@ -1,30 +0,0 @@
1
- # Introduction
2
-
3
- Welcome to Docyard - a modern, zero-config documentation generator for Ruby developers.
4
-
5
- ## What is Docyard?
6
-
7
- Docyard turns your Markdown files into beautiful, searchable documentation sites. Write docs in Markdown, and Docyard handles the rest.
8
-
9
- ## Key Features
10
-
11
- - **Auto-generated Navigation** - Sidebar navigation built from your folder structure
12
- - **Hot Reload** - See changes instantly as you write
13
- - **GitHub Flavored Markdown** - Full GFM support including tables and task lists
14
- - **Syntax Highlighting** - 100+ languages powered by Rouge
15
- - **Zero Configuration** - Works out of the box with sensible defaults
16
- - **Mobile Responsive** - Looks great on all devices
17
-
18
- ## Philosophy
19
-
20
- Docyard follows these principles:
21
-
22
- 1. **Simple by default** - No configuration needed to get started
23
- 2. **Markdown-first** - Focus on writing, not tooling
24
- 3. **Beautiful out of the box** - Production-ready styling included
25
- 4. **Developer friendly** - Built by developers, for developers
26
-
27
- ## Next Steps
28
-
29
- - [Install Docyard](installation) to get started
30
- - Check out the [Quick Start Guide](quick-start) for a 5-minute tutorial
@@ -1,56 +0,0 @@
1
- # Quick Start
2
-
3
- Get up and running with Docyard in under 5 minutes.
4
-
5
- ## 1. Install Docyard
6
-
7
- ```bash
8
- gem install docyard
9
- ```
10
-
11
- ## 2. Initialize Your Project
12
-
13
- Create a new documentation project:
14
-
15
- ```bash
16
- docyard init
17
- ```
18
-
19
-
20
- This creates a `docs/` folder with sample documentation files.
21
-
22
- ## 3. Start the Dev Server
23
-
24
- ```bash
25
- docyard serve
26
- ```
27
-
28
-
29
- Your documentation will be available at `http://localhost:4200`.
30
-
31
- ## 4. Edit Your Docs
32
-
33
- Open `docs/index.md` and make some changes. The browser will automatically reload to show your changes.
34
-
35
- ## 5. Organize Your Content
36
-
37
- Create folders to organize your documentation:
38
-
39
- ```bash
40
- docs/
41
- ├── index.md
42
- ├── getting-started/
43
- │ ├── introduction.md
44
- │ └── installation.md
45
- └── guides/
46
- ├── basic-usage.md
47
- └── advanced-features.md
48
- ```
49
-
50
-
51
- The sidebar navigation will automatically reflect your folder structure.
52
-
53
- ## What's Next?
54
-
55
- - Learn about [File Structure](../core-concepts/file-structure) conventions
56
- - Explore [Markdown](../core-concepts/markdown) syntax and features
@@ -1,11 +0,0 @@
1
- <%# External link icon %>
2
- <% if @icon_name == :external %>
3
- <svg class="external-icon" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256">
4
- <path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z" />
5
- </svg>
6
- <%# Chevron icon %>
7
- <% elsif @icon_name == :chevron %>
8
- <svg class="nav-group-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor">
9
- <path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/>
10
- </svg>
11
- <% end %>