@sp-days-framework/docusaurus-plugin-interactive-tasks 1.0.5-rc2 → 1.1.0-beta2

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.
@@ -0,0 +1,275 @@
1
+ ---
2
+ sidebar_position: 1.2
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
+ # Advanced Configuration
12
+
13
+ ## TOC (Table of Contents) Configuration
14
+
15
+ The Interactive Tasks plugin supports TOC configuration via the `remarkTaskDirective` plugin options. This allows you to control whether tasks appear in the table of contents and at what heading level.
16
+
17
+ ### Remark Plugin Options
18
+
19
+ Configure TOC behavior in your `docusaurus.config.ts` for each docs instance:
20
+
21
+ ```ts title="docusaurus.config.ts"
22
+ module.exports = {
23
+ presets: [
24
+ [
25
+ 'classic',
26
+ {
27
+ docs: {
28
+ beforeDefaultRemarkPlugins: [
29
+ [
30
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
31
+ .remarkTaskDirective,
32
+ {
33
+ // Enable TOC generation for tasks (default: true)
34
+ tocEnabled: true,
35
+
36
+ // Heading level for TOC entries (default: 2)
37
+ // Values: 2 (h2), 3 (h3), 4 (h4), 5 (h5), 6 (h6)
38
+ tocHeadingLevel: 2,
39
+ },
40
+ ],
41
+ ],
42
+ },
43
+ },
44
+ ],
45
+ ],
46
+ };
47
+ ```
48
+
49
+ ### Remark Plugin Options Reference
50
+
51
+ | Option | Type | Default | Description |
52
+ |--------|------|---------|-------------|
53
+ | `tocEnabled` | `boolean` | `true` | Enable/disable TOC entry generation for tasks |
54
+ | `tocHeadingLevel` | `2` \| `3` \| `4` \| `5` \| `6` | `2` | Heading level for TOC entries (h2-h6) |
55
+
56
+ ### TOC Configuration Examples
57
+
58
+ #### Disable TOC Generation
59
+
60
+ If you don't want tasks to appear in the table of contents:
61
+
62
+ ```ts title="docusaurus.config.ts"
63
+ beforeDefaultRemarkPlugins: [
64
+ [
65
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
66
+ .remarkTaskDirective,
67
+ {
68
+ tocEnabled: false,
69
+ },
70
+ ],
71
+ ],
72
+ ```
73
+
74
+ #### Use h3 for Task TOC Entries
75
+
76
+ To make tasks appear as subsections in the TOC:
77
+
78
+ ```ts title="docusaurus.config.ts"
79
+ beforeDefaultRemarkPlugins: [
80
+ [
81
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
82
+ .remarkTaskDirective,
83
+ {
84
+ tocEnabled: true,
85
+ tocHeadingLevel: 3, // Tasks appear as h3 in TOC
86
+ },
87
+ ],
88
+ ],
89
+ ```
90
+
91
+ This is useful when you have main h2 headings and want tasks to be nested under them in the TOC.
92
+
93
+ #### Different Config Per Docs Instance
94
+
95
+ You can configure TOC differently for each docs instance:
96
+
97
+ ```ts title="docusaurus.config.ts"
98
+ module.exports = {
99
+ presets: [
100
+ [
101
+ 'classic',
102
+ {
103
+ docs: {
104
+ // Course docs: use h2 for tasks
105
+ beforeDefaultRemarkPlugins: [
106
+ [
107
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
108
+ .remarkTaskDirective,
109
+ { tocEnabled: true, tocHeadingLevel: 2 },
110
+ ],
111
+ ],
112
+ },
113
+ },
114
+ ],
115
+ ],
116
+ plugins: [
117
+ [
118
+ '@docusaurus/plugin-content-docs',
119
+ {
120
+ id: 'resources',
121
+ path: 'resources',
122
+ // Resources docs: use h3 for tasks
123
+ beforeDefaultRemarkPlugins: [
124
+ [
125
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
126
+ .remarkTaskDirective,
127
+ { tocEnabled: true, tocHeadingLevel: 3 },
128
+ ],
129
+ ],
130
+ },
131
+ ],
132
+ ],
133
+ };
134
+ ```
135
+
136
+ ## Document Frontmatter Options
137
+
138
+ | Property | Type | Default | Description |
139
+ | ------------------------------- | --------- | ------- | -------------------------------------------------- |
140
+ | `sidebar_task_hide_progress` | `boolean` | `false` | Hide the task progress badge entirely |
141
+ | `sidebar_task_disable_icon` | `boolean` | `false` | Show "5/5" instead of checkmark icon when complete |
142
+ | `sidebar_task_badge_colors` | `object` | - | Badge color configuration (see below) |
143
+
144
+ ### Badge Colors Structure
145
+
146
+ ```yaml
147
+ sidebar_task_badge_colors:
148
+ completed:
149
+ lightmode: "#4caf50" # Background color when all tasks completed (light mode)
150
+ darkmode: "#66bb6a" # Background color when all tasks completed (dark mode)
151
+ incomplete:
152
+ lightmode: "#2196f3" # Background color when tasks incomplete (light mode)
153
+ darkmode: "#42a5f5" # Background color when tasks incomplete (dark mode)
154
+ font:
155
+ lightmode: "#ffffff" # Text color (light mode)
156
+ darkmode: "#000000" # Text color (dark mode)
157
+ ```
158
+
159
+ **Supported Color Formats:**
160
+
161
+ - Hex: `#ff6b6b`, `#f00`
162
+ - RGB/RGBA: `rgb(255, 107, 107)`, `rgba(255, 107, 107, 0.8)`
163
+ - HSL/HSLA: `hsl(0, 100%, 71%)`
164
+ - Named colors: `red`, `blue`, `green`
165
+ - CSS variables: `var(--ifm-color-primary)`
166
+
167
+ ## How It Works
168
+
169
+ ### Task Registry
170
+
171
+ During the build process, the plugin:
172
+
173
+ 1. **Scans** all MDX files in the docs directory for task directives
174
+ 2. **Extracts** metadata from each task (name, number, document info)
175
+ 3. **Reads** frontmatter for document-level badge customization
176
+ 4. **Generates** a registry file (`task-registry.json`) containing:
177
+ - Total task count per document
178
+ - Task names and sequential numbers
179
+ - Document metadata (title, section, permalink)
180
+ - Badge customization settings from frontmatter
181
+ - Sidebar position information
182
+
183
+ The registry powers features like the TaskProgression component and sidebar badges.
184
+
185
+ ### Completion Tracking
186
+
187
+ Task completion is tracked using browser localStorage:
188
+
189
+ - **Storage Keys** - Format: `task-{pluginId}-{docId}-{taskNumber}-{encodedName}`
190
+ - **Real-time Updates** - Progress updates immediately when tasks are completed
191
+ - **Cross-tab Sync** - Changes sync across browser tabs via storage events
192
+ - **Persistence** - Completion state persists across browser sessions
193
+
194
+ ### Path Resolution
195
+
196
+ The TaskProgression component uses intelligent path resolution:
197
+
198
+ 1. **Normalizes** the provided path (handles `@site/` prefix, file extensions)
199
+ 2. **Resolves** relative paths (`.`, `./`, `../`) based on current document
200
+ 3. **Searches** the task registry for matching document source
201
+ 4. **Returns** document metadata and task information
202
+
203
+ This allows flexible path references:
204
+
205
+ ```mdx
206
+ <!-- Absolute paths -->
207
+ <TaskProgression path="/docs/module1/tasks" />
208
+
209
+ <!-- Relative paths -->
210
+ <TaskProgression path="./sibling-page" />
211
+ <TaskProgression path="../parent-page" />
212
+
213
+ <!-- Current page -->
214
+ <TaskProgression path="." />
215
+ ```
216
+
217
+ ## Multiple Docs Instances
218
+
219
+ The plugin automatically works with [multiple docs instances](https://docusaurus.io/docs/docs-multi-instance). Each instance is tracked independently:
220
+
221
+ ```js title="docusaurus.config.js"
222
+ module.exports = {
223
+ presets: [
224
+ [
225
+ '@docusaurus/preset-classic',
226
+ {
227
+ docs: {
228
+ path: 'docs',
229
+ remarkPlugins: [
230
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks').remarkTaskDirective,
231
+ ],
232
+ },
233
+ },
234
+ ],
235
+ ],
236
+ plugins: [
237
+ '@sp-days-framework/docusaurus-plugin-interactive-tasks',
238
+ [
239
+ '@docusaurus/plugin-content-docs',
240
+ {
241
+ id: 'community',
242
+ path: 'community',
243
+ routeBasePath: 'community',
244
+ remarkPlugins: [
245
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks').remarkTaskDirective,
246
+ ],
247
+ },
248
+ ],
249
+ ],
250
+ };
251
+ ```
252
+
253
+ The `TaskProgression` component auto-detects the instance. To reference a different instance explicitly:
254
+
255
+ ```mdx
256
+ <!-- Auto-detects parent doc's instance -->
257
+ <TaskProgression path="./intro" />
258
+
259
+ <!-- Explicitly reference a different instance -->
260
+ <TaskProgression path="/docs/intro" pluginId="default" />
261
+ <TaskProgression path="/community/getting-started" pluginId="community" />
262
+ ```
263
+
264
+ ### Configuring `TaskProgression`
265
+
266
+ | Prop | Type | Default | Description |
267
+ | ---------- | -------- | ----------- | ---------------------------------------------- |
268
+ | `path` | `string` | **Required** | Path to the document (absolute or relative) |
269
+ | `pluginId` | `string` | *Auto-detected* | [Docs Multi-instance](https://docusaurus.io/docs/docs-multi-instance) instance ID. Auto-detects from parent doc if not provided. |
270
+
271
+ ### Configuring `TaskProgressionOverview`
272
+
273
+ | Prop | Type | Default | Description |
274
+ | ---------- | -------- | ----------- | ---------------------------- |
275
+ | `pluginId` | `string` | *Auto-detected* | [Docs Multi-instance](https://docusaurus.io/docs/docs-multi-instance) instance ID. Auto-detects from parent doc if not provided. |
@@ -0,0 +1,192 @@
1
+ ---
2
+ toc_max_heading_level: 2
3
+ sidebar_position: 4.1
4
+ sidebar_label: "Change Logs"
5
+ sidebar_custom_props:
6
+ section: "Releases"
7
+ section_position: 4
8
+ ---
9
+
10
+ # Changelog
11
+
12
+ ## `@sp-days-framework/docusaurus-plugin-interactive-tasks`
13
+
14
+ [![npm version](https://img.shields.io/npm/v/@sp-days-framework/docusaurus-plugin-interactive-tasks?logo=nodedotjs)](https://www.npmjs.com/package/@sp-days-framework/docusaurus-plugin-interactive-tasks)
15
+
16
+ :::note
17
+ All packages within `@sp-days-framework` use the same version number. In some cases, a package might just be "bumped" to match the rest without any functional changes.
18
+ :::
19
+
20
+ ---
21
+
22
+ ## Version 1.1.0-beta2 ![beta](https://img.shields.io/badge/release-beta-yellow)
23
+
24
+ Enhanced documentation with practical examples
25
+
26
+ <details>
27
+ <summary><strong>Beta Details</strong> (2025 December 09)</summary>
28
+
29
+ ### Improvements
30
+
31
+ - **Better Documentation**: Added new task examples with detailed output explanations
32
+ - Clearer demonstrations of plugin capabilities
33
+ - More practical usage examples for common scenarios
34
+ - **Improved Structure**: Updated sidebar positions and added known issues documentation
35
+ - **Visual Refinements**: Enhanced sidebar and navbar logo handling
36
+
37
+ </details>
38
+
39
+ ---
40
+
41
+ ## Version 1.1.0-beta1 ![beta](https://img.shields.io/badge/release-beta-yellow)
42
+
43
+ Show expected outputs and enjoy smoother interactions
44
+
45
+ <details>
46
+ <summary><strong>Beta Details</strong> (2025 December 08)</summary>
47
+
48
+ ### New Features
49
+
50
+ - **Output Display**: Show learners what to expect when completing tasks
51
+ - New `:::output` directive displays expected command results or task outcomes
52
+ - Helps learners verify they're on the right track
53
+ - Consistent styling with hints and solutions
54
+
55
+ - **Better Navigation**: Tasks now appear in your page's table of contents
56
+ - Easier to jump between tasks in long tutorials
57
+ - Improved document structure for better accessibility
58
+
59
+ ### Improvements
60
+
61
+ - **Smoother Animations**: Polished panel transitions when revealing hints, solutions, and outputs
62
+ - No more jarring layout shifts
63
+ - More responsive and professional feel
64
+
65
+ ### Bug Fixes
66
+
67
+ - Fixed compatibility issues with Docusaurus's markdown processing pipeline
68
+
69
+ ### Package Documentation
70
+
71
+ - Documentation is now bundled with the npm package, making it accessible during development and for offline reference
72
+
73
+ </details>
74
+
75
+ ---
76
+
77
+ ## Version 1.0.4 ![Release](https://img.shields.io/badge/release-production-blue)
78
+
79
+ TOC support and animation improvements
80
+
81
+ <details>
82
+ <summary><strong>Details</strong> (2025 December 1)</summary>
83
+
84
+ ### New Features
85
+
86
+ - Added TOC support for Task Component
87
+
88
+ ### Improvements
89
+
90
+ - Refactor Task Component animation for smoother transitions
91
+
92
+ ### Migration Guide
93
+
94
+ Users will need to update their Docusaurus config file to use `beforeDefaultRemarkPlugins` instead of `remarkPlugins`
95
+
96
+ **Examples:**
97
+
98
+ ```js title="/src/components/HelloCodeTitle.js"
99
+ presets: [
100
+ [
101
+ "classic",
102
+ {
103
+ docs: {
104
+ id: "course",
105
+ path: "course",
106
+ routeBasePath: "course",
107
+ beforeDefaultRemarkPlugins: [
108
+ require("@sp-days-framework/docusaurus-plugin-interactive-tasks")
109
+ .remarkTaskDirective,
110
+ ],
111
+ ...
112
+ "@docusaurus/plugin-content-docs",
113
+ {
114
+ id: "resources",
115
+ path: "resources",
116
+ routeBasePath: "resources",
117
+ beforeDefaultRemarkPlugins: [
118
+ [
119
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
120
+ .remarkTaskDirective,
121
+ {
122
+ // TOC configuration for resources docs instance
123
+ tocEnabled: true,
124
+ tocHeadingLevel: 3, // Use h2 for TOC entries (can be 2-6)
125
+ },
126
+ ],
127
+
128
+ ```
129
+
130
+ </details>
131
+
132
+ ---
133
+
134
+ ## Version 1.0.3 ![Release](https://img.shields.io/badge/release-production-blue)
135
+
136
+ Component styling improvements
137
+
138
+ <details>
139
+ <summary><strong>Details</strong> (2025 November 27)</summary>
140
+
141
+ ### Bug Fixes
142
+
143
+ - Fix Task component styling
144
+
145
+ </details>
146
+
147
+ ---
148
+
149
+ ## Version 1.0.2 ![Release](https://img.shields.io/badge/release-production-blue)
150
+
151
+ Fix for broken anchors
152
+
153
+ <details>
154
+ <summary><strong>Details</strong> (2025 November 25)</summary>
155
+
156
+ ### Bug Fixes
157
+
158
+ - Resolve broken anchors by swizzling Layout instead of Root
159
+ - Removed swizzle of DocRoot and Root components to prevent interference with Docusaurus's SSG anchor collection
160
+ - Introduced a new Layout component to provide TaskProvider and DocTaskCounterProvider without breaking the component chain
161
+
162
+ </details>
163
+
164
+ ---
165
+
166
+ ## Version 1.0.1 ![Sync](https://img.shields.io/badge/sync-version--bump-lightgrey)
167
+
168
+ Code cleanup
169
+
170
+ <details>
171
+ <summary><strong>Details</strong> (2025 November 25)</summary>
172
+
173
+ ### Improvements
174
+
175
+ - Cleaned up MDXComponents to avoid direct imports that bypass theme resolution
176
+
177
+ </details>
178
+
179
+ ---
180
+
181
+ ## Version 1.0.0 ![Release](https://img.shields.io/badge/release-production-blue)
182
+
183
+ Initial release of the Interactive Tasks plugin
184
+
185
+ <details>
186
+ <summary><strong>Details</strong> (2025 November 24)</summary>
187
+
188
+ ### New Features
189
+
190
+ - Initial release with interactive task tracking functionality
191
+
192
+ </details>