@sp-days-framework/create-sp-days 1.0.2 → 1.0.4

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 (19) hide show
  1. package/package.json +1 -1
  2. package/sp-days-framework-create-sp-days-1.0.3.tgz +0 -0
  3. package/templates/addon-resources/resources/interactive-tasks/creating-tasks.mdx +136 -174
  4. package/templates/addon-resources/resources/interactive-tasks/setup/advanced-configuration.mdx +124 -1
  5. package/templates/addon-resources/resources/interactive-tasks/setup/index.mdx +1 -55
  6. package/templates/addon-slidev/package.json +4 -4
  7. package/templates/page-course/docusaurus.config.ts +16 -4
  8. package/templates/page-course/package.json +2 -2
  9. package/templates/addon-resources/resources/frontpage-collection/components/Columns.mdx +0 -191
  10. package/templates/addon-resources/resources/frontpage-collection/components/ContentBlock.mdx +0 -126
  11. package/templates/addon-resources/resources/frontpage-collection/components/CourseFeature.mdx +0 -147
  12. package/templates/addon-resources/resources/frontpage-collection/components/FancyHeader.mdx +0 -76
  13. package/templates/addon-resources/resources/frontpage-collection/components/GetStarted.mdx +0 -222
  14. package/templates/addon-resources/resources/frontpage-collection/components/HeroBanner.mdx +0 -205
  15. package/templates/addon-resources/resources/frontpage-collection/components/IconContainer.mdx +0 -249
  16. package/templates/addon-resources/resources/frontpage-collection/components/Iconify.mdx +0 -228
  17. package/templates/addon-resources/resources/frontpage-collection/components/_category_.yml +0 -2
  18. package/templates/addon-resources/resources/frontpage-collection/index.mdx +0 -85
  19. package/templates/addon-resources/resources/frontpage-collection/setup/index.mdx +0 -185
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sp-days-framework/create-sp-days",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Scaffolding tool for creating SP-Days course websites built on Docusaurus and Slidev.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -23,28 +23,21 @@ Learn how to create interactive tasks with various features including hints, sol
23
23
 
24
24
  A simple task without hints or solutions.
25
25
 
26
- <Tabs>
27
- <TabItem value="code" label="Code" default>
28
- ```md
29
- ::::task[Create a Component]
30
26
 
31
- Create a new React component in `src/components/MyComponent.tsx`.
27
+ ```md
28
+ ::::task[Create a Component]
32
29
 
33
- ::::
34
- ```
35
- </TabItem>
36
- <TabItem value="preview" label="Preview">
37
- <div className="preview">
38
- <div className="container" style={{ width: '-webkit-fill-available' }}>
39
- ::::task-example[Create a Component]
30
+ Create a new React component in `src/components/MyComponent.tsx`.
40
31
 
41
- Create a new React component in `src/components/MyComponent.tsx`.
32
+ ::::
33
+ ```
34
+
35
+ ::::task-example[Create a Component]
36
+
37
+ Create a new React component in `src/components/MyComponent.tsx`.
38
+
39
+ ::::
42
40
 
43
- ::::
44
- </div>
45
- </div>
46
- </TabItem>
47
- </Tabs>
48
41
 
49
42
  ---
50
43
 
@@ -52,36 +45,28 @@ A simple task without hints or solutions.
52
45
 
53
46
  Add a hint to guide users through the task.
54
47
 
55
- <Tabs>
56
- <TabItem value="code" label="Code" default>
57
- ```mdx
58
- ::::task[Configure TypeScript]
59
48
 
60
- Set up TypeScript configuration for strict mode.
49
+ ```mdx
50
+ ::::task[Configure TypeScript]
61
51
 
62
- :::hint
63
- Look for the `tsconfig.json` file in your project root.
64
- :::
52
+ Set up TypeScript configuration for strict mode.
65
53
 
66
- ::::
67
- ```
68
- </TabItem>
69
- <TabItem value="preview" label="Preview">
70
- <div className="preview">
71
- <div className="container" style={{ width: '-webkit-fill-available' }}>
72
- ::::task-example[Configure TypeScript]
54
+ :::hint
55
+ Look for the `tsconfig.json` file in your project root.
56
+ :::
73
57
 
74
- Set up TypeScript configuration for strict mode.
58
+ ::::
59
+ ```
75
60
 
76
- :::hint
77
- Look for the `tsconfig.json` file in your project root.
78
- :::
61
+ ::::task-example[Configure TypeScript]
79
62
 
80
- ::::
81
- </div>
82
- </div>
83
- </TabItem>
84
- </Tabs>
63
+ Set up TypeScript configuration for strict mode.
64
+
65
+ :::hint
66
+ Look for the `tsconfig.json` file in your project root.
67
+ :::
68
+
69
+ ::::
85
70
 
86
71
  ---
87
72
 
@@ -89,36 +74,28 @@ Add a hint to guide users through the task.
89
74
 
90
75
  Provide a complete solution for the task.
91
76
 
92
- <Tabs>
93
- <TabItem value="code" label="Code" default>
94
- ```mdx
95
- ::::task[Create Package JSON]
96
77
 
97
- Initialize a new Node.js project with npm.
78
+ ```mdx
79
+ ::::task[Create Package JSON]
98
80
 
99
- :::solution
100
- Run `npm init -y` in your project directory.
101
- :::
81
+ Initialize a new Node.js project with npm.
102
82
 
103
- ::::
104
- ```
105
- </TabItem>
106
- <TabItem value="preview" label="Preview">
107
- <div className="preview">
108
- <div className="container" style={{ width: '-webkit-fill-available' }}>
109
- ::::task-example[Create Package JSON]
83
+ :::solution
84
+ Run `npm init -y` in your project directory.
85
+ :::
110
86
 
111
- Initialize a new Node.js project with npm.
87
+ ::::
88
+ ```
112
89
 
113
- :::solution
114
- Run `npm init -y` in your project directory.
115
- :::
90
+ ::::task-example[Create Package JSON]
116
91
 
117
- ::::
118
- </div>
119
- </div>
120
- </TabItem>
121
- </Tabs>
92
+ Initialize a new Node.js project with npm.
93
+
94
+ :::solution
95
+ Run `npm init -y` in your project directory.
96
+ :::
97
+
98
+ ::::
122
99
 
123
100
  ---
124
101
 
@@ -126,60 +103,52 @@ Provide a complete solution for the task.
126
103
 
127
104
  Combine both hint and solution for comprehensive guidance.
128
105
 
129
- <Tabs>
130
- <TabItem value="code" label="Code" default>
131
- ````mdx
132
- ::::task[Add API Route]
133
-
134
- Create a new API endpoint for user authentication.
135
-
136
- :::hint
137
- API routes in Next.js go in the `app/api` directory.
138
- :::
139
-
140
- :::solution
141
- Create `app/api/auth/route.ts`:
142
-
143
- ```typescript
144
- export async function POST(request: Request) {
145
- const body = await request.json();
146
- // Authentication logic here
147
- return Response.json({ success: true });
148
- }
149
- ```
150
- :::
151
-
152
- ::::
153
- ````
154
- </TabItem>
155
- <TabItem value="preview" label="Preview">
156
- <div className="preview">
157
- <div className="container" style={{ width: '-webkit-fill-available' }}>
158
- ::::task-example[Add API Route]
159
-
160
- Create a new API endpoint for user authentication.
161
-
162
- :::hint
163
- API routes in Next.js go in the `app/api` directory.
164
- :::
165
-
166
- :::solution
167
- Create `app/api/auth/route.ts`:
168
-
169
- ```typescript
170
- export async function POST(request: Request) {
171
- const body = await request.json();
172
- // Authentication logic here
173
- return Response.json({ success: true });
174
- }
175
- ```
176
- :::
177
-
178
- ::::
179
- </div>
180
- </div>
181
- </TabItem>
182
- </Tabs>
106
+ ````mdx
107
+ ::::task[Add API Route]
108
+
109
+ Create a new API endpoint for user authentication.
110
+
111
+ :::hint
112
+ API routes in Next.js go in the `app/api` directory.
113
+ :::
114
+
115
+ :::solution
116
+ Create `app/api/auth/route.ts`:
117
+
118
+ ```typescript
119
+ export async function POST(request: Request) {
120
+ const body = await request.json();
121
+ // Authentication logic here
122
+ return Response.json({ success: true });
123
+ }
124
+ ```
125
+ :::
126
+
127
+ ::::
128
+ ````
129
+
130
+ ::::task-example[Add API Route]
131
+
132
+ Create a new API endpoint for user authentication.
133
+
134
+ :::hint
135
+ API routes in Next.js go in the `app/api` directory.
136
+ :::
137
+
138
+ :::solution
139
+ Create `app/api/auth/route.ts`:
140
+
141
+ ```typescript
142
+ export async function POST(request: Request) {
143
+ const body = await request.json();
144
+ // Authentication logic here
145
+ return Response.json({ success: true });
146
+ }
147
+ ```
148
+ :::
149
+
150
+ ::::
151
+
183
152
 
184
153
  ---
185
154
 
@@ -187,76 +156,69 @@ Combine both hint and solution for comprehensive guidance.
187
156
 
188
157
  Tasks fully support standard Docusaurus markdown features like the [admonitions feature](https://docusaurus.io/docs/markdown-features/admonitions).
189
158
 
190
- <Tabs>
191
- <TabItem value="code" label="Code" default>
192
- ````mdx
193
- ::::task[Setup Development Environment]
194
159
 
195
- Follow these steps to configure your workspace.
160
+ ````mdx
161
+ ::::task[Setup Development Environment]
162
+
163
+ Follow these steps to configure your workspace.
164
+
165
+ :::note
166
+ Make sure you have Node.js 18+ installed before proceeding.
167
+ :::
168
+
169
+ **Installation Steps:**
196
170
 
197
- :::note
198
- Make sure you have Node.js 18+ installed before proceeding.
199
- :::
171
+ 1. Install dependencies:
172
+ ```bash
173
+ npm install
174
+ ```
200
175
 
201
- **Installation Steps:**
176
+ 2. Start the development server:
177
+ ```bash
178
+ npm run dev
179
+ ```
202
180
 
203
- 1. Install dependencies:
204
- ```bash
205
- npm install
206
- ```
181
+ :::warning
182
+ Do not commit your `.env` file to version control!
183
+ :::
207
184
 
208
- 2. Start the development server:
209
- ```bash
210
- npm run dev
211
- ```
185
+ :::hint
186
+ Check the README.md for environment variable examples.
187
+ :::
212
188
 
213
- :::warning
214
- Do not commit your `.env` file to version control!
215
- :::
189
+ ::::
190
+ ````
216
191
 
217
- :::hint
218
- Check the README.md for environment variable examples.
219
- :::
192
+ ::::task-example[Setup Development Environment]
220
193
 
221
- ::::
222
- ````
223
- </TabItem>
224
- <TabItem value="preview" label="Preview">
225
- <div className="preview">
226
- <div className="container" style={{ width: '-webkit-fill-available' }}>
227
- ::::task-example[Setup Development Environment]
194
+ Follow these steps to configure your workspace.
228
195
 
229
- Follow these steps to configure your workspace.
196
+ :::note
197
+ Make sure you have Node.js 18+ installed before proceeding.
198
+ :::
230
199
 
231
- :::note
232
- Make sure you have Node.js 18+ installed before proceeding.
233
- :::
200
+ **Installation Steps:**
234
201
 
235
- **Installation Steps:**
202
+ 1. Install dependencies:
203
+ ```bash
204
+ npm install
205
+ ```
236
206
 
237
- 1. Install dependencies:
238
- ```bash
239
- npm install
240
- ```
207
+ 2. Start the development server:
208
+ ```bash
209
+ npm run dev
210
+ ```
241
211
 
242
- 2. Start the development server:
243
- ```bash
244
- npm run dev
245
- ```
212
+ :::warning
213
+ Do not commit your `.env` file to version control!
214
+ :::
246
215
 
247
- :::warning
248
- Do not commit your `.env` file to version control!
249
- :::
216
+ :::hint
217
+ Check the README.md for environment variable examples.
218
+ :::
250
219
 
251
- :::hint
252
- Check the README.md for environment variable examples.
253
- :::
220
+ ::::
254
221
 
255
- ::::
256
- </div>
257
- </div>
258
- </TabItem>
259
- </Tabs>
260
222
 
261
223
  ## Nesting
262
224
 
@@ -8,7 +8,130 @@ import TabItem from "@theme/TabItem";
8
8
 
9
9
  # Advanced Configuration
10
10
 
11
- ## Frontmatter Options Reference
11
+ ## TOC (Table of Contents) Configuration
12
+
13
+ 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.
14
+
15
+ ### Remark Plugin Options
16
+
17
+ Configure TOC behavior in your `docusaurus.config.ts` for each docs instance:
18
+
19
+ ```ts title="docusaurus.config.ts"
20
+ module.exports = {
21
+ presets: [
22
+ [
23
+ 'classic',
24
+ {
25
+ docs: {
26
+ beforeDefaultRemarkPlugins: [
27
+ [
28
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
29
+ .remarkTaskDirective,
30
+ {
31
+ // Enable TOC generation for tasks (default: true)
32
+ tocEnabled: true,
33
+
34
+ // Heading level for TOC entries (default: 2)
35
+ // Values: 2 (h2), 3 (h3), 4 (h4), 5 (h5), 6 (h6)
36
+ tocHeadingLevel: 2,
37
+ },
38
+ ],
39
+ ],
40
+ },
41
+ },
42
+ ],
43
+ ],
44
+ };
45
+ ```
46
+
47
+ ### Remark Plugin Options Reference
48
+
49
+ | Option | Type | Default | Description |
50
+ |--------|------|---------|-------------|
51
+ | `tocEnabled` | `boolean` | `true` | Enable/disable TOC entry generation for tasks |
52
+ | `tocHeadingLevel` | `2` \| `3` \| `4` \| `5` \| `6` | `2` | Heading level for TOC entries (h2-h6) |
53
+
54
+ ### TOC Configuration Examples
55
+
56
+ #### Disable TOC Generation
57
+
58
+ If you don't want tasks to appear in the table of contents:
59
+
60
+ ```ts title="docusaurus.config.ts"
61
+ beforeDefaultRemarkPlugins: [
62
+ [
63
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
64
+ .remarkTaskDirective,
65
+ {
66
+ tocEnabled: false,
67
+ },
68
+ ],
69
+ ],
70
+ ```
71
+
72
+ #### Use h3 for Task TOC Entries
73
+
74
+ To make tasks appear as subsections in the TOC:
75
+
76
+ ```ts title="docusaurus.config.ts"
77
+ beforeDefaultRemarkPlugins: [
78
+ [
79
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
80
+ .remarkTaskDirective,
81
+ {
82
+ tocEnabled: true,
83
+ tocHeadingLevel: 3, // Tasks appear as h3 in TOC
84
+ },
85
+ ],
86
+ ],
87
+ ```
88
+
89
+ This is useful when you have main h2 headings and want tasks to be nested under them in the TOC.
90
+
91
+ #### Different Config Per Docs Instance
92
+
93
+ You can configure TOC differently for each docs instance:
94
+
95
+ ```ts title="docusaurus.config.ts"
96
+ module.exports = {
97
+ presets: [
98
+ [
99
+ 'classic',
100
+ {
101
+ docs: {
102
+ // Course docs: use h2 for tasks
103
+ beforeDefaultRemarkPlugins: [
104
+ [
105
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
106
+ .remarkTaskDirective,
107
+ { tocEnabled: true, tocHeadingLevel: 2 },
108
+ ],
109
+ ],
110
+ },
111
+ },
112
+ ],
113
+ ],
114
+ plugins: [
115
+ [
116
+ '@docusaurus/plugin-content-docs',
117
+ {
118
+ id: 'resources',
119
+ path: 'resources',
120
+ // Resources docs: use h3 for tasks
121
+ beforeDefaultRemarkPlugins: [
122
+ [
123
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
124
+ .remarkTaskDirective,
125
+ { tocEnabled: true, tocHeadingLevel: 3 },
126
+ ],
127
+ ],
128
+ },
129
+ ],
130
+ ],
131
+ };
132
+ ```
133
+
134
+ ## Document Frontmatter Options
12
135
 
13
136
  | Property | Type | Default | Description |
14
137
  | ------------------------------- | --------- | ------- | -------------------------------------------------- |
@@ -39,7 +39,7 @@ module.exports = {
39
39
  "classic",
40
40
  {
41
41
  docs: {
42
- remarkPlugins: [
42
+ beforeDefaultRemarkPlugins: [
43
43
  require("@sp-days-framework/docusaurus-plugin-interactive-tasks")
44
44
  .remarkTaskDirective,
45
45
  ],
@@ -50,60 +50,6 @@ module.exports = {
50
50
  };
51
51
  ```
52
52
 
53
- The plugin requires two integrations:
54
-
55
- 1. **Plugin** - Auto-discovers all docs instances, generates task registry, and provides theme components
56
- 2. **Remark Plugin** - Transforms task directives in markdown to React components (must be added to each docs instance)
57
-
58
- ## Configuration
59
-
60
- ### Basic Plugin Setup
61
-
62
- The plugin automatically discovers all Docusaurus docs instances:
63
-
64
- ```js title="docusaurus.config.js"
65
- module.exports = {
66
- plugins: [
67
- "@sp-days-framework/docusaurus-plugin-interactive-tasks",
68
- ],
69
- };
70
- ```
71
-
72
- ### Remark Plugin Configuration
73
-
74
- Add the `remarkTaskDirective` to each docs instance's `remarkPlugins` array:
75
-
76
- ```js title="docusaurus.config.js" {8-10,22-24}
77
- module.exports = {
78
- presets: [
79
- [
80
- '@docusaurus/preset-classic',
81
- {
82
- docs: {
83
- // Default instance
84
- remarkPlugins: [
85
- require('@sp-days-framework/docusaurus-plugin-interactive-tasks').remarkTaskDirective,
86
- ],
87
- },
88
- },
89
- ],
90
- ],
91
- plugins: [
92
- '@sp-days-framework/docusaurus-plugin-interactive-tasks',
93
- [
94
- '@docusaurus/plugin-content-docs',
95
- {
96
- id: 'community',
97
- path: 'community',
98
- remarkPlugins: [
99
- require('@sp-days-framework/docusaurus-plugin-interactive-tasks').remarkTaskDirective,
100
- ],
101
- },
102
- ],
103
- ],
104
- };
105
- ```
106
-
107
53
  ### Frontmatter Options
108
54
 
109
55
  Customize task badge appearance for individual pages:
@@ -20,10 +20,10 @@
20
20
  "@docusaurus/preset-classic": "^3.9.2",
21
21
  "@docusaurus/theme-mermaid": "^3.9.2",
22
22
  "@mdx-js/react": "^3.0.0",
23
- "@sp-days-framework/docusaurus-frontpage-collection": "^1.0.2",
24
- "@sp-days-framework/docusaurus-plugin-interactive-tasks": "^1.0.2",
25
- "@sp-days-framework/docusaurus-plugin-slidev": "^1.0.2",
26
- "@sp-days-framework/slidev-theme-sykehuspartner": "^1.0.2",
23
+ "@sp-days-framework/docusaurus-frontpage-collection": "^1.0.4",
24
+ "@sp-days-framework/docusaurus-plugin-interactive-tasks": "^1.0.4",
25
+ "@sp-days-framework/docusaurus-plugin-slidev": "^1.0.4",
26
+ "@sp-days-framework/slidev-theme-sykehuspartner": "^1.0.4",
27
27
  "clsx": "^2.0.0",
28
28
  "docusaurus-plugin-sass": "^0.2.6",
29
29
  "prism-react-renderer": "^2.3.0",
@@ -41,7 +41,7 @@ const config: Config = {
41
41
  id: "course",
42
42
  path: "course",
43
43
  routeBasePath: "course",
44
- remarkPlugins: [
44
+ beforeDefaultRemarkPlugins: [
45
45
  require("@sp-days-framework/docusaurus-plugin-interactive-tasks")
46
46
  .remarkTaskDirective,
47
47
  ],
@@ -73,9 +73,16 @@ const config: Config = {
73
73
  id: "resources",
74
74
  path: "resources",
75
75
  routeBasePath: "resources",
76
- remarkPlugins: [
77
- require("@sp-days-framework/docusaurus-plugin-interactive-tasks")
78
- .remarkTaskDirective,
76
+ beforeDefaultRemarkPlugins: [
77
+ [
78
+ require('@sp-days-framework/docusaurus-plugin-interactive-tasks')
79
+ .remarkTaskDirective,
80
+ {
81
+ // TOC configuration for resources docs instance
82
+ tocEnabled: true,
83
+ tocHeadingLevel: 3, // Use h2 for TOC entries (can be 2-6)
84
+ },
85
+ ],
79
86
  ],
80
87
  },
81
88
  ],
@@ -90,6 +97,11 @@ const config: Config = {
90
97
  themes: ["@docusaurus/theme-mermaid"],
91
98
 
92
99
  themeConfig: {
100
+ docs: {
101
+ sidebar: {
102
+ hideable: true,
103
+ },
104
+ },
93
105
  colorMode: {
94
106
  respectPrefersColorScheme: true,
95
107
  },
@@ -19,8 +19,8 @@
19
19
  "@docusaurus/preset-classic": "^3.9.2",
20
20
  "@docusaurus/theme-mermaid": "^3.9.2",
21
21
  "@mdx-js/react": "^3.0.0",
22
- "@sp-days-framework/docusaurus-frontpage-collection": "^1.0.2",
23
- "@sp-days-framework/docusaurus-plugin-interactive-tasks": "^1.0.2",
22
+ "@sp-days-framework/docusaurus-frontpage-collection": "^1.0.4",
23
+ "@sp-days-framework/docusaurus-plugin-interactive-tasks": "^1.0.4",
24
24
  "clsx": "^2.0.0",
25
25
  "docusaurus-plugin-sass": "^0.2.6",
26
26
  "prism-react-renderer": "^2.3.0",