@sp-days-framework/docusaurus-plugin-interactive-tasks 1.0.5-rc2 → 1.1.0-beta1
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.
- package/docs/advanced-configuration.mdx +275 -0
- package/docs/changelog.mdx +173 -0
- package/docs/example-advanced-usage.mdx +308 -0
- package/docs/example-basic-usage.mdx +132 -0
- package/docs/index.mdx +92 -0
- package/docs/install.mdx +121 -0
- package/docs/logo-docusaurus.svg +17 -0
- package/docs/progression.mdx +153 -0
- package/docs/tasks.mdx +433 -0
- package/package.json +5 -2
- package/publish-package-docs.js +20 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
task_section_name: "Interactive Demo 2"
|
|
3
|
+
sidebar_position: 3.2
|
|
4
|
+
sidebar_label: "Advanced Usage"
|
|
5
|
+
sidebar_custom_props:
|
|
6
|
+
section: "Examples"
|
|
7
|
+
section_position: 3
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
|
|
12
|
+
# Advanced Usage Example
|
|
13
|
+
|
|
14
|
+
Discover how to leverage advanced Docusaurus markdown features within interactive tasks to create rich, engaging learning experiences.
|
|
15
|
+
|
|
16
|
+
<TaskProgression path="." />
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
::::task[Add Syntax Highlighting to Code Blocks]
|
|
21
|
+
|
|
22
|
+
Practice adding syntax-highlighted code blocks to your documentation:
|
|
23
|
+
|
|
24
|
+
1. Create a code block using triple backticks (```)
|
|
25
|
+
2. Add the language identifier immediately after the opening backticks
|
|
26
|
+
3. Write your code inside the block
|
|
27
|
+
4. Close with triple backticks
|
|
28
|
+
|
|
29
|
+
**Bash example:**
|
|
30
|
+
```bash
|
|
31
|
+
docker run -d -p 8080:80 nginx
|
|
32
|
+
npm install express
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**YAML example:**
|
|
36
|
+
```yaml
|
|
37
|
+
version: '3.8'
|
|
38
|
+
services:
|
|
39
|
+
web:
|
|
40
|
+
image: nginx:latest
|
|
41
|
+
ports:
|
|
42
|
+
- "8080:80"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**JSON example:**
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"name": "my-app",
|
|
49
|
+
"version": "1.0.0",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"react": "^18.0.0"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
:::hint
|
|
57
|
+
Docusaurus supports 30+ languages out of the box. Check the [Prism language list](https://prismjs.com/#supported-languages) for all available options. You can add more languages in `docusaurus.config.ts` - see the [Docusaurus documentation](https://docusaurus.io/docs/markdown-features/code-blocks#supported-languages).
|
|
58
|
+
:::
|
|
59
|
+
|
|
60
|
+
::::
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
::::task[Add File Names to Code Blocks]
|
|
65
|
+
|
|
66
|
+
Add descriptive file names to your code blocks for better context:
|
|
67
|
+
|
|
68
|
+
1. After the language identifier, add a space and `title="filename.ext"`
|
|
69
|
+
2. The filename will appear as a header above the code block
|
|
70
|
+
3. This helps readers know exactly where code should be placed
|
|
71
|
+
|
|
72
|
+
```json title="tsconfig.json"
|
|
73
|
+
{
|
|
74
|
+
"compilerOptions": {
|
|
75
|
+
"target": "ES2020",
|
|
76
|
+
"strict": true,
|
|
77
|
+
"strictNullChecks": true,
|
|
78
|
+
"skipLibCheck": true
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
:::hint
|
|
84
|
+
Use this feature to show exactly where code should be placed in a project structure. It's especially helpful in tutorials with multiple files.
|
|
85
|
+
:::
|
|
86
|
+
|
|
87
|
+
::::
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
::::task[Highlight Important Code Lines]
|
|
92
|
+
|
|
93
|
+
Learn two methods for highlighting specific lines in code blocks:
|
|
94
|
+
|
|
95
|
+
**Method 1: Inline comments** (best when actively developing)
|
|
96
|
+
|
|
97
|
+
Use `highlight-next-line`, `highlight-start`, and `highlight-end` comments to mark important lines:
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
function HighlightSomeText(highlight) {
|
|
101
|
+
if (highlight) {
|
|
102
|
+
// highlight-next-line
|
|
103
|
+
return 'This text is highlighted!';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return 'Nothing highlighted';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function HighlightMoreText(highlight) {
|
|
110
|
+
// highlight-start
|
|
111
|
+
if (highlight) {
|
|
112
|
+
return 'This range is highlighted!';
|
|
113
|
+
}
|
|
114
|
+
// highlight-end
|
|
115
|
+
|
|
116
|
+
return 'Nothing highlighted';
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Method 2: Meta string** (cleaner for published docs)
|
|
121
|
+
|
|
122
|
+
Add line numbers after the language identifier. Separate multiple lines with commas or use ranges:
|
|
123
|
+
|
|
124
|
+
```jsx {1,4-6,11}
|
|
125
|
+
import React from 'react';
|
|
126
|
+
|
|
127
|
+
function MyComponent(props) {
|
|
128
|
+
if (props.isBar) {
|
|
129
|
+
return <div>Bar</div>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return <div>Foo</div>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export default MyComponent;
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
:::hint
|
|
139
|
+
|
|
140
|
+
Supported commenting syntax:
|
|
141
|
+
|
|
142
|
+
| Style | Syntax |
|
|
143
|
+
| ---------- | ------------------------ |
|
|
144
|
+
| C-style | `/* ... */` and `// ...` |
|
|
145
|
+
| JSX-style | `{/* ... */}` |
|
|
146
|
+
| Bash-style | `# ...` |
|
|
147
|
+
| HTML-style | `<!-- ... -->` |
|
|
148
|
+
|
|
149
|
+
Choose inline comments when actively developing, and meta strings for final published documentation.
|
|
150
|
+
|
|
151
|
+
:::
|
|
152
|
+
|
|
153
|
+
::::
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
:::::task[Nest Admonitions in Tasks]
|
|
158
|
+
|
|
159
|
+
Practice nesting admonitions inside tasks by using the correct number of colons:
|
|
160
|
+
|
|
161
|
+
1. Task containers use 4+ colons: `::::task`
|
|
162
|
+
2. Hints/solutions use 3+ colons: `:::hint`
|
|
163
|
+
3. Nested admonitions also use 3+ colons: `:::note`
|
|
164
|
+
4. For deeper nesting inside hints/solutions, use 4+ colons for the admonition
|
|
165
|
+
|
|
166
|
+
**Rule:** Parent containers always need **more colons** than their children to prevent the parser from prematurely closing containers.
|
|
167
|
+
|
|
168
|
+
:::note
|
|
169
|
+
|
|
170
|
+
This is a note at the task level (3 colons).
|
|
171
|
+
|
|
172
|
+
:::
|
|
173
|
+
|
|
174
|
+
:::warning
|
|
175
|
+
|
|
176
|
+
This is a warning at the task level (3 colons).
|
|
177
|
+
|
|
178
|
+
:::
|
|
179
|
+
|
|
180
|
+
::::hint
|
|
181
|
+
|
|
182
|
+
This hint contains a nested admonition (4 colons for hint, since it needs to contain a 3-colon admonition):
|
|
183
|
+
|
|
184
|
+
:::note
|
|
185
|
+
|
|
186
|
+
This note is nested inside the hint (3 colons).
|
|
187
|
+
|
|
188
|
+
:::
|
|
189
|
+
|
|
190
|
+
::::
|
|
191
|
+
|
|
192
|
+
:::::
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
::::task[Use React Components in Tasks]
|
|
197
|
+
|
|
198
|
+
Import and use React components within your task content to create interactive experiences:
|
|
199
|
+
|
|
200
|
+
1. Import React and any hooks you need at the top of the file: `import { useState } from 'react';`
|
|
201
|
+
2. Define your component using `export const`
|
|
202
|
+
3. Use the component anywhere in your MDX content
|
|
203
|
+
|
|
204
|
+
**Example - Interactive Counter:**
|
|
205
|
+
|
|
206
|
+
export const Counter = () => {
|
|
207
|
+
const [count, setCount] = useState(0);
|
|
208
|
+
return (
|
|
209
|
+
<div style={{
|
|
210
|
+
padding: '1rem',
|
|
211
|
+
border: '2px solid var(--ifm-color-primary)',
|
|
212
|
+
borderRadius: '8px',
|
|
213
|
+
textAlign: 'center',
|
|
214
|
+
margin: '1rem 0'
|
|
215
|
+
}}>
|
|
216
|
+
<p style={{ fontSize: '1.5rem', margin: '0.5rem 0' }}>
|
|
217
|
+
Count: <strong>{count}</strong>
|
|
218
|
+
</p>
|
|
219
|
+
<button
|
|
220
|
+
onClick={() => setCount(count + 1)}
|
|
221
|
+
style={{
|
|
222
|
+
marginRight: '0.5rem',
|
|
223
|
+
padding: '0.5rem 1rem',
|
|
224
|
+
fontSize: '1rem',
|
|
225
|
+
cursor: 'pointer'
|
|
226
|
+
}}
|
|
227
|
+
>
|
|
228
|
+
Increment
|
|
229
|
+
</button>
|
|
230
|
+
<button
|
|
231
|
+
onClick={() => setCount(0)}
|
|
232
|
+
style={{
|
|
233
|
+
padding: '0.5rem 1rem',
|
|
234
|
+
fontSize: '1rem',
|
|
235
|
+
cursor: 'pointer'
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
Reset
|
|
239
|
+
</button>
|
|
240
|
+
</div>
|
|
241
|
+
);
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
<Counter />
|
|
245
|
+
|
|
246
|
+
:::hint
|
|
247
|
+
|
|
248
|
+
Tasks support all Docusaurus MDX features, including:
|
|
249
|
+
- React component imports and usage (useState, useEffect, etc.)
|
|
250
|
+
- Tabs, admonitions, and other built-in components
|
|
251
|
+
- Custom CSS and styling with theme-aware variables
|
|
252
|
+
- Interactive JavaScript functionality
|
|
253
|
+
|
|
254
|
+
This makes tasks perfect for interactive tutorials and hands-on learning experiences!
|
|
255
|
+
|
|
256
|
+
:::
|
|
257
|
+
|
|
258
|
+
:::solution
|
|
259
|
+
|
|
260
|
+
Here is the React code running in the task:
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
import { useState } from 'react';
|
|
264
|
+
|
|
265
|
+
export const Counter = () => {
|
|
266
|
+
const [count, setCount] = useState(0);
|
|
267
|
+
return (
|
|
268
|
+
<div style={{
|
|
269
|
+
padding: '1rem',
|
|
270
|
+
border: '2px solid var(--ifm-color-primary)',
|
|
271
|
+
borderRadius: '8px',
|
|
272
|
+
textAlign: 'center',
|
|
273
|
+
margin: '1rem 0'
|
|
274
|
+
}}>
|
|
275
|
+
<p style={{ fontSize: '1.5rem', margin: '0.5rem 0' }}>
|
|
276
|
+
Count: <strong>{count}</strong>
|
|
277
|
+
</p>
|
|
278
|
+
<button
|
|
279
|
+
onClick={() => setCount(count + 1)}
|
|
280
|
+
style={{
|
|
281
|
+
marginRight: '0.5rem',
|
|
282
|
+
padding: '0.5rem 1rem',
|
|
283
|
+
fontSize: '1rem',
|
|
284
|
+
cursor: 'pointer'
|
|
285
|
+
}}
|
|
286
|
+
>
|
|
287
|
+
Increment
|
|
288
|
+
</button>
|
|
289
|
+
<button
|
|
290
|
+
onClick={() => setCount(0)}
|
|
291
|
+
style={{
|
|
292
|
+
padding: '0.5rem 1rem',
|
|
293
|
+
fontSize: '1rem',
|
|
294
|
+
cursor: 'pointer'
|
|
295
|
+
}}
|
|
296
|
+
>
|
|
297
|
+
Reset
|
|
298
|
+
</button>
|
|
299
|
+
</div>
|
|
300
|
+
);
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
<Counter />
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
:::
|
|
307
|
+
|
|
308
|
+
::::
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
task_section_name: "Interactive Demo 1"
|
|
3
|
+
sidebar_position: 3.1
|
|
4
|
+
sidebar_label: "Basic Usage"
|
|
5
|
+
sidebar_custom_props:
|
|
6
|
+
section: "Examples"
|
|
7
|
+
section_position: 3
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Basic Usage Example
|
|
11
|
+
|
|
12
|
+
See interactive tasks in action with real-world examples. This page demonstrates how tasks work in a documentation environment.
|
|
13
|
+
|
|
14
|
+
<TaskProgression path="."/>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
::::task[Install the Plugin]
|
|
19
|
+
|
|
20
|
+
Follow these steps to add Interactive Tasks to your Docusaurus project:
|
|
21
|
+
|
|
22
|
+
1. Open your terminal in the project root directory
|
|
23
|
+
2. Run the installation command for your package manager
|
|
24
|
+
3. Verify the package appears in your `package.json` dependencies
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
:::hint
|
|
28
|
+
|
|
29
|
+
If you created your project with `@sp-days-framework/create-sp-days`, this plugin is already installed and you can skip this task.
|
|
30
|
+
|
|
31
|
+
:::
|
|
32
|
+
|
|
33
|
+
::::
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
::::task[Configure Docusaurus]
|
|
38
|
+
|
|
39
|
+
Add the plugin and remark plugin to your Docusaurus configuration:
|
|
40
|
+
|
|
41
|
+
1. Open `docusaurus.config.js` in your project root
|
|
42
|
+
2. Add the plugin to the `plugins` array
|
|
43
|
+
3. Add the remark plugin to your preset's docs configuration
|
|
44
|
+
4. Save the file
|
|
45
|
+
|
|
46
|
+
:::solution
|
|
47
|
+
|
|
48
|
+
The plugin needs to be registered in two places: the `plugins` array for the main functionality, and the `remarkPlugins` array to transform task directives in your markdown files.
|
|
49
|
+
|
|
50
|
+
**Verify Configuration:**
|
|
51
|
+
|
|
52
|
+
- The file should have both entries as shown below
|
|
53
|
+
- No syntax errors when running `npm run start`
|
|
54
|
+
|
|
55
|
+
Add to your `docusaurus.config.js`:
|
|
56
|
+
|
|
57
|
+
```js title="docusaurus.config.js"
|
|
58
|
+
module.exports = {
|
|
59
|
+
plugins: ["@sp-days-framework/docusaurus-plugin-interactive-tasks"],
|
|
60
|
+
|
|
61
|
+
presets: [
|
|
62
|
+
[
|
|
63
|
+
"classic",
|
|
64
|
+
{
|
|
65
|
+
docs: {
|
|
66
|
+
remarkPlugins: [
|
|
67
|
+
require("@sp-days-framework/docusaurus-plugin-interactive-tasks")
|
|
68
|
+
.remarkTaskDirective,
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
:::
|
|
78
|
+
|
|
79
|
+
::::
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
::::task[Add Progress Tracking]
|
|
84
|
+
|
|
85
|
+
Display task completion progress on your documentation pages:
|
|
86
|
+
|
|
87
|
+
1. Import the `TaskProgression` component in your MDX file
|
|
88
|
+
2. Add the component where you want to show progress
|
|
89
|
+
3. Provide the path to the document you want to track
|
|
90
|
+
|
|
91
|
+
Add to your MDX file:
|
|
92
|
+
|
|
93
|
+
```mdx
|
|
94
|
+
import TaskProgression from "@theme/TaskProgression";
|
|
95
|
+
|
|
96
|
+
<TaskProgression path="." />
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Reference other pages:
|
|
100
|
+
|
|
101
|
+
```mdx
|
|
102
|
+
<TaskProgression path="/docs/tutorial/first-task" />
|
|
103
|
+
<TaskProgression path="../module-02/introduction" />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
:::hint
|
|
107
|
+
|
|
108
|
+
Use `path="."` to reference the current page, or provide an absolute/relative path to track other pages. The component shows a visual progress bar and completion count.
|
|
109
|
+
|
|
110
|
+
:::
|
|
111
|
+
|
|
112
|
+
::::
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
::::task[Test Auto-Collapse Feature]
|
|
117
|
+
|
|
118
|
+
Learn how the auto-collapse feature helps you focus on incomplete tasks:
|
|
119
|
+
|
|
120
|
+
1. Complete at least one task on this page by clicking "Mark as Done"
|
|
121
|
+
2. Look for the collapse icon button in the navbar
|
|
122
|
+
3. Click the collapse icon to enable auto-collapse mode
|
|
123
|
+
4. Observe how completed tasks automatically collapse
|
|
124
|
+
5. Click the collapse icon again to disable the feature
|
|
125
|
+
|
|
126
|
+
:::hint
|
|
127
|
+
|
|
128
|
+
The auto-collapse setting is saved to your browser's localStorage and syncs across all tabs. This feature is especially useful when working through long tutorial pages with many tasks.
|
|
129
|
+
|
|
130
|
+
:::
|
|
131
|
+
|
|
132
|
+
::::
|
package/docs/index.mdx
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Interactive Tasks
|
|
3
|
+
hide_title: true
|
|
4
|
+
sidebar_position: 0
|
|
5
|
+
sidebar_label: "📦 Interactive Tasks"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import LogoDocusaurus from './logo-docusaurus.svg';
|
|
9
|
+
|
|
10
|
+
<div align="center">
|
|
11
|
+
<div style={{ display: 'flex', justifyContent: 'center', margin: '1rem' }}>
|
|
12
|
+
<LogoDocusaurus width="110" height="110"/>
|
|
13
|
+
</div>
|
|
14
|
+
<div align="center">
|
|
15
|
+
# Interactive Tasks
|
|
16
|
+
</div>
|
|
17
|
+
<div align="center">
|
|
18
|
+
<p>
|
|
19
|
+
*A Docusaurus plugin that transforms documentation into interactive learning experiences!*
|
|
20
|
+
</p>
|
|
21
|
+
<h4>
|
|
22
|
+
<a href="./interactive-tasks/install">🔧 Setup</a> ·
|
|
23
|
+
<a href="https://www.npmjs.com/package/@sp-days-framework/docusaurus-plugin-interactive-tasks">📦 NPM Package</a> ·
|
|
24
|
+
<a href="https://github.com/helse-sorost/sp-days-framework">💻 Source Code</a>
|
|
25
|
+
</h4>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- **Interactive Tasks** - Collapsible task components with completion tracking
|
|
34
|
+
- **Hints, Solutions & Expected Outputs** - Optional toggleable hints, solutions, and expected outputs for each task
|
|
35
|
+
- **Auto-Numbering** - Automatic task numbering per page
|
|
36
|
+
- **Persistent Progress** - Completion status saved to localStorage
|
|
37
|
+
- **Progress Tracking** - Visual progress indicators in sidebar and task progression components
|
|
38
|
+
- **Sidebar Badges** - Automatic completion badges (e.g., "2/5") in sidebar navigation
|
|
39
|
+
- **Auto-Collapse Toggle** - Navbar button to enable/disable auto-collapsing of completed tasks
|
|
40
|
+
|
|
41
|
+
## Getting Started
|
|
42
|
+
|
|
43
|
+
Create interactive tasks using simple markdown directives:
|
|
44
|
+
|
|
45
|
+
````mdx
|
|
46
|
+
::::task[Install the Plugin]
|
|
47
|
+
|
|
48
|
+
Install the Interactive Tasks plugin using npm or yarn.
|
|
49
|
+
|
|
50
|
+
:::hint
|
|
51
|
+
Use npm install or yarn add to install the package.
|
|
52
|
+
:::
|
|
53
|
+
|
|
54
|
+
:::solution
|
|
55
|
+
```bash
|
|
56
|
+
npm install @sp-days-framework/docusaurus-plugin-interactive-tasks
|
|
57
|
+
```
|
|
58
|
+
:::
|
|
59
|
+
|
|
60
|
+
::::
|
|
61
|
+
````
|
|
62
|
+
|
|
63
|
+
<div style={{ position: 'relative', marginTop: '2rem', display: 'flex', justifyContent: 'center' }}>
|
|
64
|
+
<div style={{ position: 'absolute', left: '50%', marginTop: '4px', transform: 'translateX(-50%)', fontWeight: 500, color: 'var(--ifm-color-emphasis-600)' }}>
|
|
65
|
+
Preview
|
|
66
|
+
</div>
|
|
67
|
+
<div id="preview-task-example" style={{ borderRadius: '12px', padding: '2rem 2rem 0rem 2rem', background: 'var(--ifm-color-emphasis-200)' }}>
|
|
68
|
+
<style>{`
|
|
69
|
+
#preview-task-example h3 {
|
|
70
|
+
display: none !important;
|
|
71
|
+
}
|
|
72
|
+
`}</style>
|
|
73
|
+
::::task-example[Install the Plugin]
|
|
74
|
+
|
|
75
|
+
Install the Interactive Tasks plugin using npm or yarn.
|
|
76
|
+
|
|
77
|
+
:::hint
|
|
78
|
+
Use npm install or yarn add to install the package.
|
|
79
|
+
:::
|
|
80
|
+
|
|
81
|
+
:::solution
|
|
82
|
+
```bash
|
|
83
|
+
npm install @sp-days-framework/docusaurus-plugin-interactive-tasks
|
|
84
|
+
```
|
|
85
|
+
:::
|
|
86
|
+
|
|
87
|
+
::::
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<br/>
|
|
91
|
+
|
|
92
|
+
Tasks are automatically numbered, track completion in localStorage, and sync across browser tabs. See [Install](install.mdx) for installation and configuration.
|
package/docs/install.mdx
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1.1
|
|
3
|
+
sidebar_custom_props:
|
|
4
|
+
section: "Setup"
|
|
5
|
+
section_position: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import Tabs from "@theme/Tabs";
|
|
9
|
+
import TabItem from "@theme/TabItem";
|
|
10
|
+
|
|
11
|
+
# Installation
|
|
12
|
+
|
|
13
|
+
:::tip[Already Included]
|
|
14
|
+
If you're using `@sp-days-framework/create-sp-days`, the Interactive Tasks plugin is already installed and configured. You can start creating tasks right away!
|
|
15
|
+
:::
|
|
16
|
+
|
|
17
|
+
Install the plugin using your preferred package manager:
|
|
18
|
+
|
|
19
|
+
<Tabs>
|
|
20
|
+
<TabItem value="npm" label="npm" default>
|
|
21
|
+
```bash
|
|
22
|
+
npm install @sp-days-framework/docusaurus-plugin-interactive-tasks
|
|
23
|
+
```
|
|
24
|
+
</TabItem>
|
|
25
|
+
<TabItem value="yarn" label="Yarn">
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @sp-days-framework/docusaurus-plugin-interactive-tasks
|
|
28
|
+
```
|
|
29
|
+
</TabItem>
|
|
30
|
+
</Tabs>
|
|
31
|
+
|
|
32
|
+
Add the plugin to your plugins array and the remark plugin to your docs configuration:
|
|
33
|
+
|
|
34
|
+
```js title="docusaurus.config.js" {2,9-11}
|
|
35
|
+
module.exports = {
|
|
36
|
+
plugins: ["@sp-days-framework/docusaurus-plugin-interactive-tasks"],
|
|
37
|
+
|
|
38
|
+
presets: [
|
|
39
|
+
[
|
|
40
|
+
"classic",
|
|
41
|
+
{
|
|
42
|
+
docs: {
|
|
43
|
+
beforeDefaultRemarkPlugins: [
|
|
44
|
+
require("@sp-days-framework/docusaurus-plugin-interactive-tasks")
|
|
45
|
+
.remarkTaskDirective,
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Frontmatter Options
|
|
55
|
+
|
|
56
|
+
Customize task badge appearance for individual pages:
|
|
57
|
+
|
|
58
|
+
```mdx title="docs/my-module.mdx"
|
|
59
|
+
---
|
|
60
|
+
title: My Module
|
|
61
|
+
sidebar_task_hide_progress: false
|
|
62
|
+
sidebar_task_disable_icon: false
|
|
63
|
+
sidebar_task_badge_colors:
|
|
64
|
+
completed:
|
|
65
|
+
lightmode: "#4caf50"
|
|
66
|
+
darkmode: "#66bb6a"
|
|
67
|
+
incomplete:
|
|
68
|
+
lightmode: "#2196f3"
|
|
69
|
+
darkmode: "#42a5f5"
|
|
70
|
+
font:
|
|
71
|
+
lightmode: "#ffffff"
|
|
72
|
+
darkmode: "#000000"
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
# My Module Content
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Category Sidebar Configuration
|
|
79
|
+
|
|
80
|
+
Customize task badges for entire categories using `_category_.yml` or `_category_.json`:
|
|
81
|
+
|
|
82
|
+
<Tabs>
|
|
83
|
+
<TabItem value="yaml" label="YAML" default>
|
|
84
|
+
```yaml title="docs/module-01/_category_.yml"
|
|
85
|
+
label: "Module 1"
|
|
86
|
+
position: 1
|
|
87
|
+
customProps:
|
|
88
|
+
sidebar_task_badge_colors:
|
|
89
|
+
completed:
|
|
90
|
+
lightmode: "#4caf50"
|
|
91
|
+
darkmode: "#66bb6a"
|
|
92
|
+
incomplete:
|
|
93
|
+
lightmode: "#2196f3"
|
|
94
|
+
darkmode: "#42a5f5"
|
|
95
|
+
sidebar_task_disable_icon: false
|
|
96
|
+
```
|
|
97
|
+
</TabItem>
|
|
98
|
+
<TabItem value="json" label="JSON">
|
|
99
|
+
```json title="docs/module-02/_category_.json"
|
|
100
|
+
{
|
|
101
|
+
"label": "Module 2",
|
|
102
|
+
"position": 2,
|
|
103
|
+
"customProps": {
|
|
104
|
+
"sidebar_task_hide_progress": false,
|
|
105
|
+
"sidebar_task_badge_colors": {
|
|
106
|
+
"completed": {
|
|
107
|
+
"lightmode": "#4caf50",
|
|
108
|
+
"darkmode": "#66bb6a"
|
|
109
|
+
},
|
|
110
|
+
"incomplete": {
|
|
111
|
+
"lightmode": "#2196f3",
|
|
112
|
+
"darkmode": "#42a5f5"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
</TabItem>
|
|
119
|
+
</Tabs>
|
|
120
|
+
|
|
121
|
+
See [Advanced Configuration](./advanced-configuration.mdx) for all available options.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="218" viewBox="0 0 256 218">
|
|
2
|
+
<path fill="#fff" d="M126.031 45.949h110.277v44.636H126.031z" />
|
|
3
|
+
<path fill="#3ecc5f" d="M26.256 191.672c-9.712 0-18.173-5.287-22.715-13.128A26.1 26.1 0 0 0 0 191.672c0 14.501 11.755 26.256 26.256 26.256h26.257v-26.256z" />
|
|
4
|
+
<path fill="#3ecc5f" d="m144.385 53.006l91.923-5.744V34.133c0-14.501-11.756-26.256-26.256-26.256H91.898l-3.282-5.685c-1.46-2.527-5.106-2.527-6.564 0L78.77 7.877l-3.282-5.685c-1.46-2.527-5.106-2.527-6.564 0l-3.282 5.685l-3.282-5.685c-1.46-2.527-5.106-2.527-6.564 0l-3.283 5.685l-.085.004l-5.438-5.437c-2.062-2.062-5.583-1.12-6.34 1.7l-1.795 6.7l-6.818-1.828c-2.818-.754-5.397 1.824-4.64 4.643l1.826 6.817l-6.7 1.795c-2.818.756-3.762 4.278-1.7 6.34l5.437 5.438l-.003.084l-5.686 3.282c-2.526 1.459-2.526 5.106 0 6.564l5.686 3.283l-5.686 3.282c-2.526 1.458-2.526 5.105 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.458-2.526 5.105 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.459-2.526 5.106 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.459-2.526 5.106 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.459-2.526 5.106 0 6.565l5.686 3.282l-5.686 3.282c-2.526 1.458-2.526 5.105 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.458-2.526 5.105 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.459-2.526 5.106 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.459-2.526 5.106 0 6.564l5.686 3.282l-5.686 3.282c-2.526 1.459-2.526 5.106 0 6.565l5.686 3.282l-5.686 3.282c-2.526 1.458-2.526 5.105 0 6.564l5.686 3.282c0 14.501 11.755 26.256 26.256 26.256h157.539c14.5 0 26.256-11.755 26.256-26.256V86.646l-91.923-5.745c-7.365-.46-13.102-6.568-13.102-13.947c0-7.38 5.737-13.487 13.102-13.948" />
|
|
5
|
+
<path fill="#3ecc5f" d="M183.795 217.928h39.384v-52.513h-39.384z" />
|
|
6
|
+
<path fill="#44d860" d="M249.436 185.108c-.288 0-.562.048-.839.084c-.05-.197-.097-.395-.152-.592a6.563 6.563 0 0 0-2.527-12.62c-1.494 0-2.856.52-3.96 1.36a35 35 0 0 0-.44-.442a6.5 6.5 0 0 0 1.328-3.92a6.563 6.563 0 0 0-12.602-2.573c-.195-.055-.39-.1-.584-.15c.035-.278.084-.552.084-.84a6.563 6.563 0 0 0-6.565-6.564a6.563 6.563 0 0 0-6.564 6.564c0 .288.049.562.084.84c-.194.05-.39.095-.584.15a6.563 6.563 0 0 0-12.602 2.572c0 1.477.505 2.824 1.328 3.921c-4.88 4.769-7.918 11.413-7.918 18.774c0 14.501 11.755 26.256 26.256 26.256c12.26 0 22.528-8.415 25.418-19.776c.277.035.551.084.839.084a6.563 6.563 0 0 0 6.564-6.564a6.563 6.563 0 0 0-6.564-6.564" />
|
|
7
|
+
<path fill="#3ecc5f" d="M196.923 139.159h39.385v-26.256h-39.385z" />
|
|
8
|
+
<path fill="#44d860" d="M249.436 129.313a3.282 3.282 0 1 0 0-6.564c-.143 0-.281.025-.419.042c-.026-.099-.048-.197-.076-.296a3.283 3.283 0 0 0-1.264-6.31c-.747 0-1.429.258-1.98.68a9 9 0 0 0-.22-.22a3.25 3.25 0 0 0 .664-1.962a3.282 3.282 0 0 0-6.302-1.286a13 13 0 0 0-3.531-.494c-7.25 0-13.129 5.878-13.129 13.128s5.88 13.128 13.129 13.128c1.226 0 2.406-.181 3.531-.495a3.282 3.282 0 0 0 6.302-1.285c0-.74-.252-1.414-.665-1.962q.113-.108.221-.22c.551.421 1.233.68 1.98.68a3.282 3.282 0 0 0 1.264-6.31c.028-.098.05-.198.076-.296c.138.017.276.042.419.042" />
|
|
9
|
+
<path d="M78.77 50.544a3.28 3.28 0 0 1-3.283-3.282c0-5.43-4.416-9.847-9.846-9.847s-9.846 4.417-9.846 9.847a3.282 3.282 0 1 1-6.564 0c0-9.05 7.36-16.41 16.41-16.41s16.41 7.36 16.41 16.41a3.28 3.28 0 0 1-3.282 3.282" />
|
|
10
|
+
<path fill="#ffff50" d="M131.282 217.928h78.77c14.5 0 26.256-11.755 26.256-26.256V99.774h-78.77c-14.501 0-26.256 11.755-26.256 26.257z" />
|
|
11
|
+
<path d="M216.641 140.472h-65.692a1.312 1.312 0 1 1 0-2.626h65.692a1.312 1.312 0 1 1 0 2.626m0 26.256h-65.692a1.312 1.312 0 1 1 0-2.625h65.692a1.312 1.312 0 1 1 0 2.625m0 26.257h-65.692a1.312 1.312 0 1 1 0-2.626h65.692a1.312 1.312 0 1 1 0 2.626m0-65.398h-65.692a1.312 1.312 0 1 1 0-2.626h65.692a1.312 1.312 0 1 1 0 2.626m0 26.013h-65.692a1.312 1.312 0 1 1 0-2.626h65.692a1.312 1.312 0 1 1 0 2.626m0 26.256h-65.692a1.312 1.312 0 1 1 0-2.625h65.692a1.312 1.312 0 1 1 0 2.625m19.667-121.289c-.016 0-.03-.008-.045-.007c-4.057.138-5.976 4.196-7.67 7.776c-1.766 3.74-3.133 6.174-5.373 6.1c-2.48-.089-3.898-2.89-5.4-5.856c-1.724-3.404-3.694-7.266-7.828-7.122c-3.999.137-5.925 3.668-7.623 6.783c-1.808 3.32-3.038 5.337-5.41 5.244c-2.53-.092-3.875-2.37-5.43-5.006c-1.735-2.935-3.74-6.236-7.793-6.123c-3.93.135-5.862 3.131-7.566 5.776c-1.802 2.797-3.065 4.5-5.468 4.4c-2.59-.094-3.928-1.983-5.476-4.171c-1.738-2.46-3.697-5.242-7.739-5.107c-3.844.131-5.775 2.585-7.478 4.75c-1.617 2.053-2.88 3.678-5.551 3.576a1.314 1.314 0 0 0-.095 2.626c3.96.132 5.967-2.365 7.709-4.578c1.545-1.964 2.879-3.66 5.505-3.748c2.528-.108 3.714 1.463 5.507 3.997c1.703 2.408 3.635 5.139 7.524 5.279c4.073.137 6.033-2.908 7.769-5.602c1.552-2.408 2.89-4.486 5.448-4.574c2.354-.088 3.635 1.773 5.442 4.833c1.702 2.884 3.631 6.152 7.597 6.296c4.103.142 6.084-3.44 7.81-6.61c1.495-2.741 2.907-5.331 5.407-5.417c2.354-.055 3.582 2.094 5.397 5.685c1.697 3.352 3.62 7.148 7.648 7.294q.111.004.222.004c4.022 0 5.93-4.037 7.62-7.607c1.496-3.164 2.911-6.145 5.34-6.266z" />
|
|
12
|
+
<path fill="#3ecc5f" d="M105.026 217.928h52.512v-52.513h-52.512z" />
|
|
13
|
+
<path fill="#44d860" d="M183.795 185.108c-.288 0-.562.048-.839.084c-.05-.197-.097-.395-.152-.592a6.563 6.563 0 0 0-2.527-12.62c-1.494 0-2.856.52-3.96 1.36a35 35 0 0 0-.44-.442a6.5 6.5 0 0 0 1.328-3.92a6.563 6.563 0 0 0-12.602-2.573c-.195-.055-.39-.1-.584-.15c.035-.278.084-.552.084-.84a6.563 6.563 0 0 0-6.565-6.564a6.563 6.563 0 0 0-6.564 6.564c0 .288.049.562.084.84c-.194.05-.39.095-.584.15a6.563 6.563 0 0 0-12.602 2.572c0 1.477.505 2.824 1.328 3.921c-4.88 4.769-7.918 11.413-7.918 18.774c0 14.501 11.755 26.256 26.256 26.256c12.26 0 22.528-8.415 25.418-19.776c.277.035.551.084.839.084a6.563 6.563 0 0 0 6.564-6.564a6.563 6.563 0 0 0-6.564-6.564" />
|
|
14
|
+
<path fill="#3ecc5f" d="M105.026 139.159h52.512v-26.256h-52.512z" />
|
|
15
|
+
<path fill="#44d860" d="M170.667 129.313a3.282 3.282 0 1 0 0-6.564c-.143 0-.281.025-.42.042q-.036-.148-.075-.296a3.283 3.283 0 0 0-1.265-6.31c-.747 0-1.428.258-1.98.68a9 9 0 0 0-.22-.22a3.25 3.25 0 0 0 .664-1.962a3.282 3.282 0 0 0-6.301-1.286a13 13 0 0 0-3.532-.494c-7.249 0-13.128 5.878-13.128 13.128s5.88 13.128 13.128 13.128a13 13 0 0 0 3.532-.495a3.282 3.282 0 0 0 6.301-1.285a3.25 3.25 0 0 0-.664-1.962q.113-.108.22-.22c.552.421 1.233.68 1.98.68a3.282 3.282 0 0 0 1.265-6.31l.076-.296c.138.017.276.042.419.042" />
|
|
16
|
+
<path d="M183.795 32.492c-.21 0-.433-.026-.643-.065a3.3 3.3 0 0 1-.617-.184a3.4 3.4 0 0 1-.566-.302a5 5 0 0 1-.5-.407c-.142-.158-.287-.315-.405-.499a3.5 3.5 0 0 1-.303-.564a3.4 3.4 0 0 1-.248-1.26c0-.21.026-.434.065-.644s.105-.407.183-.617c.08-.197.185-.38.303-.565c.118-.17.263-.34.406-.498c.159-.145.328-.29.499-.407a3.2 3.2 0 0 1 1.183-.486a3 3 0 0 1 1.286 0c.209.04.42.105.617.184c.196.078.38.183.565.302c.17.118.34.262.499.407c.144.157.288.328.407.498c.118.184.223.368.301.565c.08.21.145.407.184.617c.038.21.066.433.066.643a3.33 3.33 0 0 1-.958 2.324a5 5 0 0 1-.5.407a3.4 3.4 0 0 1-.564.302a3.4 3.4 0 0 1-.617.184c-.21.04-.433.065-.643.065m26.256-1.641a3.35 3.35 0 0 1-2.325-.958a5 5 0 0 1-.405-.499a3.5 3.5 0 0 1-.304-.564a3.4 3.4 0 0 1-.248-1.26c0-.867.355-1.707.957-2.324c.16-.145.328-.29.5-.407a3.2 3.2 0 0 1 1.182-.486c.42-.092.866-.092 1.287 0c.208.04.42.105.617.184c.195.078.38.183.564.302c.17.118.34.262.499.407c.603.617.958 1.457.958 2.323a3.4 3.4 0 0 1-.249 1.261c-.092.196-.184.38-.302.564c-.118.17-.263.341-.407.499a5 5 0 0 1-.499.407a3.4 3.4 0 0 1-.564.302a3.4 3.4 0 0 1-.617.184c-.21.039-.434.065-.644.065" />
|
|
17
|
+
</svg>
|