@masumdev/markforge 0.4.0 → 0.5.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/README.md +4 -4
- package/dist/App-JOOTPDJN.mjs +847 -0
- package/dist/{chunk-CRV7R2BG.mjs → chunk-H3ZUUSHP.mjs} +303 -98
- package/dist/{chunk-TNWZ4MFS.mjs → chunk-UNWAEVDU.mjs} +4 -3
- package/dist/cli.mjs +14 -6
- package/dist/index.d.mts +117 -50
- package/dist/index.d.ts +117 -50
- package/dist/index.js +838 -145
- package/dist/index.mjs +826 -139
- package/dist/{previewServer-XAUOBNBZ.mjs → previewServer-U47WQ5FV.mjs} +1 -1
- package/package.json +1 -1
- package/dist/App-3QDKBKHG.mjs +0 -328
|
@@ -32,10 +32,9 @@ try {
|
|
|
32
32
|
}
|
|
33
33
|
} catch {
|
|
34
34
|
}
|
|
35
|
-
var FALLBACK_VERSION = "0.4.0";
|
|
36
35
|
function readVersionFromPackageJson(fromDir) {
|
|
37
36
|
let currentDir = fromDir;
|
|
38
|
-
for (let i = 0; i <
|
|
37
|
+
for (let i = 0; i < 10; i++) {
|
|
39
38
|
try {
|
|
40
39
|
const pkgJsonPath = path.join(currentDir, "package.json");
|
|
41
40
|
if (fs.existsSync(pkgJsonPath)) {
|
|
@@ -50,7 +49,9 @@ function readVersionFromPackageJson(fromDir) {
|
|
|
50
49
|
if (parentDir === currentDir) break;
|
|
51
50
|
currentDir = parentDir;
|
|
52
51
|
}
|
|
53
|
-
|
|
52
|
+
throw new Error(
|
|
53
|
+
"Failed to resolve '@masumdev/markforge' package version: package.json was not found or is missing a valid 'version' field."
|
|
54
|
+
);
|
|
54
55
|
}
|
|
55
56
|
function getPackageDir() {
|
|
56
57
|
if (typeof __dirname !== "undefined") {
|
package/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ try {
|
|
|
9
9
|
} catch {}
|
|
10
10
|
import {
|
|
11
11
|
MARKFORGE_VERSION
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UNWAEVDU.mjs";
|
|
13
13
|
import "./chunk-YZHGBG4N.mjs";
|
|
14
14
|
|
|
15
15
|
// src/cli.tsx
|
|
@@ -56,7 +56,7 @@ async function main() {
|
|
|
56
56
|
}
|
|
57
57
|
const cliFormats = options.to ? options.to.split(",").map((f) => f.trim().toLowerCase()).filter(Boolean) : void 0;
|
|
58
58
|
const { loadConfig } = await import("./loadConfig-PGJKPE6G.mjs");
|
|
59
|
-
const { config: fileConfig } = await loadConfig(
|
|
59
|
+
const { config: fileConfig, configPath } = await loadConfig(
|
|
60
60
|
options.config,
|
|
61
61
|
path.dirname(resolvedInputPath)
|
|
62
62
|
);
|
|
@@ -71,19 +71,26 @@ async function main() {
|
|
|
71
71
|
if (options.serve !== false && options.serve !== void 0) {
|
|
72
72
|
const rawPort = options.serve === true ? 3e3 : parseInt(String(options.serve), 10);
|
|
73
73
|
const port = isNaN(rawPort) ? 3e3 : rawPort;
|
|
74
|
-
const { startPreviewServer } = await import("./previewServer-
|
|
74
|
+
const { startPreviewServer } = await import("./previewServer-U47WQ5FV.mjs");
|
|
75
75
|
const instance = await startPreviewServer({
|
|
76
76
|
filePath: resolvedInputPath,
|
|
77
77
|
port,
|
|
78
78
|
open: Boolean(options.open),
|
|
79
79
|
config: mergedConfig
|
|
80
80
|
});
|
|
81
|
+
const themeLabel = typeof mergedConfig.theme === "object" ? "Custom (ThemeProps)" : String(mergedConfig.theme || "corporate");
|
|
81
82
|
console.log(`
|
|
82
83
|
======================================================`);
|
|
83
|
-
console.log(` MarkForge Live Reload Preview Server`);
|
|
84
|
+
console.log(` MarkForge Live Reload Preview Server v${MARKFORGE_VERSION}`);
|
|
85
|
+
console.log(`======================================================`);
|
|
84
86
|
console.log(` Target File : ${resolvedInputPath}`);
|
|
87
|
+
console.log(` Config File : ${configPath || "(default auto-discovery)"}`);
|
|
88
|
+
console.log(` Theme : ${themeLabel} | Syntax: ${mergedConfig.syntaxTheme || "github-dark"}`);
|
|
89
|
+
console.log(` Layout : ${mergedConfig.paperSize || "A4"} (${mergedConfig.orientation || "portrait"})`);
|
|
85
90
|
console.log(` Server URL : ${instance.url}`);
|
|
86
|
-
console.log(`
|
|
91
|
+
console.log(` Auto-Open : ${Boolean(options.open) ? "Enabled" : "Disabled"}`);
|
|
92
|
+
console.log(` Author : Ma'sum (@masumrpg)`);
|
|
93
|
+
console.log(` GitHub : https://github.com/masumrpg`);
|
|
87
94
|
console.log(`======================================================
|
|
88
95
|
`);
|
|
89
96
|
console.log(`[READY] Watching for markdown and style changes. Press Ctrl+C to exit.
|
|
@@ -92,7 +99,7 @@ async function main() {
|
|
|
92
99
|
}
|
|
93
100
|
const [{ render }, { App }] = await Promise.all([
|
|
94
101
|
import("ink"),
|
|
95
|
-
import("./App-
|
|
102
|
+
import("./App-JOOTPDJN.mjs")
|
|
96
103
|
]);
|
|
97
104
|
render(
|
|
98
105
|
/* @__PURE__ */ jsx(
|
|
@@ -100,6 +107,7 @@ async function main() {
|
|
|
100
107
|
{
|
|
101
108
|
inputFile: resolvedInputPath,
|
|
102
109
|
config: mergedConfig,
|
|
110
|
+
configPath,
|
|
103
111
|
onComplete: (res) => {
|
|
104
112
|
if (res.errors && res.errors.length > 0) {
|
|
105
113
|
process.exitCode = 1;
|
package/dist/index.d.mts
CHANGED
|
@@ -4,9 +4,10 @@ declare enum OutputFormat {
|
|
|
4
4
|
DOCX = "docx",
|
|
5
5
|
PDF = "pdf",
|
|
6
6
|
HTML = "html",
|
|
7
|
-
PNG = "png"
|
|
7
|
+
PNG = "png",
|
|
8
|
+
TXT = "txt"
|
|
8
9
|
}
|
|
9
|
-
type MarkforgeFormat = "docx" | "pdf" | "html" | "png" | OutputFormat;
|
|
10
|
+
type MarkforgeFormat = "docx" | "pdf" | "html" | "png" | "txt" | OutputFormat;
|
|
10
11
|
interface ThemeProps {
|
|
11
12
|
/**
|
|
12
13
|
* Primary brand accent color (e.g. "#33CDCF", "#2563EB", "#7C3AED", "#E11D48").
|
|
@@ -216,16 +217,35 @@ interface CoverPageConfig {
|
|
|
216
217
|
* Custom background color or CSS gradient for the cover page.
|
|
217
218
|
*/
|
|
218
219
|
bgGradient?: string;
|
|
220
|
+
backgroundColor?: string;
|
|
219
221
|
/**
|
|
220
|
-
* Custom
|
|
222
|
+
* Custom typography colors.
|
|
221
223
|
*/
|
|
222
224
|
textColor?: string;
|
|
225
|
+
titleColor?: string;
|
|
226
|
+
subtitleColor?: string;
|
|
227
|
+
accentColor?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Contact details (for covers that render organization cards).
|
|
230
|
+
*/
|
|
231
|
+
address?: string;
|
|
232
|
+
email?: string;
|
|
233
|
+
phone?: string;
|
|
234
|
+
website?: string;
|
|
235
|
+
social?: BackCoverSocial;
|
|
236
|
+
copyright?: string;
|
|
223
237
|
/**
|
|
224
238
|
* Custom footer notes at the bottom of the cover page.
|
|
225
239
|
*/
|
|
226
240
|
footerText?: string;
|
|
227
241
|
}
|
|
228
|
-
|
|
242
|
+
declare enum BackCoverPreset {
|
|
243
|
+
MODERN = "modern",
|
|
244
|
+
CORPORATE = "corporate",
|
|
245
|
+
MINIMAL = "minimal",
|
|
246
|
+
CONTACT_CARD = "contact-card"
|
|
247
|
+
}
|
|
248
|
+
type BackCoverPresetType = "modern" | "corporate" | "minimal" | "contact-card" | BackCoverPreset;
|
|
229
249
|
interface BackCoverSocial {
|
|
230
250
|
github?: string;
|
|
231
251
|
twitter?: string;
|
|
@@ -247,7 +267,7 @@ interface BackCoverConfig {
|
|
|
247
267
|
* - "contact-card": Floating elevated glassmorphic contact card with full metadata grid.
|
|
248
268
|
* @default "modern"
|
|
249
269
|
*/
|
|
250
|
-
preset?:
|
|
270
|
+
preset?: BackCoverPresetType;
|
|
251
271
|
/**
|
|
252
272
|
* Headline title shown on the back cover.
|
|
253
273
|
* @default "Thank You"
|
|
@@ -257,10 +277,22 @@ interface BackCoverConfig {
|
|
|
257
277
|
* Subtitle / closing statement shown on the back cover.
|
|
258
278
|
*/
|
|
259
279
|
subtitle?: string;
|
|
280
|
+
/**
|
|
281
|
+
* Author / signatory shown on the closing page.
|
|
282
|
+
*/
|
|
283
|
+
author?: string | string[];
|
|
260
284
|
/**
|
|
261
285
|
* Organization or company name (falls back to document company).
|
|
262
286
|
*/
|
|
263
287
|
company?: string;
|
|
288
|
+
/**
|
|
289
|
+
* Document version shown on the back cover.
|
|
290
|
+
*/
|
|
291
|
+
version?: string;
|
|
292
|
+
/**
|
|
293
|
+
* Date shown on the back cover.
|
|
294
|
+
*/
|
|
295
|
+
date?: string | boolean;
|
|
264
296
|
/**
|
|
265
297
|
* Office address or headquarters location.
|
|
266
298
|
*/
|
|
@@ -285,6 +317,10 @@ interface BackCoverConfig {
|
|
|
285
317
|
* Copyright notice at the bottom (supports tokens like {company}, {date}, {year}).
|
|
286
318
|
*/
|
|
287
319
|
copyright?: string;
|
|
320
|
+
/**
|
|
321
|
+
* Custom footer text at the bottom.
|
|
322
|
+
*/
|
|
323
|
+
footerText?: string;
|
|
288
324
|
/**
|
|
289
325
|
* Brand logo path, URL, or Base64 data URI.
|
|
290
326
|
*/
|
|
@@ -306,10 +342,14 @@ interface BackCoverConfig {
|
|
|
306
342
|
* Custom CSS background gradient or solid hex color for the back cover.
|
|
307
343
|
*/
|
|
308
344
|
bgGradient?: string;
|
|
345
|
+
backgroundColor?: string;
|
|
309
346
|
/**
|
|
310
|
-
* Custom
|
|
347
|
+
* Custom typography colors.
|
|
311
348
|
*/
|
|
312
349
|
textColor?: string;
|
|
350
|
+
titleColor?: string;
|
|
351
|
+
subtitleColor?: string;
|
|
352
|
+
accentColor?: string;
|
|
313
353
|
}
|
|
314
354
|
interface NumberHeadingsOptions {
|
|
315
355
|
/**
|
|
@@ -372,8 +412,19 @@ interface DocumentMetadata {
|
|
|
372
412
|
backCover?: boolean | BackCoverConfig;
|
|
373
413
|
[key: string]: unknown;
|
|
374
414
|
}
|
|
375
|
-
|
|
376
|
-
|
|
415
|
+
declare enum SignatureAlign {
|
|
416
|
+
LEFT = "left",
|
|
417
|
+
CENTER = "center",
|
|
418
|
+
RIGHT = "right",
|
|
419
|
+
SPACE_BETWEEN = "space-between"
|
|
420
|
+
}
|
|
421
|
+
type SignatureAlignOption = "left" | "center" | "right" | "space-between" | SignatureAlign;
|
|
422
|
+
declare enum SignatureStyle {
|
|
423
|
+
LINE = "line",
|
|
424
|
+
BOX = "box",
|
|
425
|
+
CLEAN = "clean"
|
|
426
|
+
}
|
|
427
|
+
type SignatureStyleOption = "line" | "box" | "clean" | SignatureStyle;
|
|
377
428
|
interface SignatureItem {
|
|
378
429
|
/**
|
|
379
430
|
* Title or sign-off label above signature (e.g. "Prepared by", "Approved by", "Acknowledged by").
|
|
@@ -410,7 +461,7 @@ interface SignatureBlockConfig {
|
|
|
410
461
|
* Horizontal alignment of the signature block.
|
|
411
462
|
* @default "right" for 1 item, "space-between" for >= 2 items
|
|
412
463
|
*/
|
|
413
|
-
align?:
|
|
464
|
+
align?: SignatureAlignOption;
|
|
414
465
|
/**
|
|
415
466
|
* Visual layout style of the signature block:
|
|
416
467
|
* - "line": Traditional signature with a horizontal separator line above name.
|
|
@@ -418,7 +469,7 @@ interface SignatureBlockConfig {
|
|
|
418
469
|
* - "clean": Minimalist blank vertical space without borders.
|
|
419
470
|
* @default "line"
|
|
420
471
|
*/
|
|
421
|
-
style?:
|
|
472
|
+
style?: SignatureStyleOption;
|
|
422
473
|
/**
|
|
423
474
|
* Border or divider line color.
|
|
424
475
|
* @default "#CBD5E1"
|
|
@@ -658,6 +709,14 @@ declare function parseInlineSpans(text: string): MarkdownInlineSpan[];
|
|
|
658
709
|
* Extracts slug from heading text for TOC & anchor links.
|
|
659
710
|
*/
|
|
660
711
|
declare function slugify(text: string): string;
|
|
712
|
+
/**
|
|
713
|
+
* Applies hierarchical numbering to headings (e.g. "1.", "1.1.", "1.1.1.").
|
|
714
|
+
*/
|
|
715
|
+
declare function applyHeadingNumbering(nodes: MarkdownASTNode[], tocEntries: {
|
|
716
|
+
id: string;
|
|
717
|
+
text: string;
|
|
718
|
+
level: number;
|
|
719
|
+
}[], options: NumberHeadingsOptions): void;
|
|
661
720
|
/**
|
|
662
721
|
* Parses raw markdown string into rich structured AST nodes.
|
|
663
722
|
*/
|
|
@@ -725,8 +784,8 @@ interface NormalizedSignatureItem {
|
|
|
725
784
|
}
|
|
726
785
|
interface NormalizedSignatureBlock {
|
|
727
786
|
items: NormalizedSignatureItem[];
|
|
728
|
-
align:
|
|
729
|
-
style:
|
|
787
|
+
align: SignatureAlignOption;
|
|
788
|
+
style: SignatureStyleOption;
|
|
730
789
|
borderColor: string;
|
|
731
790
|
titleColor: string;
|
|
732
791
|
nameColor: string;
|
|
@@ -749,28 +808,46 @@ interface NormalizedCoverPage {
|
|
|
749
808
|
logo?: string;
|
|
750
809
|
logoWidth?: number | string;
|
|
751
810
|
bgGradient?: string;
|
|
811
|
+
backgroundColor?: string;
|
|
752
812
|
textColor?: string;
|
|
813
|
+
titleColor?: string;
|
|
814
|
+
subtitleColor?: string;
|
|
815
|
+
accentColor?: string;
|
|
753
816
|
footerText?: string;
|
|
817
|
+
address?: string;
|
|
818
|
+
email?: string;
|
|
819
|
+
phone?: string;
|
|
820
|
+
website?: string;
|
|
821
|
+
social?: Record<string, string>;
|
|
822
|
+
copyright?: string;
|
|
754
823
|
}
|
|
755
824
|
interface NormalizedBackCover {
|
|
756
825
|
enabled: boolean;
|
|
757
826
|
preset: "modern" | "corporate" | "minimal" | "contact-card";
|
|
758
827
|
title: string;
|
|
759
828
|
subtitle?: string;
|
|
829
|
+
author?: string;
|
|
760
830
|
company?: string;
|
|
831
|
+
version?: string;
|
|
832
|
+
date?: string;
|
|
761
833
|
address?: string;
|
|
762
834
|
email?: string;
|
|
763
835
|
phone?: string;
|
|
764
836
|
website?: string;
|
|
765
837
|
social?: Record<string, string>;
|
|
766
838
|
copyright?: string;
|
|
839
|
+
footerText?: string;
|
|
767
840
|
badge?: string;
|
|
768
841
|
badgeColor?: string;
|
|
769
842
|
badgeTextColor?: string;
|
|
770
843
|
logo?: string;
|
|
771
844
|
logoWidth?: number | string;
|
|
772
845
|
bgGradient?: string;
|
|
846
|
+
backgroundColor?: string;
|
|
773
847
|
textColor?: string;
|
|
848
|
+
titleColor?: string;
|
|
849
|
+
subtitleColor?: string;
|
|
850
|
+
accentColor?: string;
|
|
774
851
|
}
|
|
775
852
|
interface NormalizedNumberHeadings {
|
|
776
853
|
enabled: boolean;
|
|
@@ -823,22 +900,13 @@ interface ResolvedDocumentConfig {
|
|
|
823
900
|
syntaxTheme: string;
|
|
824
901
|
}
|
|
825
902
|
/**
|
|
826
|
-
* Replaces dynamic variables ({title}, {subtitle}, {author}, {version}, {date}, {company}) in text templates.
|
|
903
|
+
* Replaces dynamic variables ({title}, {subtitle}, {author}, {version}, {date}, {company}, {year}, and any custom metadata keys) in text templates.
|
|
827
904
|
*/
|
|
828
|
-
declare function replaceDocumentTokens(template
|
|
829
|
-
title?: string;
|
|
830
|
-
subtitle?: string;
|
|
831
|
-
author?: string;
|
|
832
|
-
version?: string;
|
|
833
|
-
date?: string;
|
|
834
|
-
company?: string;
|
|
835
|
-
year?: string;
|
|
836
|
-
[key: string]: string | undefined;
|
|
837
|
-
}): string;
|
|
905
|
+
declare function replaceDocumentTokens(template?: string, meta?: Record<string, unknown>): string;
|
|
838
906
|
/**
|
|
839
|
-
* Normalizes watermark configuration into a consistent structured object.
|
|
907
|
+
* Normalizes watermark configuration into a consistent structured object with dynamic token replacement.
|
|
840
908
|
*/
|
|
841
|
-
declare function normalizeWatermark(rawWatermark?: string | WatermarkOptions | false): NormalizedWatermark | undefined;
|
|
909
|
+
declare function normalizeWatermark(rawWatermark?: string | WatermarkOptions | false, tokens?: Record<string, unknown>): NormalizedWatermark | undefined;
|
|
842
910
|
/**
|
|
843
911
|
* Normalizes an individual left, center, or right header/footer zone slot.
|
|
844
912
|
*/
|
|
@@ -868,25 +936,11 @@ declare function normalizeSignatures(raw?: SignatureBlockConfig | SignatureItem[
|
|
|
868
936
|
/**
|
|
869
937
|
* Normalizes Cover Page configuration with token replacement.
|
|
870
938
|
*/
|
|
871
|
-
declare function normalizeCoverPage(rawCover?: boolean | CoverPageConfig | Record<string, unknown>, tokenCtx?:
|
|
872
|
-
title?: string;
|
|
873
|
-
subtitle?: string;
|
|
874
|
-
author?: string;
|
|
875
|
-
version?: string;
|
|
876
|
-
date?: string;
|
|
877
|
-
company?: string;
|
|
878
|
-
}): NormalizedCoverPage | undefined;
|
|
939
|
+
declare function normalizeCoverPage(rawCover?: boolean | CoverPageConfig | Record<string, unknown>, tokenCtx?: Record<string, unknown>): NormalizedCoverPage | undefined;
|
|
879
940
|
/**
|
|
880
941
|
* Normalizes Back Cover / Closing Page configuration with token replacement.
|
|
881
942
|
*/
|
|
882
|
-
declare function normalizeBackCover(rawBack?: boolean | BackCoverConfig | Record<string, unknown>, tokenCtx?:
|
|
883
|
-
title?: string;
|
|
884
|
-
subtitle?: string;
|
|
885
|
-
author?: string;
|
|
886
|
-
version?: string;
|
|
887
|
-
date?: string;
|
|
888
|
-
company?: string;
|
|
889
|
-
}): NormalizedBackCover | undefined;
|
|
943
|
+
declare function normalizeBackCover(rawBack?: boolean | BackCoverConfig | Record<string, unknown>, tokenCtx?: Record<string, unknown>): NormalizedBackCover | undefined;
|
|
890
944
|
/**
|
|
891
945
|
* Normalizes numberHeadings configuration.
|
|
892
946
|
*/
|
|
@@ -906,13 +960,13 @@ declare function resolveDocumentConfig(frontmatter?: Record<string, unknown>, us
|
|
|
906
960
|
*/
|
|
907
961
|
declare function escapeHtml(str: string): string;
|
|
908
962
|
/**
|
|
909
|
-
*
|
|
963
|
+
* Renders inline Markdown spans (bold, italic, links, images, footnotes, math, etc.) to HTML with token replacement.
|
|
910
964
|
*/
|
|
911
|
-
declare function renderInlinesToHtml(spans?: MarkdownInlineSpan[], baseDir?: string): Promise<string>;
|
|
965
|
+
declare function renderInlinesToHtml(spans?: MarkdownInlineSpan[], baseDir?: string, tokens?: Record<string, unknown>): Promise<string>;
|
|
912
966
|
/**
|
|
913
967
|
* Renders an AST node array to HTML.
|
|
914
968
|
*/
|
|
915
|
-
declare function renderNodesToHtml(nodes: MarkdownASTNode[], resolved: ResolvedDocumentConfig, baseDir?: string): Promise<string>;
|
|
969
|
+
declare function renderNodesToHtml(nodes: MarkdownASTNode[], resolved: ResolvedDocumentConfig, baseDir?: string, tokens?: Record<string, unknown>): Promise<string>;
|
|
916
970
|
/**
|
|
917
971
|
* Renders the Cover Page HTML and returns { html, css }.
|
|
918
972
|
*/
|
|
@@ -930,7 +984,7 @@ declare function renderBackCoverHtml(backCover: NormalizedBackCover, baseDir?: s
|
|
|
930
984
|
/**
|
|
931
985
|
* Builds standalone self-contained HTML from a parsed Markdown document.
|
|
932
986
|
*/
|
|
933
|
-
declare function buildHtmlDocument(doc: ParsedMarkdownDocument, config
|
|
987
|
+
declare function buildHtmlDocument(doc: ParsedMarkdownDocument, config?: MarkforgeConfig, baseDir?: string): Promise<string>;
|
|
934
988
|
|
|
935
989
|
/**
|
|
936
990
|
* Finds available Chrome or Chromium binary for headless PDF rendering.
|
|
@@ -945,6 +999,20 @@ declare function injectPagedMediaStyles(html: string, config: MarkforgeConfig, m
|
|
|
945
999
|
*/
|
|
946
1000
|
declare function buildPdfDocument(doc: ParsedMarkdownDocument, config: MarkforgeConfig, baseDir?: string): Promise<Buffer>;
|
|
947
1001
|
|
|
1002
|
+
/**
|
|
1003
|
+
* Converts inline AST spans into clean, readable plain text.
|
|
1004
|
+
*/
|
|
1005
|
+
declare function renderInlinesToText(spans?: MarkdownInlineSpan[], meta?: Record<string, unknown>): string;
|
|
1006
|
+
/**
|
|
1007
|
+
* Builds a structured, beautifully formatted plain text (.txt) document from markdown AST.
|
|
1008
|
+
*/
|
|
1009
|
+
declare function buildTextDocument(doc: ParsedMarkdownDocument, config?: MarkforgeConfig, _baseDir?: string): Promise<string>;
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Builds a high-resolution PNG document image buffer using headless Chromium screenshot.
|
|
1013
|
+
*/
|
|
1014
|
+
declare function buildPngDocument(doc: ParsedMarkdownDocument, config?: MarkforgeConfig, baseDir?: string): Promise<Buffer>;
|
|
1015
|
+
|
|
948
1016
|
interface ResolvedImage {
|
|
949
1017
|
src: string;
|
|
950
1018
|
buffer: Buffer;
|
|
@@ -1013,8 +1081,8 @@ declare const KATEX_INLINE_CSS = "\n.katex { font: normal 1.21em KaTeX_Main, Tim
|
|
|
1013
1081
|
/**
|
|
1014
1082
|
* Flagship corporate theme — full design system with Blu-by-BCA-Digital cyan palette.
|
|
1015
1083
|
*/
|
|
1016
|
-
declare const THEME_CORPORATE = "\n:root {\n --mf-bg: #ffffff;\n --mf-text: #0f172a;\n --mf-text-muted: #64748b;\n --mf-primary: #33CDCF;\n --mf-primary-dark: #009DA0;\n --mf-primary-light: #ECFDFD;\n --mf-border: #e2e8f0;\n --mf-card-bg: #f8fafc;\n --mf-code-bg: #0f172a;\n --mf-code-text: #f8fafc;\n --mf-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --mf-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n}\nbody { background-color: var(--mf-bg); color: var(--mf-text); font-family: var(--mf-font-family); font-size: 15px; line-height: 1.65; margin: 0; padding: 2.5rem; }\n.document-container { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }\nh1, h2, h3, h4, h5, h6 { color: var(--mf-
|
|
1017
|
-
declare const THEME_DEFAULT = "\n:root {\n --mf-bg: #ffffff;\n --mf-text: #0f172a;\n --mf-text-muted: #64748b;\n --mf-primary: #33CDCF;\n --mf-primary-dark: #009DA0;\n --mf-primary-light: #ECFDFD;\n --mf-border: #e2e8f0;\n --mf-card-bg: #f8fafc;\n --mf-code-bg: #0f172a;\n --mf-code-text: #f8fafc;\n --mf-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --mf-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n}\nbody { background-color: var(--mf-bg); color: var(--mf-text); font-family: var(--mf-font-family); font-size: 15px; line-height: 1.65; margin: 0; padding: 2.5rem; }\n.document-container { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }\nh1, h2, h3, h4, h5, h6 { color: var(--mf-
|
|
1084
|
+
declare const THEME_CORPORATE = "\n:root {\n --mf-bg: #ffffff;\n --mf-text: #0f172a;\n --mf-text-muted: #64748b;\n --mf-primary: #33CDCF;\n --mf-primary-dark: #009DA0;\n --mf-primary-light: #ECFDFD;\n --mf-border: #e2e8f0;\n --mf-card-bg: #f8fafc;\n --mf-code-bg: #0f172a;\n --mf-code-text: #f8fafc;\n --mf-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --mf-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n}\nbody { background-color: var(--mf-bg); color: var(--mf-text); font-family: var(--mf-font-family); font-size: 15px; line-height: 1.65; margin: 0; padding: 2.5rem; }\n.document-container { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }\nh1, h2, h3, h4, h5, h6 { color: var(--mf-primary-dark); font-weight: 700; margin-top: 1.8rem; margin-bottom: 0.8rem; line-height: 1.25; }\nh1 { font-size: 2.2rem; color: var(--mf-primary-dark); border-bottom: 2.5px solid var(--mf-primary); padding-bottom: 0.5rem; }\nh2 { font-size: 1.6rem; color: var(--mf-primary-dark); border-bottom: 1px solid #CCFBF1; padding-bottom: 0.4rem; }\nh3 { font-size: 1.3rem; color: var(--mf-primary-dark); }\nh4 { font-size: 1.1rem; color: var(--mf-primary-dark); }\nh5 { font-size: 1.0rem; color: var(--mf-primary-dark); }\nh6 { font-size: 0.9rem; color: var(--mf-primary-dark); }\np { margin: 0.8rem 0; }\n";
|
|
1085
|
+
declare const THEME_DEFAULT = "\n:root {\n --mf-bg: #ffffff;\n --mf-text: #0f172a;\n --mf-text-muted: #64748b;\n --mf-primary: #33CDCF;\n --mf-primary-dark: #009DA0;\n --mf-primary-light: #ECFDFD;\n --mf-border: #e2e8f0;\n --mf-card-bg: #f8fafc;\n --mf-code-bg: #0f172a;\n --mf-code-text: #f8fafc;\n --mf-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --mf-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n}\nbody { background-color: var(--mf-bg); color: var(--mf-text); font-family: var(--mf-font-family); font-size: 15px; line-height: 1.65; margin: 0; padding: 2.5rem; }\n.document-container { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }\nh1, h2, h3, h4, h5, h6 { color: var(--mf-primary-dark); font-weight: 700; margin-top: 1.8rem; margin-bottom: 0.8rem; line-height: 1.25; }\nh1 { font-size: 2.2rem; color: var(--mf-primary-dark); border-bottom: 2.5px solid var(--mf-primary); padding-bottom: 0.5rem; }\nh2 { font-size: 1.6rem; color: var(--mf-primary-dark); border-bottom: 1px solid #CCFBF1; padding-bottom: 0.4rem; }\nh3 { font-size: 1.3rem; color: var(--mf-primary-dark); }\nh4 { font-size: 1.1rem; color: var(--mf-primary-dark); }\nh5 { font-size: 1.0rem; color: var(--mf-primary-dark); }\nh6 { font-size: 0.9rem; color: var(--mf-primary-dark); }\np { margin: 0.8rem 0; }\n";
|
|
1018
1086
|
declare const THEMES: Record<string, string>;
|
|
1019
1087
|
|
|
1020
1088
|
/**
|
|
@@ -1070,8 +1138,7 @@ declare function loadConfig(customPath?: string, startDir?: string): Promise<{
|
|
|
1070
1138
|
}>;
|
|
1071
1139
|
|
|
1072
1140
|
/**
|
|
1073
|
-
* Dynamically resolved version — reads from the nearest package.json at runtime.
|
|
1074
|
-
* Falls back to the hardcoded FALLBACK_VERSION constant if not found.
|
|
1141
|
+
* Dynamically resolved version — reads strictly from the nearest package.json at runtime.
|
|
1075
1142
|
*/
|
|
1076
1143
|
declare const MARKFORGE_VERSION: string;
|
|
1077
1144
|
/**
|
|
@@ -1079,4 +1146,4 @@ declare const MARKFORGE_VERSION: string;
|
|
|
1079
1146
|
*/
|
|
1080
1147
|
declare function getMarkforgeVersion(fromDir?: string): string;
|
|
1081
1148
|
|
|
1082
|
-
export { type BackCoverConfig, type
|
|
1149
|
+
export { type BackCoverConfig, BackCoverPreset, type BackCoverPresetType, type BackCoverSocial, type CompilationResult, type CoverPageConfig, CoverPagePreset, type CoverPreset, DEFAULT_CONFIG, type DocumentLayoutConfig, type DocumentMetadata, type DocumentOrientation, type FootnoteDefinition, type FrontmatterMetadata, type GeneratedOutputFile, type HeaderFooterItem, type HeaderFooterSlot, KATEX_INLINE_CSS, MARKFORGE_VERSION, type MarkdownASTNode, type MarkdownInlineSpan, type MarkdownNodeType, type MarkforgeConfig, type MarkforgeFormat, type MarkforgeTheme, type NormalizedBackCover, type NormalizedCoverPage, type NormalizedHeaderFooter, type NormalizedHeaderFooterZone, type NormalizedMargins, type NormalizedNumberHeadings, type NormalizedSecurity, type NormalizedSignatureBlock, type NormalizedSignatureItem, type NormalizedWatermark, type NumberHeadingsConfig, Orientation, OutputFormat, PAPER_DIMENSIONS_TWIP, type PageMargins, type PaperSize, PaperSizeEnum, type ParsedMarkdownDocument, type PdfPermissions, type PreviewServerInstance, type PreviewServerOptions, type ResolvedDocumentConfig, type ResolvedImage, SYNTAX_COLORS, type SecurityConfig, SignatureAlign, type SignatureAlignOption, type SignatureBlockConfig, type SignatureItem, SignatureStyle, type SignatureStyleOption, SyntaxTheme, type SyntaxToken, THEMES, THEME_CORPORATE, THEME_DEFAULT, Theme, type ThemeProps, type WatermarkOptions, WatermarkPosition, applyHeadingNumbering, buildDocxDocument, buildHtmlDocument, buildPdfDocument, buildPngDocument, buildTextDocument, buildTextDocument as buildTxtDocument, compileMarkdown, defineConfig, escapeHtml, findChromeExecutable, formatServerTimestamp, generateThemeCss, getMarkforgeVersion, getMimeType, highlightCodeToHtml, injectPagedMediaStyles, inlineHtmlImages, loadConfig, compileMarkdown as markforge, normalizeBackCover, normalizeCoverPage, normalizeHeaderFooter, normalizeHeaderFooterSlot, normalizeNumberHeadings, normalizeSecurity, normalizeSignatures, normalizeWatermark, parseInlineSpans, parseMarginToTwip, parseMarkdownDocument as parseMarkdown, parseMarkdownDocument, renderBackCoverHtml, renderCoverPageHtml, renderInlinesToHtml, renderInlinesToText, renderMathToHtml, renderMermaidToPng, renderNodesToHtml, replaceDocumentTokens, resolveDocumentConfig, resolveImage, slugify, startPreviewServer, tokenizeCodeLine };
|