vite-plugin-norg 0.1.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/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/plugin/generators/html.d.ts +2 -0
- package/dist/plugin/generators/react.d.ts +2 -0
- package/dist/plugin/generators/svelte.d.ts +2 -0
- package/dist/plugin/index.d.ts +32 -0
- package/dist/plugin/index.js +2801 -0
- package/dist/plugin/plugin.d.ts +15 -0
- package/dist/plugin/wasm.d.ts +19 -0
- package/dist/vite_plugin_norg_parser-CNE0aFue.js +183 -0
- package/package.json +71 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FilterPattern } from 'vite';
|
|
2
|
+
import { NorgParseResult } from './wasm';
|
|
3
|
+
export interface NorgPluginOptions {
|
|
4
|
+
mode: 'html' | 'svelte' | 'react';
|
|
5
|
+
include?: FilterPattern;
|
|
6
|
+
exclude?: FilterPattern;
|
|
7
|
+
}
|
|
8
|
+
export type NorgGenerator = (result: NorgParseResult) => string;
|
|
9
|
+
export declare function norgPlugin(options: NorgPluginOptions): {
|
|
10
|
+
name: string;
|
|
11
|
+
enforce: "pre";
|
|
12
|
+
resolveId(this: import('rollup').PluginContext, id: string, importer: string | undefined): Promise<string | null>;
|
|
13
|
+
load(this: import('rollup').PluginContext, id: string): Promise<string | undefined>;
|
|
14
|
+
handleHotUpdate(this: void, ctx: import('vite').HmrContext): Promise<void>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface NorgMetadata {
|
|
2
|
+
title?: string;
|
|
3
|
+
author?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface TocEntry {
|
|
8
|
+
level: number;
|
|
9
|
+
title: string;
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
export interface NorgParseResult {
|
|
13
|
+
ast: unknown;
|
|
14
|
+
metadata: NorgMetadata | null;
|
|
15
|
+
html: string;
|
|
16
|
+
toc: TocEntry[];
|
|
17
|
+
}
|
|
18
|
+
export type NorgParser = (content: string) => NorgParseResult;
|
|
19
|
+
export declare function getWasmParser(): Promise<NorgParser>;
|