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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docyard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanif Himani
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: cssminify
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: kramdown
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +107,20 @@ dependencies:
93
107
  - - "~>"
94
108
  - !ruby/object:Gem::Version
95
109
  version: '4.0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: terser
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '1.2'
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '1.2'
96
124
  - !ruby/object:Gem::Dependency
97
125
  name: thor
98
126
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +135,20 @@ dependencies:
107
135
  - - "~>"
108
136
  - !ruby/object:Gem::Version
109
137
  version: '1.4'
138
+ - !ruby/object:Gem::Dependency
139
+ name: tty-progressbar
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '0.18'
145
+ type: :runtime
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.18'
110
152
  - !ruby/object:Gem::Dependency
111
153
  name: webrick
112
154
  requirement: !ruby/object:Gem::Requirement
@@ -137,47 +179,87 @@ files:
137
179
  - CODE_OF_CONDUCT.md
138
180
  - CONTRIBUTING.md
139
181
  - LICENSE.txt
182
+ - LICENSE.vscode-icons
140
183
  - README.md
141
184
  - Rakefile
142
185
  - lib/docyard.rb
143
186
  - lib/docyard/asset_handler.rb
187
+ - lib/docyard/build/asset_bundler.rb
188
+ - lib/docyard/build/file_copier.rb
189
+ - lib/docyard/build/sitemap_generator.rb
190
+ - lib/docyard/build/static_generator.rb
191
+ - lib/docyard/builder.rb
144
192
  - lib/docyard/cli.rb
193
+ - lib/docyard/components/base_processor.rb
194
+ - lib/docyard/components/callout_processor.rb
195
+ - lib/docyard/components/code_block_processor.rb
196
+ - lib/docyard/components/code_detector.rb
197
+ - lib/docyard/components/icon_detector.rb
198
+ - lib/docyard/components/icon_processor.rb
199
+ - lib/docyard/components/registry.rb
200
+ - lib/docyard/components/table_wrapper_processor.rb
201
+ - lib/docyard/components/tabs_parser.rb
202
+ - lib/docyard/components/tabs_processor.rb
203
+ - lib/docyard/config.rb
204
+ - lib/docyard/config/validator.rb
145
205
  - lib/docyard/constants.rb
146
206
  - lib/docyard/errors.rb
147
207
  - lib/docyard/file_watcher.rb
208
+ - lib/docyard/icons.rb
209
+ - lib/docyard/icons/LICENSE.phosphor
210
+ - lib/docyard/icons/file_types.rb
211
+ - lib/docyard/icons/phosphor.rb
148
212
  - lib/docyard/initializer.rb
213
+ - lib/docyard/language_mapping.rb
149
214
  - lib/docyard/logging.rb
150
215
  - lib/docyard/markdown.rb
216
+ - lib/docyard/preview_server.rb
151
217
  - lib/docyard/rack_application.rb
152
218
  - lib/docyard/renderer.rb
153
219
  - lib/docyard/router.rb
154
220
  - lib/docyard/routing/resolution_result.rb
155
221
  - lib/docyard/server.rb
222
+ - lib/docyard/sidebar/config_parser.rb
156
223
  - lib/docyard/sidebar/file_system_scanner.rb
224
+ - lib/docyard/sidebar/item.rb
157
225
  - lib/docyard/sidebar/renderer.rb
158
226
  - lib/docyard/sidebar/title_extractor.rb
159
227
  - lib/docyard/sidebar/tree_builder.rb
160
228
  - lib/docyard/sidebar_builder.rb
161
229
  - lib/docyard/templates/assets/css/code.css
162
- - lib/docyard/templates/assets/css/components.css
230
+ - lib/docyard/templates/assets/css/components/callout.css
231
+ - lib/docyard/templates/assets/css/components/code-block.css
232
+ - lib/docyard/templates/assets/css/components/icon.css
233
+ - lib/docyard/templates/assets/css/components/logo.css
234
+ - lib/docyard/templates/assets/css/components/navigation.css
235
+ - lib/docyard/templates/assets/css/components/tabs.css
236
+ - lib/docyard/templates/assets/css/components/theme-toggle.css
163
237
  - lib/docyard/templates/assets/css/layout.css
164
238
  - lib/docyard/templates/assets/css/main.css
165
239
  - lib/docyard/templates/assets/css/markdown.css
166
240
  - lib/docyard/templates/assets/css/reset.css
167
241
  - lib/docyard/templates/assets/css/typography.css
168
242
  - lib/docyard/templates/assets/css/variables.css
243
+ - lib/docyard/templates/assets/favicon.svg
244
+ - lib/docyard/templates/assets/js/components/code-block.js
245
+ - lib/docyard/templates/assets/js/components/navigation.js
246
+ - lib/docyard/templates/assets/js/components/tabs.js
169
247
  - lib/docyard/templates/assets/js/reload.js
170
248
  - lib/docyard/templates/assets/js/theme.js
249
+ - lib/docyard/templates/assets/logo-dark.svg
250
+ - lib/docyard/templates/assets/logo.svg
251
+ - lib/docyard/templates/config/docyard.yml.erb
171
252
  - lib/docyard/templates/errors/404.html.erb
172
253
  - lib/docyard/templates/errors/500.html.erb
173
254
  - lib/docyard/templates/layouts/default.html.erb
174
- - lib/docyard/templates/markdown/core-concepts/file-structure.md.erb
175
- - lib/docyard/templates/markdown/core-concepts/markdown.md.erb
176
255
  - lib/docyard/templates/markdown/getting-started/installation.md.erb
177
- - lib/docyard/templates/markdown/getting-started/introduction.md.erb
178
- - lib/docyard/templates/markdown/getting-started/quick-start.md.erb
256
+ - lib/docyard/templates/markdown/guides/configuration.md.erb
257
+ - lib/docyard/templates/markdown/guides/markdown-features.md.erb
179
258
  - lib/docyard/templates/markdown/index.md.erb
180
- - lib/docyard/templates/partials/_icons.html.erb
259
+ - lib/docyard/templates/partials/_callout.html.erb
260
+ - lib/docyard/templates/partials/_code_block.html.erb
261
+ - lib/docyard/templates/partials/_icon.html.erb
262
+ - lib/docyard/templates/partials/_icon_file_extension.html.erb
181
263
  - lib/docyard/templates/partials/_nav_group.html.erb
182
264
  - lib/docyard/templates/partials/_nav_item.html.erb
183
265
  - lib/docyard/templates/partials/_nav_leaf.html.erb
@@ -185,6 +267,8 @@ files:
185
267
  - lib/docyard/templates/partials/_nav_section.html.erb
186
268
  - lib/docyard/templates/partials/_sidebar.html.erb
187
269
  - lib/docyard/templates/partials/_sidebar_footer.html.erb
270
+ - lib/docyard/templates/partials/_tabs.html.erb
271
+ - lib/docyard/templates/partials/_theme_toggle.html.erb
188
272
  - lib/docyard/utils/path_resolver.rb
189
273
  - lib/docyard/utils/text_formatter.rb
190
274
  - lib/docyard/version.rb
@@ -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 %>