@forwardimpact/libdoc 0.2.1 → 0.2.3
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/bin/fit-doc.js +3 -3
- package/builder.js +2 -2
- package/frontmatter.js +2 -2
- package/package.json +6 -6
- package/server.js +1 -1
package/bin/fit-doc.js
CHANGED
|
@@ -22,11 +22,11 @@ Options:
|
|
|
22
22
|
-h, --help Show this help message
|
|
23
23
|
|
|
24
24
|
Build options:
|
|
25
|
-
--src=<dir> Source directory (default:
|
|
25
|
+
--src=<dir> Source directory (default: website)
|
|
26
26
|
--out=<dir> Output directory (default: dist)
|
|
27
27
|
|
|
28
28
|
Serve options:
|
|
29
|
-
--src=<dir> Source directory (default:
|
|
29
|
+
--src=<dir> Source directory (default: website)
|
|
30
30
|
--out=<dir> Output directory (default: dist)
|
|
31
31
|
-p, --port Port to serve on (default: 3000)
|
|
32
32
|
-w, --watch Watch for changes and rebuild
|
|
@@ -93,7 +93,7 @@ async function main() {
|
|
|
93
93
|
const { values } = parseArgs({
|
|
94
94
|
args: commandArgs,
|
|
95
95
|
options: {
|
|
96
|
-
src: { type: "string", default: "
|
|
96
|
+
src: { type: "string", default: "website" },
|
|
97
97
|
out: { type: "string", default: "dist" },
|
|
98
98
|
port: { type: "string", short: "p", default: "3000" },
|
|
99
99
|
watch: { type: "boolean", short: "w", default: false },
|
package/builder.js
CHANGED
|
@@ -243,7 +243,7 @@ export class DocsBuilder {
|
|
|
243
243
|
// Read and validate template
|
|
244
244
|
const templatePath = this.#path.join(docsDir, "index.template.html");
|
|
245
245
|
if (!this.#fs.existsSync(templatePath)) {
|
|
246
|
-
throw new Error(
|
|
246
|
+
throw new Error(`index.template.html not found in ${docsDir}`);
|
|
247
247
|
}
|
|
248
248
|
const template = this.#fs.readFileSync(templatePath, "utf-8");
|
|
249
249
|
|
|
@@ -251,7 +251,7 @@ export class DocsBuilder {
|
|
|
251
251
|
const mdFiles = this.#findMarkdownFiles(docsDir);
|
|
252
252
|
|
|
253
253
|
if (mdFiles.length === 0) {
|
|
254
|
-
console.warn(
|
|
254
|
+
console.warn(`Warning: No Markdown files found in ${docsDir}`);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
// First pass: collect page titles by URL path for breadcrumbs
|
package/frontmatter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { parse } from "yaml";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Parse simple front matter from markdown content
|
|
@@ -20,7 +20,7 @@ export function parseFrontMatter(content) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const [, frontMatter, remainingContent] = match;
|
|
23
|
-
const parsedData =
|
|
23
|
+
const parsedData = parse(frontMatter);
|
|
24
24
|
|
|
25
25
|
return {
|
|
26
26
|
data: parsedData || {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forwardimpact/libdoc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Documentation build and serve tools for static site generation from Markdown",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"test": "node --test test/*.test.js"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@hono/node-server": "^1.19.
|
|
32
|
-
"hono": "^4.
|
|
33
|
-
"
|
|
34
|
-
"marked": "^14.1.4",
|
|
31
|
+
"@hono/node-server": "^1.19.11",
|
|
32
|
+
"hono": "^4.12.9",
|
|
33
|
+
"marked": "^17.0.5",
|
|
35
34
|
"marked-gfm-heading-id": "^4.1.3",
|
|
36
35
|
"marked-highlight": "^2.2.3",
|
|
37
36
|
"mustache": "^4.2.0",
|
|
38
|
-
"prettier": "^3.8.
|
|
37
|
+
"prettier": "^3.8.1",
|
|
38
|
+
"yaml": "^2.8.3"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=18.0.0"
|
package/server.js
CHANGED