@clarusjs/theme-docs 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -6
- package/src/learn-path.tscl +134 -0
- package/src/lesson-bar.tscl +2 -0
- package/src/lesson.css +30 -3
- package/src/lesson.tscl +21 -1
- package/src/nav.ts +24 -6
- package/src/parts/icon.tscl +21 -0
- package/src/parts/icons.ts +17 -0
- package/src/parts/sidebar.tscl +100 -12
- package/src/search.tscl +4 -0
- package/src/styles/theme.css +413 -0
- package/src/theme.css +1567 -259
- package/src/vite.js +7 -0
package/src/vite.js
CHANGED
|
@@ -209,6 +209,13 @@ export function readPages(dir) {
|
|
|
209
209
|
const group = data.group ?? (parts.length > 2 ? words(parts[1]) : undefined)
|
|
210
210
|
if (group) page.group = group
|
|
211
211
|
if (data.order !== undefined && Number.isFinite(Number(data.order))) page.order = Number(data.order)
|
|
212
|
+
if (typeof data.badge === 'string' && data.badge) page.badge = data.badge
|
|
213
|
+
if (data.minutes !== undefined && Number(data.minutes) > 0) page.minutes = Number(data.minutes)
|
|
214
|
+
// A lesson: the XP it can earn, as progress.ts counts it (a step 10, the lesson 50, a quiz right 20).
|
|
215
|
+
if (String(data.steps) === 'true') {
|
|
216
|
+
const body = text.replace(/^```[\s\S]*?^```/gm, '') // not the headings inside code samples
|
|
217
|
+
page.xp = 50 + 10 * (body.match(/^## /gm)?.length ?? 0) + 20 * (body.match(/^:::+ *quiz\b/gm)?.length ?? 0)
|
|
218
|
+
}
|
|
212
219
|
const updated = dates.get(resolve(dir, file))
|
|
213
220
|
if (updated !== undefined) page.updated = updated
|
|
214
221
|
if (data.sidebar === 'false' || parts.some((part) => part.startsWith('['))) page.hidden = true
|