@godcreator/word-report 0.5.0 → 0.5.1
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/dist/cli.mjs +2 -2
- package/dist/core.mjs +1 -1
- package/dist/{export-B01-yaAq.mjs → export-CGvF3Wz-.mjs} +2 -2
- package/dist/{mdx-C1RVv6E-.mjs → mdx-B1V34o8x.mjs} +7 -2
- package/dist/node.mjs +2 -2
- package/dist/{report-files-Dfr71bRv.mjs → report-files-DyPBOCgh.mjs} +1 -1
- package/dist/site-server.mjs +2 -2
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as reportExport, r as checkReports } from "./export-
|
|
3
|
-
import { o as reportEntryIn, s as reportEntryOf } from "./report-files-
|
|
2
|
+
import { n as reportExport, r as checkReports } from "./export-CGvF3Wz-.mjs";
|
|
3
|
+
import { o as reportEntryIn, s as reportEntryOf } from "./report-files-DyPBOCgh.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { realpathSync } from "node:fs";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
package/dist/core.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as validateDocument, n as safeRelativePath, o as parseReportJson, s as ReportContentError, t as assembleDocument } from "./assemble-BEt9_xsB.mjs";
|
|
2
|
-
import { a as mdxReportInputsOf, i as compileMdxReport, n as MDX_REFERENCES_NAME, o as GENERATED_ID_PREFIX, r as assembleMdxReport, t as MDX_ENTRY_NAME } from "./mdx-
|
|
2
|
+
import { a as mdxReportInputsOf, i as compileMdxReport, n as MDX_REFERENCES_NAME, o as GENERATED_ID_PREFIX, r as assembleMdxReport, t as MDX_ENTRY_NAME } from "./mdx-B1V34o8x.mjs";
|
|
3
3
|
export { GENERATED_ID_PREFIX, MDX_ENTRY_NAME, MDX_REFERENCES_NAME, ReportContentError, assembleDocument, assembleMdxReport, compileMdxReport, mdxReportInputsOf, parseReportJson, safeRelativePath, validateDocument };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as walk, i as validateDocument, n as safeRelativePath, o as parseReportJson, s as ReportContentError, t as assembleDocument } from "./assemble-BEt9_xsB.mjs";
|
|
2
|
-
import { a as mdxReportInputsOf, r as assembleMdxReport, t as MDX_ENTRY_NAME } from "./mdx-
|
|
3
|
-
import { l as reportsDirName, t as JSON_ENTRY_NAME } from "./report-files-
|
|
2
|
+
import { a as mdxReportInputsOf, r as assembleMdxReport, t as MDX_ENTRY_NAME } from "./mdx-B1V34o8x.mjs";
|
|
3
|
+
import { l as reportsDirName, t as JSON_ENTRY_NAME } from "./report-files-DyPBOCgh.mjs";
|
|
4
4
|
import { access, mkdir, open, readFile, readdir, realpath, rename, stat, unlink, writeFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -315,9 +315,14 @@ function collectElement(context, element, marks, out) {
|
|
|
315
315
|
return;
|
|
316
316
|
default:
|
|
317
317
|
if (name !== null && BLOCK_COMPONENTS.has(name)) failAt(context, element, `<${name}> 要单独成段,前后空一行,不写在一段文字中间`);
|
|
318
|
-
failAt(context, element,
|
|
318
|
+
failAt(context, element, unknownComponentMessage(name ?? "", "行内只能用 WordRef、WordCite、WordPlainMath 与 HTML 标签 sub、sup、strong、em、br"));
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
+
/** 认不出的元素:大写开头、不以 Word 开头的单独说明——报告的组件名都以 Word 开头,小写的只认几个 HTML 标签 */
|
|
322
|
+
function unknownComponentMessage(name, allowed) {
|
|
323
|
+
if (/^[A-Z]/.test(name) && !name.startsWith("Word")) return `报告里的组件都以 Word 开头,<${name}> 不认:${allowed}`;
|
|
324
|
+
return `认不出组件 <${name}>:${allowed}`;
|
|
325
|
+
}
|
|
321
326
|
const PLAIN_MATH_MARKS = [
|
|
322
327
|
"em",
|
|
323
328
|
"sub",
|
|
@@ -593,7 +598,7 @@ function componentOf(context, element, place) {
|
|
|
593
598
|
case "tr":
|
|
594
599
|
case "th":
|
|
595
600
|
case "td": return failAt(context, element, `<${element.name}> 只能写在 <WordTable> 里:不编号的简单表格直接写 GFM 表格`);
|
|
596
|
-
default: return failAt(context, element,
|
|
601
|
+
default: return failAt(context, element, unknownComponentMessage(element.name ?? "", "块级只能用 WordFigure、WordFigures、WordTable、WordAbstract、WordBibliography"));
|
|
597
602
|
}
|
|
598
603
|
}
|
|
599
604
|
function captionOf(context, element, what) {
|
package/dist/node.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as readReport, n as reportExport, r as checkReports, t as reportEntry } from "./export-
|
|
2
|
-
import { a as readReportFiles, c as reportIdsOf, i as readMdxReportFiles, l as reportsDirName, n as REPORT_ID_PATTERN, o as reportEntryIn, r as isMdxEntry, s as reportEntryOf, t as JSON_ENTRY_NAME } from "./report-files-
|
|
1
|
+
import { i as readReport, n as reportExport, r as checkReports, t as reportEntry } from "./export-CGvF3Wz-.mjs";
|
|
2
|
+
import { a as readReportFiles, c as reportIdsOf, i as readMdxReportFiles, l as reportsDirName, n as REPORT_ID_PATTERN, o as reportEntryIn, r as isMdxEntry, s as reportEntryOf, t as JSON_ENTRY_NAME } from "./report-files-DyPBOCgh.mjs";
|
|
3
3
|
export { JSON_ENTRY_NAME, REPORT_ID_PATTERN, checkReports, isMdxEntry, readMdxReportFiles, readReport, readReportFiles, reportEntry, reportEntryIn, reportEntryOf, reportExport, reportIdsOf, reportsDirName };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as validateDocument, n as safeRelativePath, o as parseReportJson, s as ReportContentError } from "./assemble-BEt9_xsB.mjs";
|
|
2
|
-
import { a as mdxReportInputsOf, t as MDX_ENTRY_NAME } from "./mdx-
|
|
2
|
+
import { a as mdxReportInputsOf, t as MDX_ENTRY_NAME } from "./mdx-B1V34o8x.mjs";
|
|
3
3
|
import { readFile, readdir, realpath, stat } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
//#region src/node/report-files.ts
|
package/dist/site-server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as assembleDocument } from "./assemble-BEt9_xsB.mjs";
|
|
2
|
-
import { a as mdxReportInputsOf, r as assembleMdxReport, t as MDX_ENTRY_NAME } from "./mdx-
|
|
3
|
-
import { a as readReportFiles, c as reportIdsOf, i as readMdxReportFiles, n as REPORT_ID_PATTERN, o as reportEntryIn, r as isMdxEntry, t as JSON_ENTRY_NAME } from "./report-files-
|
|
2
|
+
import { a as mdxReportInputsOf, r as assembleMdxReport, t as MDX_ENTRY_NAME } from "./mdx-B1V34o8x.mjs";
|
|
3
|
+
import { a as readReportFiles, c as reportIdsOf, i as readMdxReportFiles, n as REPORT_ID_PATTERN, o as reportEntryIn, r as isMdxEntry, t as JSON_ENTRY_NAME } from "./report-files-DyPBOCgh.mjs";
|
|
4
4
|
import { n as reportHrefOf } from "./page-data-DLPoVgXy.mjs";
|
|
5
5
|
import { readFile, realpath, stat } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|