@ox-content/napi 3.2.1 → 3.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/index.d.ts +14 -0
- package/index.js +2 -0
- package/package.json +8 -8
package/index.d.ts
CHANGED
|
@@ -167,6 +167,14 @@ export declare function extractYoutubeVideoId(input: string): string | null
|
|
|
167
167
|
/** Formats a file or directory segment as an SSG title. */
|
|
168
168
|
export declare function formatSsgTitle(name: string): string
|
|
169
169
|
|
|
170
|
+
/** Parsed frontmatter and document body for one Markdown source. */
|
|
171
|
+
export interface FrontmatterParseResult {
|
|
172
|
+
/** Markdown content after frontmatter removal. */
|
|
173
|
+
content: string
|
|
174
|
+
/** Parsed frontmatter object. */
|
|
175
|
+
frontmatter: Record<string, any>
|
|
176
|
+
}
|
|
177
|
+
|
|
170
178
|
/** Generates the machine-readable docs data JSON payload. */
|
|
171
179
|
export declare function generateDocsDataJson(docs: Array<JsDocsMarkdownModule>, generatedAt: string): string
|
|
172
180
|
|
|
@@ -3314,6 +3322,9 @@ export declare function parseAndRenderAsync(source: string, options?: JsParserOp
|
|
|
3314
3322
|
*/
|
|
3315
3323
|
export declare function parseFeedDate(value?: string | undefined | null): JsParsedFeedDate | null
|
|
3316
3324
|
|
|
3325
|
+
/** Parses one Markdown source's YAML frontmatter without loading the Vite plugin. */
|
|
3326
|
+
export declare function parseFrontmatter(source: string): FrontmatterParseResult
|
|
3327
|
+
|
|
3317
3328
|
/** Parses Markdown source into a raw mdast memory block for JavaScript-side deserialization. */
|
|
3318
3329
|
export declare function parseMdastRaw(source: string, options?: JsParserOptions | undefined | null): Uint8Array
|
|
3319
3330
|
|
|
@@ -3416,6 +3427,9 @@ export declare function sanitizeHtml(html: string, options?: JsSanitizeOptions |
|
|
|
3416
3427
|
*/
|
|
3417
3428
|
export declare function searchIndex(indexJson: string, query: string, options?: JsSearchOptions | undefined | null): Array<JsSearchResult>
|
|
3418
3429
|
|
|
3430
|
+
/** Serializes frontmatter and Markdown content into one document. */
|
|
3431
|
+
export declare function stringifyFrontmatter(frontmatter: Record<string, any>, content: string): string
|
|
3432
|
+
|
|
3419
3433
|
/** Whether a fenced code block tagged `lang` will be highlighted natively. */
|
|
3420
3434
|
export declare function supportsHighlightLanguage(lang: string): boolean
|
|
3421
3435
|
|
package/index.js
CHANGED
|
@@ -157,6 +157,7 @@ const binding = loadBinding();
|
|
|
157
157
|
// Export individual functions for ESM compatibility
|
|
158
158
|
module.exports = binding;
|
|
159
159
|
module.exports.parse = binding.parse;
|
|
160
|
+
module.exports.parseFrontmatter = binding.parseFrontmatter;
|
|
160
161
|
module.exports.parseTransferRaw = binding.parseTransferRaw;
|
|
161
162
|
module.exports.parseMdastRaw = binding.parseMdastRaw;
|
|
162
163
|
module.exports.parseAndRender = binding.parseAndRender;
|
|
@@ -165,6 +166,7 @@ module.exports.IncrementalMarkdownParser = binding.IncrementalMarkdownParser;
|
|
|
165
166
|
module.exports.IncrementalMarkdownRenderer = binding.IncrementalMarkdownRenderer;
|
|
166
167
|
module.exports.prepareSource = binding.prepareSource;
|
|
167
168
|
module.exports.prepareSourceRaw = binding.prepareSourceRaw;
|
|
169
|
+
module.exports.stringifyFrontmatter = binding.stringifyFrontmatter;
|
|
168
170
|
module.exports.lintMarkdown = binding.lintMarkdown;
|
|
169
171
|
module.exports.lintMarkdownDocuments = binding.lintMarkdownDocuments;
|
|
170
172
|
module.exports.render = binding.render;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox-content/napi",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Node.js bindings for Ox Content - High-performance Markdown parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@ox-content/binding-darwin-x64": "3.2.
|
|
51
|
-
"@ox-content/binding-darwin-arm64": "3.2.
|
|
52
|
-
"@ox-content/binding-linux-x64-gnu": "3.2.
|
|
53
|
-
"@ox-content/binding-linux-x64-musl": "3.2.
|
|
54
|
-
"@ox-content/binding-linux-arm64-gnu": "3.2.
|
|
55
|
-
"@ox-content/binding-linux-arm64-musl": "3.2.
|
|
56
|
-
"@ox-content/binding-win32-x64-msvc": "3.2.
|
|
50
|
+
"@ox-content/binding-darwin-x64": "3.2.3",
|
|
51
|
+
"@ox-content/binding-darwin-arm64": "3.2.3",
|
|
52
|
+
"@ox-content/binding-linux-x64-gnu": "3.2.3",
|
|
53
|
+
"@ox-content/binding-linux-x64-musl": "3.2.3",
|
|
54
|
+
"@ox-content/binding-linux-arm64-gnu": "3.2.3",
|
|
55
|
+
"@ox-content/binding-linux-arm64-musl": "3.2.3",
|
|
56
|
+
"@ox-content/binding-win32-x64-msvc": "3.2.3"
|
|
57
57
|
}
|
|
58
58
|
}
|