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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -1
- data/LICENSE.vscode-icons +42 -0
- data/README.md +86 -23
- data/lib/docyard/asset_handler.rb +33 -0
- data/lib/docyard/build/asset_bundler.rb +139 -0
- data/lib/docyard/build/file_copier.rb +105 -0
- data/lib/docyard/build/sitemap_generator.rb +57 -0
- data/lib/docyard/build/static_generator.rb +141 -0
- data/lib/docyard/builder.rb +104 -0
- data/lib/docyard/cli.rb +19 -0
- data/lib/docyard/components/base_processor.rb +24 -0
- data/lib/docyard/components/callout_processor.rb +121 -0
- data/lib/docyard/components/code_block_processor.rb +55 -0
- data/lib/docyard/components/code_detector.rb +59 -0
- data/lib/docyard/components/icon_detector.rb +57 -0
- data/lib/docyard/components/icon_processor.rb +51 -0
- data/lib/docyard/components/registry.rb +34 -0
- data/lib/docyard/components/table_wrapper_processor.rb +18 -0
- data/lib/docyard/components/tabs_parser.rb +60 -0
- data/lib/docyard/components/tabs_processor.rb +44 -0
- data/lib/docyard/config/validator.rb +171 -0
- data/lib/docyard/config.rb +135 -0
- data/lib/docyard/constants.rb +5 -0
- data/lib/docyard/icons/LICENSE.phosphor +21 -0
- data/lib/docyard/icons/file_types.rb +92 -0
- data/lib/docyard/icons/phosphor.rb +64 -0
- data/lib/docyard/icons.rb +40 -0
- data/lib/docyard/initializer.rb +93 -9
- data/lib/docyard/language_mapping.rb +52 -0
- data/lib/docyard/markdown.rb +27 -3
- data/lib/docyard/preview_server.rb +72 -0
- data/lib/docyard/rack_application.rb +77 -8
- data/lib/docyard/renderer.rb +56 -9
- data/lib/docyard/server.rb +5 -2
- data/lib/docyard/sidebar/config_parser.rb +180 -0
- data/lib/docyard/sidebar/item.rb +58 -0
- data/lib/docyard/sidebar/renderer.rb +33 -6
- data/lib/docyard/sidebar_builder.rb +54 -2
- data/lib/docyard/templates/assets/css/code.css +150 -2
- data/lib/docyard/templates/assets/css/components/callout.css +169 -0
- data/lib/docyard/templates/assets/css/components/code-block.css +196 -0
- data/lib/docyard/templates/assets/css/components/icon.css +16 -0
- data/lib/docyard/templates/assets/css/components/logo.css +44 -0
- data/lib/docyard/templates/assets/css/{components.css → components/navigation.css} +111 -53
- data/lib/docyard/templates/assets/css/components/tabs.css +299 -0
- data/lib/docyard/templates/assets/css/components/theme-toggle.css +69 -0
- data/lib/docyard/templates/assets/css/layout.css +14 -4
- data/lib/docyard/templates/assets/css/markdown.css +27 -17
- data/lib/docyard/templates/assets/css/reset.css +4 -0
- data/lib/docyard/templates/assets/css/variables.css +94 -3
- data/lib/docyard/templates/assets/favicon.svg +16 -0
- data/lib/docyard/templates/assets/js/components/code-block.js +162 -0
- data/lib/docyard/templates/assets/js/components/navigation.js +221 -0
- data/lib/docyard/templates/assets/js/components/tabs.js +338 -0
- data/lib/docyard/templates/assets/js/theme.js +12 -179
- data/lib/docyard/templates/assets/logo-dark.svg +4 -0
- data/lib/docyard/templates/assets/logo.svg +12 -0
- data/lib/docyard/templates/config/docyard.yml.erb +42 -0
- data/lib/docyard/templates/layouts/default.html.erb +32 -4
- data/lib/docyard/templates/markdown/getting-started/installation.md.erb +46 -12
- data/lib/docyard/templates/markdown/guides/configuration.md.erb +202 -0
- data/lib/docyard/templates/markdown/guides/markdown-features.md.erb +247 -0
- data/lib/docyard/templates/markdown/index.md.erb +55 -59
- data/lib/docyard/templates/partials/_callout.html.erb +11 -0
- data/lib/docyard/templates/partials/_code_block.html.erb +6 -0
- data/lib/docyard/templates/partials/_icon.html.erb +1 -0
- data/lib/docyard/templates/partials/_icon_file_extension.html.erb +1 -0
- data/lib/docyard/templates/partials/_nav_group.html.erb +10 -4
- data/lib/docyard/templates/partials/_nav_leaf.html.erb +9 -1
- data/lib/docyard/templates/partials/_tabs.html.erb +40 -0
- data/lib/docyard/templates/partials/_theme_toggle.html.erb +13 -0
- data/lib/docyard/version.rb +1 -1
- data/lib/docyard.rb +8 -0
- metadata +91 -7
- data/lib/docyard/templates/markdown/core-concepts/file-structure.md.erb +0 -61
- data/lib/docyard/templates/markdown/core-concepts/markdown.md.erb +0 -90
- data/lib/docyard/templates/markdown/getting-started/introduction.md.erb +0 -30
- data/lib/docyard/templates/markdown/getting-started/quick-start.md.erb +0 -56
- data/lib/docyard/templates/partials/_icons.html.erb +0 -11
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Markdown Features
|
|
2
|
+
|
|
3
|
+
Docyard supports GitHub Flavored Markdown (GFM) plus powerful custom components.
|
|
4
|
+
|
|
5
|
+
## Basic Formatting
|
|
6
|
+
|
|
7
|
+
Use standard markdown syntax for formatting:
|
|
8
|
+
|
|
9
|
+
**Bold text** with `**bold**` or `__bold__`
|
|
10
|
+
|
|
11
|
+
*Italic text* with `*italic*` or `_italic_`
|
|
12
|
+
|
|
13
|
+
`Inline code` with \`backticks\`
|
|
14
|
+
|
|
15
|
+
~~Strikethrough~~ with `~~text~~`
|
|
16
|
+
|
|
17
|
+
## Headings
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
# H1 Heading
|
|
21
|
+
## H2 Heading
|
|
22
|
+
### H3 Heading
|
|
23
|
+
#### H4 Heading
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Lists
|
|
27
|
+
|
|
28
|
+
Unordered lists:
|
|
29
|
+
|
|
30
|
+
- Item one
|
|
31
|
+
- Item two
|
|
32
|
+
- Nested item
|
|
33
|
+
- Another nested item
|
|
34
|
+
- Item three
|
|
35
|
+
|
|
36
|
+
Ordered lists:
|
|
37
|
+
|
|
38
|
+
1. First step
|
|
39
|
+
2. Second step
|
|
40
|
+
3. Third step
|
|
41
|
+
|
|
42
|
+
Task lists:
|
|
43
|
+
|
|
44
|
+
- [x] Completed task
|
|
45
|
+
- [ ] Pending task
|
|
46
|
+
- [ ] Another pending task
|
|
47
|
+
|
|
48
|
+
## Code Blocks
|
|
49
|
+
|
|
50
|
+
Syntax highlighting for 100+ languages powered by Rouge:
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
function greet(name) {
|
|
54
|
+
return `Hello, ${name}!`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.log(greet('World'));
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
def greet(name):
|
|
62
|
+
return f"Hello, {name}!"
|
|
63
|
+
|
|
64
|
+
print(greet('World'))
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```ruby
|
|
68
|
+
def greet(name)
|
|
69
|
+
"Hello, #{name}!"
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
puts greet('World')
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Each code block includes a copy button for easy copying.
|
|
76
|
+
|
|
77
|
+
## Tables
|
|
78
|
+
|
|
79
|
+
Create responsive tables with GFM syntax:
|
|
80
|
+
|
|
81
|
+
| Feature | Supported | Notes |
|
|
82
|
+
|---------|-----------|-------|
|
|
83
|
+
| Syntax highlighting | ✓ | 100+ languages |
|
|
84
|
+
| Hot reload | ✓ | Instant updates |
|
|
85
|
+
| Dark mode | ✓ | Auto-switching |
|
|
86
|
+
| Mobile responsive | ✓ | Works everywhere |
|
|
87
|
+
|
|
88
|
+
Tables automatically wrap on mobile devices.
|
|
89
|
+
|
|
90
|
+
## Blockquotes
|
|
91
|
+
|
|
92
|
+
> Standard blockquote for citations or highlights.
|
|
93
|
+
>
|
|
94
|
+
> Supports multiple paragraphs.
|
|
95
|
+
|
|
96
|
+
## Links
|
|
97
|
+
|
|
98
|
+
[Link to a page](../getting-started/installation)
|
|
99
|
+
|
|
100
|
+
[External link](https://github.com)
|
|
101
|
+
|
|
102
|
+
## Callouts
|
|
103
|
+
|
|
104
|
+
Use callouts to highlight important information:
|
|
105
|
+
|
|
106
|
+
::: note
|
|
107
|
+
Informational content that provides additional context.
|
|
108
|
+
:::
|
|
109
|
+
|
|
110
|
+
::: tip Best Practice
|
|
111
|
+
Helpful advice or recommendations for users.
|
|
112
|
+
:::
|
|
113
|
+
|
|
114
|
+
::: important
|
|
115
|
+
Critical information that requires special attention.
|
|
116
|
+
:::
|
|
117
|
+
|
|
118
|
+
::: warning
|
|
119
|
+
Caution about potential issues or things to watch out for.
|
|
120
|
+
:::
|
|
121
|
+
|
|
122
|
+
::: danger
|
|
123
|
+
Severe warnings about dangerous operations or critical issues.
|
|
124
|
+
:::
|
|
125
|
+
|
|
126
|
+
### Custom Titles
|
|
127
|
+
|
|
128
|
+
::: tip Performance Optimization
|
|
129
|
+
You can customize the title of any callout type.
|
|
130
|
+
:::
|
|
131
|
+
|
|
132
|
+
### Rich Content
|
|
133
|
+
|
|
134
|
+
::: important Key Requirements
|
|
135
|
+
Callouts support all markdown features:
|
|
136
|
+
|
|
137
|
+
- **Lists** and formatting
|
|
138
|
+
- `Code snippets`
|
|
139
|
+
- [Links](/)
|
|
140
|
+
- Code blocks with syntax highlighting
|
|
141
|
+
|
|
142
|
+
```ruby
|
|
143
|
+
def example
|
|
144
|
+
puts "Code works inside callouts!"
|
|
145
|
+
end
|
|
146
|
+
```
|
|
147
|
+
:::
|
|
148
|
+
|
|
149
|
+
## Tabs
|
|
150
|
+
|
|
151
|
+
Display multiple code examples or options in tabs:
|
|
152
|
+
|
|
153
|
+
:::tabs
|
|
154
|
+
== JavaScript
|
|
155
|
+
```javascript
|
|
156
|
+
const config = {
|
|
157
|
+
apiUrl: 'https://api.example.com',
|
|
158
|
+
timeout: 5000
|
|
159
|
+
};
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
== TypeScript
|
|
163
|
+
```typescript
|
|
164
|
+
interface Config {
|
|
165
|
+
apiUrl: string;
|
|
166
|
+
timeout: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const config: Config = {
|
|
170
|
+
apiUrl: 'https://api.example.com',
|
|
171
|
+
timeout: 5000
|
|
172
|
+
};
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
== Ruby
|
|
176
|
+
```ruby
|
|
177
|
+
config = {
|
|
178
|
+
api_url: 'https://api.example.com',
|
|
179
|
+
timeout: 5000
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
:::
|
|
183
|
+
|
|
184
|
+
### Package Manager Tabs
|
|
185
|
+
|
|
186
|
+
Perfect for installation instructions:
|
|
187
|
+
|
|
188
|
+
:::tabs
|
|
189
|
+
== npm
|
|
190
|
+
```bash
|
|
191
|
+
npm install your-package
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
== yarn
|
|
195
|
+
```bash
|
|
196
|
+
yarn add your-package
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
== pnpm
|
|
200
|
+
```bash
|
|
201
|
+
pnpm add your-package
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
== bun
|
|
205
|
+
```bash
|
|
206
|
+
bun add your-package
|
|
207
|
+
```
|
|
208
|
+
:::
|
|
209
|
+
|
|
210
|
+
Tabs automatically detect package managers and display appropriate icons.
|
|
211
|
+
|
|
212
|
+
## Icons
|
|
213
|
+
|
|
214
|
+
Use inline icons from [Phosphor Icons](https://phosphoricons.com):
|
|
215
|
+
|
|
216
|
+
:rocket-launch: :check: :warning: :heart: :star: :code: :book-open: :gear:
|
|
217
|
+
|
|
218
|
+
Just wrap the icon name in colons:
|
|
219
|
+
|
|
220
|
+
```markdown
|
|
221
|
+
:rocket-launch: :check: :warning:
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Browse all available icons at [phosphoricons.com](https://phosphoricons.com).
|
|
225
|
+
|
|
226
|
+
## Horizontal Rules
|
|
227
|
+
|
|
228
|
+
Use three or more dashes, asterisks, or underscores:
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Best Practices
|
|
233
|
+
|
|
234
|
+
::: tip Writing Great Documentation
|
|
235
|
+
1. **Use headings hierarchically** - Don't skip levels (H1 → H3)
|
|
236
|
+
2. **Add code examples** - Show, don't just tell
|
|
237
|
+
3. **Use callouts sparingly** - Highlight only important information
|
|
238
|
+
4. **Keep it concise** - Respect your readers' time
|
|
239
|
+
5. **Link related pages** - Help users navigate your docs
|
|
240
|
+
:::
|
|
241
|
+
|
|
242
|
+
## Next Steps
|
|
243
|
+
|
|
244
|
+
::: note
|
|
245
|
+
- Learn how to [customize your site](configuration)
|
|
246
|
+
- Explore the [installation guide](../getting-started/installation)
|
|
247
|
+
:::
|
|
@@ -1,86 +1,82 @@
|
|
|
1
|
-
# Welcome to
|
|
1
|
+
# Welcome to Your Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is your documentation homepage. Docyard transforms your Markdown files into beautiful, searchable documentation.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Example
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Hot Reload** - Changes appear instantly while you write
|
|
9
|
-
- **GitHub Flavored Markdown** - Full GFM support with tables and task lists
|
|
10
|
-
- **Syntax Highlighting** - 100+ languages powered by Rouge
|
|
11
|
-
- **Zero Configuration** - Works out of the box with sensible defaults
|
|
12
|
-
- **Mobile Responsive** - Beautiful on desktop, tablet, and mobile
|
|
7
|
+
Here's what you can do with Docyard:
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
### Code Blocks with Syntax Highlighting
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Install
|
|
20
|
-
gem install docyard
|
|
11
|
+
```ruby
|
|
12
|
+
class User
|
|
13
|
+
attr_reader :name, :email
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
def initialize(name, email)
|
|
16
|
+
@name = name
|
|
17
|
+
@email = email
|
|
18
|
+
end
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
def greet
|
|
21
|
+
"Hello, #{name}!"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
27
24
|
```
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
### Callouts for Important Information
|
|
30
27
|
|
|
28
|
+
::: tip Pro Tip
|
|
29
|
+
Use callouts to highlight important information. Available types: `note`, `tip`, `important`, `warning`, and `danger`.
|
|
30
|
+
:::
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
::: warning
|
|
33
|
+
Make sure to read the [Configuration Guide](guides/configuration) before deploying to production.
|
|
34
|
+
:::
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
### Tabs for Multiple Options
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
class DocumentationSite
|
|
38
|
-
attr_reader :title, :pages
|
|
38
|
+
Show installation instructions for different package managers:
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
:::tabs
|
|
41
|
+
== npm
|
|
42
|
+
```bash
|
|
43
|
+
npm install your-package
|
|
44
|
+
```
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
== yarn
|
|
47
|
+
```bash
|
|
48
|
+
yarn add your-package
|
|
49
|
+
```
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
end
|
|
51
|
+
== pnpm
|
|
52
|
+
```bash
|
|
53
|
+
pnpm add your-package
|
|
53
54
|
```
|
|
55
|
+
:::
|
|
54
56
|
|
|
57
|
+
### Icons
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
Use inline icons from [Phosphor Icons](https://phosphoricons.com): :rocket-launch: :check: :warning: :heart:
|
|
57
60
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
## Getting Started
|
|
62
|
+
|
|
63
|
+
::: note Next Steps
|
|
64
|
+
1. Edit the files in `docs/` to create your documentation
|
|
65
|
+
2. Run `docyard serve` to preview changes in real-time
|
|
66
|
+
3. Customize `docyard.yml` to configure branding and navigation
|
|
67
|
+
4. Run `docyard build` when ready to deploy
|
|
68
|
+
:::
|
|
65
69
|
|
|
66
70
|
## Documentation Structure
|
|
67
71
|
|
|
68
72
|
| Section | Description |
|
|
69
73
|
|---------|-------------|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
73
|
-
## What's Next?
|
|
74
|
-
|
|
75
|
-
> Get started by exploring the documentation in the sidebar, or jump straight to the [Quick Start Guide](getting-started/quick-start).
|
|
76
|
-
|
|
77
|
-
### Learn the Basics
|
|
78
|
-
|
|
79
|
-
1. [Introduction](getting-started/introduction) - Learn what Docyard can do
|
|
80
|
-
2. [Installation](getting-started/installation) - Install Docyard on your system
|
|
81
|
-
3. [Quick Start](getting-started/quick-start) - Create your first site
|
|
74
|
+
| [Installation](getting-started/installation) | Get up and running quickly |
|
|
75
|
+
| [Markdown Features](guides/markdown-features) | Learn about all supported features |
|
|
76
|
+
| [Configuration](guides/configuration) | Customize appearance and navigation |
|
|
82
77
|
|
|
83
|
-
|
|
78
|
+
## Need Help?
|
|
84
79
|
|
|
85
|
-
- [
|
|
86
|
-
- [
|
|
80
|
+
- Check out the [Markdown Features](guides/markdown-features) guide
|
|
81
|
+
- Learn about [customization options](guides/configuration)
|
|
82
|
+
- Explore the sidebar to see all available pages
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div class="docyard-callout docyard-callout--<%= @type %>" role="<%= %w[danger warning].include?(@type) ? 'alert' : 'note' %>">
|
|
2
|
+
<div class="docyard-callout__icon" aria-hidden="true">
|
|
3
|
+
<%= @icon_svg %>
|
|
4
|
+
</div>
|
|
5
|
+
<div class="docyard-callout__content">
|
|
6
|
+
<div class="docyard-callout__title"><%= @title %></div>
|
|
7
|
+
<div class="docyard-callout__body">
|
|
8
|
+
<%= @content_html %>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<span class="docyard-icon docyard-icon-<%= @name %>" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><%= @icon_data %></svg></span>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<span class="docyard-icon docyard-icon-file-<%= @extension %>" aria-hidden="true"><%= @svg_content %></span>
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<% collapsed = @collapsed || false %>
|
|
2
|
+
<button class="nav-group-toggle" aria-expanded="<%= collapsed ? 'false' : 'true' %>" type="button">
|
|
3
|
+
<span class="nav-group-title">
|
|
4
|
+
<% if @icon %>
|
|
5
|
+
<span class="nav-item-icon"><%= icon(@icon) %></span>
|
|
6
|
+
<% end %>
|
|
7
|
+
<span class="nav-item-text"><%= @title %></span>
|
|
8
|
+
</span>
|
|
9
|
+
<span class="nav-group-icon"><%= icon(:caret_right) %></span>
|
|
4
10
|
</button>
|
|
5
|
-
<div class="nav-group-children">
|
|
11
|
+
<div class="nav-group-children<%= ' collapsed' if collapsed %>">
|
|
6
12
|
<%= @children_html %>
|
|
7
13
|
</div>
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
<a href="<%= @path %>"<%= ' class="active"' if @active
|
|
1
|
+
<a href="<%= link_path(@path) %>"<%= ' class="active"' if @active %><%= " target=\"#{@target}\" rel=\"noopener noreferrer\"" if @target && @target != "_self" %>>
|
|
2
|
+
<% if @icon %>
|
|
3
|
+
<span class="nav-item-icon"><%= icon(@icon) %></span>
|
|
4
|
+
<% end %>
|
|
5
|
+
<span class="nav-item-text"><%= @title %></span>
|
|
6
|
+
<% if @target == "_blank" %>
|
|
7
|
+
<span class="nav-item-external"><%= icon(:link_external) %></span>
|
|
8
|
+
<% end %>
|
|
9
|
+
</a>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<div class="docyard-tabs" data-tabs="<%= @group_id %>">
|
|
2
|
+
<div class="docyard-tabs__list-wrapper">
|
|
3
|
+
<div role="tablist" aria-label="Code examples" class="docyard-tabs__list">
|
|
4
|
+
<% @tabs.each_with_index do |tab, index| %>
|
|
5
|
+
<button
|
|
6
|
+
role="tab"
|
|
7
|
+
aria-selected="<%= index == 0 ? 'true' : 'false' %>"
|
|
8
|
+
aria-controls="tabpanel-<%= @group_id %>-<%= index %>"
|
|
9
|
+
id="tab-<%= @group_id %>-<%= index %>"
|
|
10
|
+
class="docyard-tabs__tab"
|
|
11
|
+
tabindex="<%= index == 0 ? '0' : '-1' %>"
|
|
12
|
+
>
|
|
13
|
+
<% if tab[:icon] %>
|
|
14
|
+
<span class="docyard-tabs__icon">
|
|
15
|
+
<% if tab[:icon_source] == "file-extension" %>
|
|
16
|
+
<%= Docyard::Icons.render_file_extension(tab[:icon]) %>
|
|
17
|
+
<% elsif tab[:icon_source] == "phosphor" %>
|
|
18
|
+
<%= Docyard::Icons.render(tab[:icon]) %>
|
|
19
|
+
<% end %>
|
|
20
|
+
</span>
|
|
21
|
+
<% end %>
|
|
22
|
+
<%= tab[:name] %>
|
|
23
|
+
</button>
|
|
24
|
+
<% end %>
|
|
25
|
+
<div class="docyard-tabs__indicator" aria-hidden="true"></div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<% @tabs.each_with_index do |tab, index| %>
|
|
29
|
+
<div
|
|
30
|
+
role="tabpanel"
|
|
31
|
+
id="tabpanel-<%= @group_id %>-<%= index %>"
|
|
32
|
+
aria-labelledby="tab-<%= @group_id %>-<%= index %>"
|
|
33
|
+
aria-hidden="<%= index == 0 ? 'false' : 'true' %>"
|
|
34
|
+
class="docyard-tabs__panel"
|
|
35
|
+
tabindex="0"
|
|
36
|
+
>
|
|
37
|
+
<%= tab[:content] %>
|
|
38
|
+
</div>
|
|
39
|
+
<% end %>
|
|
40
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<button class="theme-toggle" aria-label="Toggle theme" title="Toggle theme">
|
|
2
|
+
<span class="theme-toggle-track">
|
|
3
|
+
<!-- Sun icon -->
|
|
4
|
+
<svg class="theme-toggle-icon theme-toggle-sun-icon" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 256 256" fill="currentColor">
|
|
5
|
+
<path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"></path>
|
|
6
|
+
</svg>
|
|
7
|
+
<!-- Moon stars icon -->
|
|
8
|
+
<svg class="theme-toggle-icon theme-toggle-moon-icon" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 256 256" fill="currentColor">
|
|
9
|
+
<path d="M240,96a8,8,0,0,1-8,8H216v16a8,8,0,0,1-16,0V104H184a8,8,0,0,1,0-16h16V72a8,8,0,0,1,16,0V88h16A8,8,0,0,1,240,96ZM144,56h8v8a8,8,0,0,0,16,0V56h8a8,8,0,0,0,0-16h-8V32a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16Zm72.77,97a8,8,0,0,1,1.43,8A96,96,0,1,1,95.07,37.8a8,8,0,0,1,10.6,9.06A88.07,88.07,0,0,0,209.14,150.33,8,8,0,0,1,216.77,153Zm-19.39,14.88c-1.79.09-3.59.14-5.38.14A104.11,104.11,0,0,1,88,64c0-1.79,0-3.59.14-5.38A80,80,0,1,0,197.38,167.86Z"></path>
|
|
10
|
+
</svg>
|
|
11
|
+
<span class="theme-toggle-thumb"></span>
|
|
12
|
+
</span>
|
|
13
|
+
</button>
|
data/lib/docyard/version.rb
CHANGED
data/lib/docyard.rb
CHANGED
|
@@ -22,5 +22,13 @@ require_relative "docyard/initializer"
|
|
|
22
22
|
require_relative "docyard/server"
|
|
23
23
|
require_relative "docyard/cli"
|
|
24
24
|
|
|
25
|
+
# Build components
|
|
26
|
+
require_relative "docyard/builder"
|
|
27
|
+
require_relative "docyard/build/static_generator"
|
|
28
|
+
require_relative "docyard/build/asset_bundler"
|
|
29
|
+
require_relative "docyard/build/file_copier"
|
|
30
|
+
require_relative "docyard/build/sitemap_generator"
|
|
31
|
+
require_relative "docyard/preview_server"
|
|
32
|
+
|
|
25
33
|
module Docyard
|
|
26
34
|
end
|