@sp-days-framework/docusaurus-plugin-interactive-tasks 1.0.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.
- package/LICENSE +21 -0
- package/README.md +339 -0
- package/lib/contexts/DocTaskCounterContext.d.ts +15 -0
- package/lib/contexts/DocTaskCounterContext.d.ts.map +1 -0
- package/lib/contexts/DocTaskCounterContext.js +7 -0
- package/lib/contexts/DocTaskCounterContext.js.map +1 -0
- package/lib/contexts/TaskContext.d.ts +72 -0
- package/lib/contexts/TaskContext.d.ts.map +1 -0
- package/lib/contexts/TaskContext.js +6 -0
- package/lib/contexts/TaskContext.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +59 -0
- package/lib/index.js.map +1 -0
- package/lib/plugin/TaskRegistryPlugin.d.ts +27 -0
- package/lib/plugin/TaskRegistryPlugin.d.ts.map +1 -0
- package/lib/plugin/TaskRegistryPlugin.js +328 -0
- package/lib/plugin/TaskRegistryPlugin.js.map +1 -0
- package/lib/plugin/remarkTaskDirective.d.ts +29 -0
- package/lib/plugin/remarkTaskDirective.d.ts.map +1 -0
- package/lib/plugin/remarkTaskDirective.js +277 -0
- package/lib/plugin/remarkTaskDirective.js.map +1 -0
- package/lib/theme/DocRoot/Layout/index.d.ts +14 -0
- package/lib/theme/DocRoot/Layout/index.d.ts.map +1 -0
- package/lib/theme/DocRoot/Layout/index.js +27 -0
- package/lib/theme/DocRoot/Layout/index.js.map +1 -0
- package/lib/theme/DocRoot/index.d.ts +22 -0
- package/lib/theme/DocRoot/index.d.ts.map +1 -0
- package/lib/theme/DocRoot/index.js +33 -0
- package/lib/theme/DocRoot/index.js.map +1 -0
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.d.ts +4 -0
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.d.ts.map +1 -0
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.js +24 -0
- package/lib/theme/DocSidebar/Desktop/CollapseButton/index.js.map +1 -0
- package/lib/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +40 -0
- package/lib/theme/DocSidebar/Desktop/Content/index.d.ts +4 -0
- package/lib/theme/DocSidebar/Desktop/Content/index.d.ts.map +1 -0
- package/lib/theme/DocSidebar/Desktop/Content/index.js +67 -0
- package/lib/theme/DocSidebar/Desktop/Content/index.js.map +1 -0
- package/lib/theme/DocSidebar/Desktop/Content/styles.module.css +16 -0
- package/lib/theme/DocSidebar/Desktop/index.d.ts +6 -0
- package/lib/theme/DocSidebar/Desktop/index.d.ts.map +1 -0
- package/lib/theme/DocSidebar/Desktop/index.js +21 -0
- package/lib/theme/DocSidebar/Desktop/index.js.map +1 -0
- package/lib/theme/DocSidebar/Desktop/styles.module.css +37 -0
- package/lib/theme/DocSidebar/Mobile/index.d.ts +6 -0
- package/lib/theme/DocSidebar/Mobile/index.d.ts.map +1 -0
- package/lib/theme/DocSidebar/Mobile/index.js +29 -0
- package/lib/theme/DocSidebar/Mobile/index.js.map +1 -0
- package/lib/theme/DocSidebar/index.d.ts +4 -0
- package/lib/theme/DocSidebar/index.d.ts.map +1 -0
- package/lib/theme/DocSidebar/index.js +21 -0
- package/lib/theme/DocSidebar/index.js.map +1 -0
- package/lib/theme/DocSidebarItem/Category/index.d.ts +4 -0
- package/lib/theme/DocSidebarItem/Category/index.d.ts.map +1 -0
- package/lib/theme/DocSidebarItem/Category/index.js +316 -0
- package/lib/theme/DocSidebarItem/Category/index.js.map +1 -0
- package/lib/theme/DocSidebarItem/Category/styles.module.css +187 -0
- package/lib/theme/DocSidebarItem/Html/index.d.ts +4 -0
- package/lib/theme/DocSidebarItem/Html/index.d.ts.map +1 -0
- package/lib/theme/DocSidebarItem/Html/index.js +17 -0
- package/lib/theme/DocSidebarItem/Html/index.js.map +1 -0
- package/lib/theme/DocSidebarItem/Html/styles.module.css +6 -0
- package/lib/theme/DocSidebarItem/Link/index.d.ts +6 -0
- package/lib/theme/DocSidebarItem/Link/index.d.ts.map +1 -0
- package/lib/theme/DocSidebarItem/Link/index.js +149 -0
- package/lib/theme/DocSidebarItem/Link/index.js.map +1 -0
- package/lib/theme/DocSidebarItem/Link/styles.module.css +197 -0
- package/lib/theme/DocSidebarItem/index.d.ts +4 -0
- package/lib/theme/DocSidebarItem/index.d.ts.map +1 -0
- package/lib/theme/DocSidebarItem/index.js +22 -0
- package/lib/theme/DocSidebarItem/index.js.map +1 -0
- package/lib/theme/DocSidebarItems/index.d.ts +6 -0
- package/lib/theme/DocSidebarItems/index.d.ts.map +1 -0
- package/lib/theme/DocSidebarItems/index.js +48 -0
- package/lib/theme/DocSidebarItems/index.js.map +1 -0
- package/lib/theme/DocTaskCounterProvider/index.d.ts +20 -0
- package/lib/theme/DocTaskCounterProvider/index.d.ts.map +1 -0
- package/lib/theme/DocTaskCounterProvider/index.js +105 -0
- package/lib/theme/DocTaskCounterProvider/index.js.map +1 -0
- package/lib/theme/MDXComponents.d.ts +19 -0
- package/lib/theme/MDXComponents.d.ts.map +1 -0
- package/lib/theme/MDXComponents.js +52 -0
- package/lib/theme/MDXComponents.js.map +1 -0
- package/lib/theme/Root.d.ts +9 -0
- package/lib/theme/Root.d.ts.map +1 -0
- package/lib/theme/Root.js +105 -0
- package/lib/theme/Root.js.map +1 -0
- package/lib/theme/Task/Hint/index.d.ts +14 -0
- package/lib/theme/Task/Hint/index.d.ts.map +1 -0
- package/lib/theme/Task/Hint/index.js +23 -0
- package/lib/theme/Task/Hint/index.js.map +1 -0
- package/lib/theme/Task/Hint/styles.module.css +72 -0
- package/lib/theme/Task/Solution/index.d.ts +14 -0
- package/lib/theme/Task/Solution/index.d.ts.map +1 -0
- package/lib/theme/Task/Solution/index.js +23 -0
- package/lib/theme/Task/Solution/index.js.map +1 -0
- package/lib/theme/Task/Solution/styles.module.css +71 -0
- package/lib/theme/Task/Text/index.d.ts +14 -0
- package/lib/theme/Task/Text/index.d.ts.map +1 -0
- package/lib/theme/Task/Text/index.js +18 -0
- package/lib/theme/Task/Text/index.js.map +1 -0
- package/lib/theme/Task/Text/styles.module.css +39 -0
- package/lib/theme/Task/index.d.ts +11 -0
- package/lib/theme/Task/index.d.ts.map +1 -0
- package/lib/theme/Task/index.js +286 -0
- package/lib/theme/Task/index.js.map +1 -0
- package/lib/theme/Task/styles.module.css +529 -0
- package/lib/theme/TaskAutoHideToggle/index.d.ts +10 -0
- package/lib/theme/TaskAutoHideToggle/index.d.ts.map +1 -0
- package/lib/theme/TaskAutoHideToggle/index.js +79 -0
- package/lib/theme/TaskAutoHideToggle/index.js.map +1 -0
- package/lib/theme/TaskAutoHideToggle/styles.module.css +41 -0
- package/lib/theme/TaskExample/index.d.ts +16 -0
- package/lib/theme/TaskExample/index.d.ts.map +1 -0
- package/lib/theme/TaskExample/index.js +249 -0
- package/lib/theme/TaskExample/index.js.map +1 -0
- package/lib/theme/TaskPlaceholder/README.md +119 -0
- package/lib/theme/TaskPlaceholder/index.d.ts +23 -0
- package/lib/theme/TaskPlaceholder/index.d.ts.map +1 -0
- package/lib/theme/TaskPlaceholder/index.js +293 -0
- package/lib/theme/TaskPlaceholder/index.js.map +1 -0
- package/lib/theme/TaskProgression/index.d.ts +11 -0
- package/lib/theme/TaskProgression/index.d.ts.map +1 -0
- package/lib/theme/TaskProgression/index.js +131 -0
- package/lib/theme/TaskProgression/index.js.map +1 -0
- package/lib/theme/TaskProgression/styles.module.css +162 -0
- package/lib/theme/TaskProgressionOverview/index.d.ts +10 -0
- package/lib/theme/TaskProgressionOverview/index.d.ts.map +1 -0
- package/lib/theme/TaskProgressionOverview/index.js +123 -0
- package/lib/theme/TaskProgressionOverview/index.js.map +1 -0
- package/lib/theme/TaskProgressionOverview/styles.module.css +159 -0
- package/lib/theme/TaskProvider/index.d.ts +15 -0
- package/lib/theme/TaskProvider/index.d.ts.map +1 -0
- package/lib/theme/TaskProvider/index.js +134 -0
- package/lib/theme/TaskProvider/index.js.map +1 -0
- package/lib/utils/badgeStyles.d.ts +29 -0
- package/lib/utils/badgeStyles.d.ts.map +1 -0
- package/lib/utils/badgeStyles.js +60 -0
- package/lib/utils/badgeStyles.js.map +1 -0
- package/lib/utils/icons.d.ts +38 -0
- package/lib/utils/icons.d.ts.map +1 -0
- package/lib/utils/icons.js +53 -0
- package/lib/utils/icons.js.map +1 -0
- package/lib/utils/logger.d.ts +38 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +72 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/storage.d.ts +33 -0
- package/lib/utils/storage.d.ts.map +1 -0
- package/lib/utils/storage.js +105 -0
- package/lib/utils/storage.js.map +1 -0
- package/lib/utils/useDocTaskStats.d.ts +58 -0
- package/lib/utils/useDocTaskStats.d.ts.map +1 -0
- package/lib/utils/useDocTaskStats.js +206 -0
- package/lib/utils/useDocTaskStats.js.map +1 -0
- package/lib/utils/usePluginId.d.ts +24 -0
- package/lib/utils/usePluginId.d.ts.map +1 -0
- package/lib/utils/usePluginId.js +61 -0
- package/lib/utils/usePluginId.js.map +1 -0
- package/lib/utils/useResolveDocPath.d.ts +33 -0
- package/lib/utils/useResolveDocPath.d.ts.map +1 -0
- package/lib/utils/useResolveDocPath.js +122 -0
- package/lib/utils/useResolveDocPath.js.map +1 -0
- package/lib/utils/useTaskBadgeAnimation.d.ts +16 -0
- package/lib/utils/useTaskBadgeAnimation.d.ts.map +1 -0
- package/lib/utils/useTaskBadgeAnimation.js +51 -0
- package/lib/utils/useTaskBadgeAnimation.js.map +1 -0
- package/lib/validateThemeConfig.d.ts +8 -0
- package/lib/validateThemeConfig.d.ts.map +1 -0
- package/lib/validateThemeConfig.js +15 -0
- package/lib/validateThemeConfig.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Webpack plugin that scans Docusaurus metadata for Task directives and generates a registry
|
|
4
|
+
*
|
|
5
|
+
* Scans for ::::task[Name] directives (4 colons) in MDX files
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.TaskRegistryPlugin = void 0;
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const path = __importStar(require("path"));
|
|
47
|
+
const webpack_1 = require("webpack");
|
|
48
|
+
const unified_1 = require("unified");
|
|
49
|
+
const remark_parse_1 = __importDefault(require("remark-parse"));
|
|
50
|
+
const remark_mdx_1 = __importDefault(require("remark-mdx"));
|
|
51
|
+
const remark_directive_1 = __importDefault(require("remark-directive"));
|
|
52
|
+
const unist_util_visit_1 = require("unist-util-visit");
|
|
53
|
+
const logger_1 = require("../utils/logger");
|
|
54
|
+
/**
|
|
55
|
+
* Extract badge configuration from frontmatter or category customProps
|
|
56
|
+
* Simple extraction - no validation, just check if properties exist
|
|
57
|
+
*/
|
|
58
|
+
function extractBadgeConfig(source) {
|
|
59
|
+
if (!source) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
const config = {};
|
|
63
|
+
let hasConfig = false;
|
|
64
|
+
// Hide progress badge
|
|
65
|
+
if (source.sidebar_task_hide_progress !== undefined) {
|
|
66
|
+
config.hide = Boolean(source.sidebar_task_hide_progress);
|
|
67
|
+
hasConfig = true;
|
|
68
|
+
}
|
|
69
|
+
// Disable icon
|
|
70
|
+
if (source.sidebar_task_disable_icon !== undefined) {
|
|
71
|
+
config.disableIcon = Boolean(source.sidebar_task_disable_icon);
|
|
72
|
+
hasConfig = true;
|
|
73
|
+
}
|
|
74
|
+
// Extract nested color configuration
|
|
75
|
+
if (source.sidebar_task_badge_colors) {
|
|
76
|
+
const colors = source.sidebar_task_badge_colors;
|
|
77
|
+
config.colors = {};
|
|
78
|
+
// Completed colors
|
|
79
|
+
if (colors.completed) {
|
|
80
|
+
config.colors.completed = {
|
|
81
|
+
lightmode: colors.completed.lightmode
|
|
82
|
+
? String(colors.completed.lightmode)
|
|
83
|
+
: undefined,
|
|
84
|
+
darkmode: colors.completed.darkmode
|
|
85
|
+
? String(colors.completed.darkmode)
|
|
86
|
+
: undefined,
|
|
87
|
+
};
|
|
88
|
+
hasConfig = true;
|
|
89
|
+
}
|
|
90
|
+
// Incomplete colors
|
|
91
|
+
if (colors.incomplete) {
|
|
92
|
+
config.colors.incomplete = {
|
|
93
|
+
lightmode: colors.incomplete.lightmode
|
|
94
|
+
? String(colors.incomplete.lightmode)
|
|
95
|
+
: undefined,
|
|
96
|
+
darkmode: colors.incomplete.darkmode
|
|
97
|
+
? String(colors.incomplete.darkmode)
|
|
98
|
+
: undefined,
|
|
99
|
+
};
|
|
100
|
+
hasConfig = true;
|
|
101
|
+
}
|
|
102
|
+
// Font colors
|
|
103
|
+
if (colors.font) {
|
|
104
|
+
config.colors.font = {
|
|
105
|
+
lightmode: colors.font.lightmode
|
|
106
|
+
? String(colors.font.lightmode)
|
|
107
|
+
: undefined,
|
|
108
|
+
darkmode: colors.font.darkmode
|
|
109
|
+
? String(colors.font.darkmode)
|
|
110
|
+
: undefined,
|
|
111
|
+
};
|
|
112
|
+
hasConfig = true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return hasConfig ? config : undefined;
|
|
116
|
+
}
|
|
117
|
+
class TaskRegistryPlugin {
|
|
118
|
+
constructor(siteDir) {
|
|
119
|
+
this.hasLoggedSuccess = false;
|
|
120
|
+
this.loggedWarnings = new Set();
|
|
121
|
+
this.missingFiles = [];
|
|
122
|
+
this.hasLoggedStaleCache = false;
|
|
123
|
+
this.siteDir = siteDir;
|
|
124
|
+
}
|
|
125
|
+
apply(compiler) {
|
|
126
|
+
const pluginName = "TaskRegistryPlugin";
|
|
127
|
+
let registryContent;
|
|
128
|
+
// Scan and cache registry content before compilation
|
|
129
|
+
compiler.hooks.beforeCompile.tapPromise(pluginName, async () => {
|
|
130
|
+
const registry = await this.scanForTasks();
|
|
131
|
+
registryContent = JSON.stringify(registry, null, 2);
|
|
132
|
+
// Check for stale cache and notify user once
|
|
133
|
+
this.detectAndNotifyStaleCacheOnce();
|
|
134
|
+
// Only log once (avoid duplicate logs for SSR + client builds)
|
|
135
|
+
if (!this.hasLoggedSuccess) {
|
|
136
|
+
const totalTasks = Object.values(registry.docPages).reduce((sum, doc) => sum + doc.totalTasks, 0);
|
|
137
|
+
const totalDocs = Object.keys(registry.docPages).length;
|
|
138
|
+
(0, logger_1.logSuccess)(`Found ${(0, logger_1.formatNumber)(totalTasks)} tasks across ${(0, logger_1.formatNumber)(totalDocs)} doc pages`);
|
|
139
|
+
this.hasLoggedSuccess = true;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
// Emit as a webpack asset so it's available in both dev and build modes
|
|
143
|
+
// Use processAssets hook (new API) instead of deprecated emit hook
|
|
144
|
+
compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
|
|
145
|
+
compilation.hooks.processAssets.tap({
|
|
146
|
+
name: pluginName,
|
|
147
|
+
stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
|
|
148
|
+
}, () => {
|
|
149
|
+
// Add task-registry.json as a compilation asset
|
|
150
|
+
compilation.emitAsset("task-registry.json", new webpack_1.sources.RawSource(registryContent));
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
async scanForTasks() {
|
|
155
|
+
const docusaurusDir = path.join(this.siteDir, ".docusaurus");
|
|
156
|
+
const docsPluginDir = path.join(docusaurusDir, "docusaurus-plugin-content-docs");
|
|
157
|
+
if (!fs.existsSync(docsPluginDir)) {
|
|
158
|
+
(0, logger_1.logWarn)(`Docusaurus docs plugin directory not found: ${(0, logger_1.formatPath)(docsPluginDir)}`);
|
|
159
|
+
(0, logger_1.logWarn)("Make sure to run this during/after Docusaurus build");
|
|
160
|
+
return { docPages: {}, categories: {} };
|
|
161
|
+
}
|
|
162
|
+
const registry = { docPages: {}, categories: {} };
|
|
163
|
+
// Scan all plugin instance directories (default, custom instances, etc.)
|
|
164
|
+
const pluginInstances = fs
|
|
165
|
+
.readdirSync(docsPluginDir, { withFileTypes: true })
|
|
166
|
+
.filter((dirent) => dirent.isDirectory())
|
|
167
|
+
.map((dirent) => dirent.name);
|
|
168
|
+
for (const pluginId of pluginInstances) {
|
|
169
|
+
const pluginPath = path.join(docsPluginDir, pluginId);
|
|
170
|
+
await this.scanPluginInstance(pluginPath, pluginId, registry);
|
|
171
|
+
}
|
|
172
|
+
return registry;
|
|
173
|
+
}
|
|
174
|
+
async scanPluginInstance(pluginPath, pluginId, registry) {
|
|
175
|
+
// Find all site-*.json files containing doc metadata
|
|
176
|
+
const files = fs
|
|
177
|
+
.readdirSync(pluginPath)
|
|
178
|
+
.filter((file) => file.startsWith("site-") && file.endsWith(".json"));
|
|
179
|
+
for (const file of files) {
|
|
180
|
+
const filePath = path.join(pluginPath, file);
|
|
181
|
+
try {
|
|
182
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
183
|
+
const metadata = JSON.parse(content);
|
|
184
|
+
// Process all docs - registry will be built only if tasks are found
|
|
185
|
+
await this.processDoc(metadata, pluginId, registry);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
const warningKey = `process-error:${filePath}`;
|
|
189
|
+
if (!this.loggedWarnings.has(warningKey)) {
|
|
190
|
+
(0, logger_1.logWarn)(`Failed to process file: ${error} in ${(0, logger_1.formatPath)(filePath)}`);
|
|
191
|
+
this.loggedWarnings.add(warningKey);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async processDoc(metadata, pluginId, registry) {
|
|
197
|
+
// Extract source file path (remove @site prefix)
|
|
198
|
+
const sourcePath = metadata.source.replace("@site/", "");
|
|
199
|
+
const fullSourcePath = path.join(this.siteDir, sourcePath);
|
|
200
|
+
if (!fs.existsSync(fullSourcePath)) {
|
|
201
|
+
// Track missing file for stale cache detection
|
|
202
|
+
this.missingFiles.push(fullSourcePath);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
// Parse the source file to extract tasks
|
|
206
|
+
const tasks = await this.extractTasksFromFile(fullSourcePath);
|
|
207
|
+
if (tasks.length === 0) {
|
|
208
|
+
// No tasks found - skip silently (this is normal for pages without tasks)
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
// Build task registry entry
|
|
212
|
+
const docKey = `${pluginId}/${metadata.id}`;
|
|
213
|
+
const tasksRecord = {};
|
|
214
|
+
tasks.forEach((taskName, index) => {
|
|
215
|
+
const taskNumber = index + 1;
|
|
216
|
+
// Convert name to a URL-safe slug: lowercase, replace spaces and special chars with dashes
|
|
217
|
+
// This must match the encoding in utils/storage.ts generateTaskKey()
|
|
218
|
+
const encodedName = taskName
|
|
219
|
+
.toLowerCase()
|
|
220
|
+
.replace(/\s+/g, "-") // Replace spaces with dashes
|
|
221
|
+
.replace(/[^a-z0-9-]/g, "-") // Replace special chars with dashes
|
|
222
|
+
.replace(/-+/g, "-") // Collapse multiple dashes
|
|
223
|
+
.replace(/^-|-$/g, ""); // Remove leading/trailing dashes
|
|
224
|
+
const taskKey = `task-${pluginId}-${metadata.id}-${taskNumber}-${encodedName}`;
|
|
225
|
+
tasksRecord[taskKey] = {
|
|
226
|
+
number: taskNumber,
|
|
227
|
+
name: taskName,
|
|
228
|
+
};
|
|
229
|
+
});
|
|
230
|
+
// Extract badge configuration from frontmatter (simple, no validation)
|
|
231
|
+
const badgeConfig = extractBadgeConfig(metadata.frontMatter);
|
|
232
|
+
registry.docPages[docKey] = {
|
|
233
|
+
id: metadata.id,
|
|
234
|
+
pluginId,
|
|
235
|
+
title: metadata.title,
|
|
236
|
+
description: metadata.description,
|
|
237
|
+
sectionName: metadata.frontMatter.task_section_name || metadata.title,
|
|
238
|
+
permalink: metadata.permalink,
|
|
239
|
+
source: metadata.source,
|
|
240
|
+
sidebarPosition: metadata.sidebarPosition,
|
|
241
|
+
totalTasks: tasks.length,
|
|
242
|
+
tasks: tasksRecord,
|
|
243
|
+
badgeConfig,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
async extractTasksFromFile(filePath) {
|
|
247
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
248
|
+
const taskNames = [];
|
|
249
|
+
try {
|
|
250
|
+
// Parse MDX/Markdown using remark with directive support
|
|
251
|
+
const processor = (0, unified_1.unified)()
|
|
252
|
+
.use(remark_parse_1.default)
|
|
253
|
+
.use(remark_mdx_1.default)
|
|
254
|
+
.use(remark_directive_1.default);
|
|
255
|
+
const tree = processor.parse(content);
|
|
256
|
+
// Visit all directive nodes (:::task[Name])
|
|
257
|
+
(0, unist_util_visit_1.visit)(tree, (node) => {
|
|
258
|
+
if (node.type === "containerDirective" && node.name === "task") {
|
|
259
|
+
// Extract the task name from the label (first child paragraph with data.directiveLabel)
|
|
260
|
+
let taskName = "";
|
|
261
|
+
if (node.children && node.children.length > 0) {
|
|
262
|
+
const firstChild = node.children[0];
|
|
263
|
+
if (firstChild.type === "paragraph" &&
|
|
264
|
+
firstChild.data?.directiveLabel === true) {
|
|
265
|
+
if (firstChild.children &&
|
|
266
|
+
firstChild.children[0]?.type === "text") {
|
|
267
|
+
taskName = firstChild.children[0].value.trim();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (taskName) {
|
|
272
|
+
taskNames.push(taskName);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
const warningKey = `parse-error:${filePath}`;
|
|
279
|
+
if (!this.loggedWarnings.has(warningKey)) {
|
|
280
|
+
(0, logger_1.logWarn)(`Failed to parse file: ${error} in ${(0, logger_1.formatPath)(filePath)}`);
|
|
281
|
+
this.loggedWarnings.add(warningKey);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return taskNames;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Detect stale cache and notify user once
|
|
288
|
+
*
|
|
289
|
+
* Checks if missing files indicate a stale .docusaurus cache
|
|
290
|
+
* and provides helpful recommendation to clear it
|
|
291
|
+
*/
|
|
292
|
+
detectAndNotifyStaleCacheOnce() {
|
|
293
|
+
// Only log once
|
|
294
|
+
if (this.hasLoggedStaleCache || this.missingFiles.length === 0) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
// Check if we have a significant number of missing files (likely stale cache)
|
|
298
|
+
// Threshold: 2+ missing files suggests renamed/deleted directories
|
|
299
|
+
const threshold = 2;
|
|
300
|
+
if (this.missingFiles.length >= threshold) {
|
|
301
|
+
(0, logger_1.logWarn)(`Detected ${(0, logger_1.formatNumber)(this.missingFiles.length)} missing source files - this may indicate a stale cache`);
|
|
302
|
+
(0, logger_1.logWarn)(`Recommendation: Clear the Docusaurus cache by running: "npm run clear"`);
|
|
303
|
+
(0, logger_1.logWarn)(`Or manually delete: ${(0, logger_1.formatPath)(path.join(this.siteDir, ".docusaurus"))}`);
|
|
304
|
+
// Show a few example paths to help diagnose
|
|
305
|
+
const examples = this.missingFiles.slice(0, 3);
|
|
306
|
+
examples.forEach((filePath) => {
|
|
307
|
+
(0, logger_1.logWarn)(` - ${(0, logger_1.formatPath)(filePath)}`);
|
|
308
|
+
});
|
|
309
|
+
if (this.missingFiles.length > 3) {
|
|
310
|
+
(0, logger_1.logWarn)(` ... and ${this.missingFiles.length - 3} more`);
|
|
311
|
+
}
|
|
312
|
+
this.hasLoggedStaleCache = true;
|
|
313
|
+
}
|
|
314
|
+
else if (this.missingFiles.length > 0) {
|
|
315
|
+
// Just a few missing files - log them individually without cache warning
|
|
316
|
+
this.missingFiles.forEach((filePath) => {
|
|
317
|
+
const warningKey = `not-found:${filePath}`;
|
|
318
|
+
if (!this.loggedWarnings.has(warningKey)) {
|
|
319
|
+
(0, logger_1.logWarn)(`Source file not found: ${(0, logger_1.formatPath)(filePath)}`);
|
|
320
|
+
(0, logger_1.logWarn)(`This may indicate a stale cache - Clear the cache by running: "npm run clear"`);
|
|
321
|
+
this.loggedWarnings.add(warningKey);
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.TaskRegistryPlugin = TaskRegistryPlugin;
|
|
328
|
+
//# sourceMappingURL=TaskRegistryPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskRegistryPlugin.js","sourceRoot":"","sources":["../../src/plugin/TaskRegistryPlugin.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAE7B,qCAA+C;AAC/C,qCAAkC;AAClC,gEAAuC;AACvC,4DAAmC;AACnC,wEAA+C;AAC/C,uDAAyC;AAEzC,4CAAgF;AAGhF;;;GAGG;AACH,SAAS,kBAAkB,CACzB,MAAuC;IAEvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,sBAAsB;IACtB,IAAI,MAAM,CAAC,0BAA0B,KAAK,SAAS,EAAE,CAAC;QACpD,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;QACzD,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,eAAe;IACf,IAAI,MAAM,CAAC,yBAAyB,KAAK,SAAS,EAAE,CAAC;QACnD,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;QAC/D,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,qCAAqC;IACrC,IAAI,MAAM,CAAC,yBAAyB,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC;QAChD,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;QAEnB,mBAAmB;QACnB,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG;gBACxB,SAAS,EAA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AAQ,EAAE,EAAE;gBACrC,MAAM,UAAU,GAAG,aAAa,QAAQ,EAAE,CAAC;gBAC3C,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;oBACzC,IAAA,gBAAO,EAAC,0BAA0B,IAAA,mBAAU,EAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;oBAC1D,IAAA,gBAAO,EACL,+EAA+E,CAChF,CAAC;oBACF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBACtC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AArSD,gDAqSC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remark plugin to transform directive syntax (::::task[Name]) into JSX components
|
|
3
|
+
*
|
|
4
|
+
* This plugin runs during MDX compilation and transforms:
|
|
5
|
+
* - ::::task[Name] → <Task name="Name"> (4+ colons for task containers)
|
|
6
|
+
* - :::hint → <Hint> (3 colons, nested inside task)
|
|
7
|
+
* - :::solution → <Solution> (3 colons, nested inside task)
|
|
8
|
+
* - Task content (non-hint/solution) → wrapped in <Text>
|
|
9
|
+
*
|
|
10
|
+
* Note: Supports arbitrary nesting depth like Docusaurus admonitions
|
|
11
|
+
* Tasks use 4+ colons (::::) while children use fewer colons
|
|
12
|
+
* This allows proper nesting without premature closure.
|
|
13
|
+
*
|
|
14
|
+
* Validations:
|
|
15
|
+
* - Warns if task has no name
|
|
16
|
+
* - Warns if hint/solution appears outside task
|
|
17
|
+
* - Warns if multiple hints/solutions in same task
|
|
18
|
+
*/
|
|
19
|
+
import type { Plugin } from "unified";
|
|
20
|
+
import type { Root } from "mdast";
|
|
21
|
+
interface PluginOptions {
|
|
22
|
+
filePath?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Remark plugin to transform task directives
|
|
26
|
+
*/
|
|
27
|
+
export declare const remarkTaskDirective: Plugin<[PluginOptions?], Root>;
|
|
28
|
+
export default remarkTaskDirective;
|
|
29
|
+
//# sourceMappingURL=remarkTaskDirective.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remarkTaskDirective.d.ts","sourceRoot":"","sources":["../../src/plugin/remarkTaskDirective.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,IAAI,EAAmB,MAAM,OAAO,CAAC;AAWnD,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA2QD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAuE9D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Remark plugin to transform directive syntax (::::task[Name]) into JSX components
|
|
4
|
+
*
|
|
5
|
+
* This plugin runs during MDX compilation and transforms:
|
|
6
|
+
* - ::::task[Name] → <Task name="Name"> (4+ colons for task containers)
|
|
7
|
+
* - :::hint → <Hint> (3 colons, nested inside task)
|
|
8
|
+
* - :::solution → <Solution> (3 colons, nested inside task)
|
|
9
|
+
* - Task content (non-hint/solution) → wrapped in <Text>
|
|
10
|
+
*
|
|
11
|
+
* Note: Supports arbitrary nesting depth like Docusaurus admonitions
|
|
12
|
+
* Tasks use 4+ colons (::::) while children use fewer colons
|
|
13
|
+
* This allows proper nesting without premature closure.
|
|
14
|
+
*
|
|
15
|
+
* Validations:
|
|
16
|
+
* - Warns if task has no name
|
|
17
|
+
* - Warns if hint/solution appears outside task
|
|
18
|
+
* - Warns if multiple hints/solutions in same task
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.remarkTaskDirective = void 0;
|
|
22
|
+
const unist_util_visit_1 = require("unist-util-visit");
|
|
23
|
+
const logger_1 = require("../utils/logger");
|
|
24
|
+
/**
|
|
25
|
+
* Check if a node is a task directive
|
|
26
|
+
*/
|
|
27
|
+
function isTaskDirective(node) {
|
|
28
|
+
return (node.type === "containerDirective" &&
|
|
29
|
+
node.name === "task");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a node is a task-example directive
|
|
33
|
+
*/
|
|
34
|
+
function isTaskExampleDirective(node) {
|
|
35
|
+
return (node.type === "containerDirective" &&
|
|
36
|
+
node.name === "task-example");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Standard Docusaurus admonition types that should be allowed inside tasks
|
|
40
|
+
*/
|
|
41
|
+
const ALLOWED_ADMONITIONS = [
|
|
42
|
+
"note",
|
|
43
|
+
"tip",
|
|
44
|
+
"info",
|
|
45
|
+
"warning",
|
|
46
|
+
"danger",
|
|
47
|
+
"caution",
|
|
48
|
+
"important",
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Check if a node is a hint directive
|
|
52
|
+
*/
|
|
53
|
+
function isHintDirective(node) {
|
|
54
|
+
return (node.type === "containerDirective" &&
|
|
55
|
+
node.name === "hint");
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if a node is a solution directive
|
|
59
|
+
*/
|
|
60
|
+
function isSolutionDirective(node) {
|
|
61
|
+
return (node.type === "containerDirective" &&
|
|
62
|
+
node.name === "solution");
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Check if a node is an allowed admonition (nested inside task)
|
|
66
|
+
* Allows standard Docusaurus admonitions to pass through
|
|
67
|
+
*/
|
|
68
|
+
function isAllowedAdmonition(node) {
|
|
69
|
+
if (node.type !== "containerDirective") {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const directiveName = node.name;
|
|
73
|
+
return ALLOWED_ADMONITIONS.includes(directiveName);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Check if a node represents a nested container directive
|
|
77
|
+
* (could be admonition, task, or any other container)
|
|
78
|
+
*/
|
|
79
|
+
function isNestedContainerDirective(node) {
|
|
80
|
+
return node.type === "containerDirective";
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create a JSX element node
|
|
84
|
+
*/
|
|
85
|
+
function createJSXElement(name, attributes, children) {
|
|
86
|
+
return {
|
|
87
|
+
type: "mdxJsxFlowElement",
|
|
88
|
+
name,
|
|
89
|
+
attributes,
|
|
90
|
+
children,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Create a JSX attribute node
|
|
95
|
+
*/
|
|
96
|
+
function createJSXAttribute(name, value) {
|
|
97
|
+
return {
|
|
98
|
+
type: "mdxJsxAttribute",
|
|
99
|
+
name,
|
|
100
|
+
value,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Emit a warning message
|
|
105
|
+
*/
|
|
106
|
+
function warn(message, filePath, position) {
|
|
107
|
+
const location = position
|
|
108
|
+
? `${filePath || "unknown"}:${position.start?.line || "?"}:${position.start?.column || "?"}`
|
|
109
|
+
: filePath || "unknown file";
|
|
110
|
+
(0, logger_1.logWarn)(`${message}: ${(0, logger_1.formatPath)(location)}`);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Transform a task or task-example directive into JSX components
|
|
114
|
+
*/
|
|
115
|
+
function transformTaskDirective(node, filePath, isExample = false) {
|
|
116
|
+
// Extract task name from label
|
|
117
|
+
// In remark-directive, :::task[Name] stores "Name" as the first paragraph child with data.directiveLabel: true
|
|
118
|
+
let taskName = "";
|
|
119
|
+
let taskContent = [];
|
|
120
|
+
if (node.children && node.children.length > 0) {
|
|
121
|
+
const firstChild = node.children[0];
|
|
122
|
+
// Check if first child is the label paragraph
|
|
123
|
+
if (firstChild.type === "paragraph" &&
|
|
124
|
+
firstChild.data?.directiveLabel === true) {
|
|
125
|
+
// Extract label text
|
|
126
|
+
if (firstChild.children && firstChild.children[0]?.type === "text") {
|
|
127
|
+
taskName = firstChild.children[0].value.trim();
|
|
128
|
+
}
|
|
129
|
+
// Rest of children are the actual content
|
|
130
|
+
taskContent = node.children.slice(1);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// No label found, all children are content
|
|
134
|
+
taskContent = node.children;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Validation: Task must have a name
|
|
138
|
+
if (!taskName) {
|
|
139
|
+
warn(`Task is missing a name. Usage: ::::task[Task Name] (note: 4 colons for tasks). This task will be hidden.`, filePath, node.position);
|
|
140
|
+
// Return empty paragraph to hide the task
|
|
141
|
+
return {
|
|
142
|
+
type: "paragraph",
|
|
143
|
+
children: [],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
// Separate children into text content, hints, and solutions
|
|
147
|
+
const textContent = [];
|
|
148
|
+
const hints = [];
|
|
149
|
+
const solutions = [];
|
|
150
|
+
const unknownDirectives = [];
|
|
151
|
+
for (const child of taskContent) {
|
|
152
|
+
if (isHintDirective(child)) {
|
|
153
|
+
hints.push(child);
|
|
154
|
+
}
|
|
155
|
+
else if (isSolutionDirective(child)) {
|
|
156
|
+
solutions.push(child);
|
|
157
|
+
}
|
|
158
|
+
else if (isNestedContainerDirective(child)) {
|
|
159
|
+
const directiveName = child.name;
|
|
160
|
+
// Allow standard admonitions and other nested tasks to pass through
|
|
161
|
+
if (isAllowedAdmonition(child) ||
|
|
162
|
+
isTaskDirective(child) ||
|
|
163
|
+
isTaskExampleDirective(child)) {
|
|
164
|
+
textContent.push(child);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
// Unknown directive inside task
|
|
168
|
+
unknownDirectives.push(directiveName);
|
|
169
|
+
textContent.push(child);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
textContent.push(child);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// Validation: Warn about unknown directives
|
|
177
|
+
if (unknownDirectives.length > 0) {
|
|
178
|
+
warn(`Unknown directive(s) ${unknownDirectives
|
|
179
|
+
.map((d) => `:::${d}`)
|
|
180
|
+
.join(", ")} inside task "${taskName}". Only :::hint and :::solution are supported inside ::::task.`, filePath, node.position);
|
|
181
|
+
}
|
|
182
|
+
// Validation: Warn about multiple hints
|
|
183
|
+
if (hints.length > 1) {
|
|
184
|
+
warn(`Multiple :::hint sections found in task "${taskName}". Only the first will be used.`, filePath, node.position);
|
|
185
|
+
}
|
|
186
|
+
// Validation: Warn about multiple solutions
|
|
187
|
+
if (solutions.length > 1) {
|
|
188
|
+
warn(`Multiple :::solution sections found in task "${taskName}". Only the first will be used.`, filePath, node.position);
|
|
189
|
+
}
|
|
190
|
+
// Validation: Warn if task is empty
|
|
191
|
+
if (textContent.length === 0 &&
|
|
192
|
+
hints.length === 0 &&
|
|
193
|
+
solutions.length === 0) {
|
|
194
|
+
warn(`Task "${taskName}" has no content. Add task instructions.`, filePath, node.position);
|
|
195
|
+
}
|
|
196
|
+
// Build JSX structure
|
|
197
|
+
const taskChildren = [];
|
|
198
|
+
// Add <Text> wrapper for main content (if any)
|
|
199
|
+
if (textContent.length > 0) {
|
|
200
|
+
taskChildren.push(createJSXElement("Text", [], textContent));
|
|
201
|
+
}
|
|
202
|
+
// Add <Hint> (use only first one)
|
|
203
|
+
if (hints.length > 0) {
|
|
204
|
+
const hintChildren = hints[0].children || [];
|
|
205
|
+
taskChildren.push(createJSXElement("Hint", [], hintChildren));
|
|
206
|
+
}
|
|
207
|
+
// Add <Solution> (use only first one)
|
|
208
|
+
if (solutions.length > 0) {
|
|
209
|
+
const solutionChildren = solutions[0].children || [];
|
|
210
|
+
taskChildren.push(createJSXElement("Solution", [], solutionChildren));
|
|
211
|
+
}
|
|
212
|
+
// Create <Task name="..."> or <TaskExample name="..."> element
|
|
213
|
+
const componentName = isExample ? "TaskExample" : "Task";
|
|
214
|
+
return createJSXElement(componentName, [createJSXAttribute("name", taskName)], taskChildren);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Remark plugin to transform task directives
|
|
218
|
+
*/
|
|
219
|
+
const remarkTaskDirective = (options = {}) => {
|
|
220
|
+
return (tree, file) => {
|
|
221
|
+
const filePath = options.filePath || file.path || file.history?.[0] || "unknown";
|
|
222
|
+
// First pass: Check for orphaned hints/solutions and task directives
|
|
223
|
+
(0, unist_util_visit_1.visit)(tree, (node, index, parent) => {
|
|
224
|
+
if (isTaskDirective(node)) {
|
|
225
|
+
// Mark the directive as handled to suppress Docusaurus warning
|
|
226
|
+
if (!node.data) {
|
|
227
|
+
node.data = {};
|
|
228
|
+
}
|
|
229
|
+
node.data.directiveHandled = true;
|
|
230
|
+
// Transform the task directive
|
|
231
|
+
const transformed = transformTaskDirective(node, filePath, false);
|
|
232
|
+
// Replace the node in the tree
|
|
233
|
+
if (parent && typeof index === "number") {
|
|
234
|
+
parent.children[index] = transformed;
|
|
235
|
+
}
|
|
236
|
+
// Skip traversing into children - they're already processed by transformTaskDirective
|
|
237
|
+
return "skip";
|
|
238
|
+
}
|
|
239
|
+
else if (isTaskExampleDirective(node)) {
|
|
240
|
+
// Mark the directive as handled to suppress Docusaurus warning
|
|
241
|
+
if (!node.data) {
|
|
242
|
+
node.data = {};
|
|
243
|
+
}
|
|
244
|
+
node.data.directiveHandled = true;
|
|
245
|
+
// Transform the task-example directive (isExample = true)
|
|
246
|
+
const transformed = transformTaskDirective(node, filePath, true);
|
|
247
|
+
// Replace the node in the tree
|
|
248
|
+
if (parent && typeof index === "number") {
|
|
249
|
+
parent.children[index] = transformed;
|
|
250
|
+
}
|
|
251
|
+
// Skip traversing into children - they're already processed by transformTaskDirective
|
|
252
|
+
return "skip";
|
|
253
|
+
}
|
|
254
|
+
else if (isHintDirective(node) || isSolutionDirective(node)) {
|
|
255
|
+
// Mark as handled to suppress Docusaurus warning
|
|
256
|
+
if (!node.data) {
|
|
257
|
+
node.data = {};
|
|
258
|
+
}
|
|
259
|
+
node.data.directiveHandled = true;
|
|
260
|
+
// Check if this hint/solution is inside a task
|
|
261
|
+
// This is an orphaned hint/solution (we already processed tasks above)
|
|
262
|
+
const directiveName = node.name;
|
|
263
|
+
warn(`:::${directiveName} directive found outside of ::::task context. ${directiveName === "hint" ? "Hints" : "Solutions"} must be inside a task.`, filePath, node.position);
|
|
264
|
+
// Replace with empty paragraph to hide
|
|
265
|
+
if (parent && typeof index === "number") {
|
|
266
|
+
parent.children[index] = {
|
|
267
|
+
type: "paragraph",
|
|
268
|
+
children: [],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
exports.remarkTaskDirective = remarkTaskDirective;
|
|
276
|
+
exports.default = exports.remarkTaskDirective;
|
|
277
|
+
//# sourceMappingURL=remarkTaskDirective.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remarkTaskDirective.js","sourceRoot":"","sources":["../../src/plugin/remarkTaskDirective.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,uDAAyC;AAIzC,4CAAsD;AAatD;;GAEG;AACH,SAAS,eAAe,CAAC,IAAa;IACpC,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,oBAAoB;QACjC,IAA2B,CAAC,IAAI,KAAK,MAAM,CAC7C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,IAAa;IAC3C,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,oBAAoB;QACjC,IAA2B,CAAC,IAAI,KAAK,cAAc,CACrD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,mBAAmB,GAAG;IAC1B,MAAM;IACN,KAAK;IACL,MAAM;IACN,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;CACZ,CAAC;AAEF;;GAEG;AACH,SAAS,eAAe,CAAC,IAAa;IACp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