@leandown/markdown-it 0.0.1 → 0.0.9
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/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9689 -0
- package/package.json +4 -2
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type MarkdownIt from "markdown-it";
|
|
2
|
+
export interface MarkdownItLeanOptions {
|
|
3
|
+
/** Path to a Lean 4 project directory (containing lakefile.toml). Auto-creates a temp project if omitted. */
|
|
4
|
+
leanProjectPath?: string;
|
|
5
|
+
/** Enable hover tooltips, go-to-definition, goals, diagnostics. Default: true */
|
|
6
|
+
synchronizedHovers?: boolean;
|
|
7
|
+
/** Custom directory for the SQLite highlight cache */
|
|
8
|
+
cacheDir?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates a lean-highlight integration for markdown-it.
|
|
12
|
+
*
|
|
13
|
+
* Because markdown-it's rendering pipeline is synchronous but Lean highlighting
|
|
14
|
+
* requires async LSP communication, this returns an object with an async `render()`
|
|
15
|
+
* method rather than a traditional markdown-it plugin.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import MarkdownIt from "markdown-it";
|
|
20
|
+
* import { createMarkdownItLean } from "markdown-it-lean";
|
|
21
|
+
*
|
|
22
|
+
* const md = new MarkdownIt();
|
|
23
|
+
* const lean = createMarkdownItLean(md, { leanProjectPath: "./my-lean-project" });
|
|
24
|
+
*
|
|
25
|
+
* const html = await lean.render("```lean\ndef hello := 42\n```");
|
|
26
|
+
* await lean.shutdown();
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function createMarkdownItLean(md: MarkdownIt, options?: MarkdownItLeanOptions): {
|
|
30
|
+
/**
|
|
31
|
+
* Async render that processes lean code blocks via the Lean LSP
|
|
32
|
+
* before rendering the rest of the markdown with markdown-it.
|
|
33
|
+
*/
|
|
34
|
+
render(src: string, env?: any): Promise<string>;
|
|
35
|
+
/** Shutdown the LSP client */
|
|
36
|
+
shutdown(): Promise<void>;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAI1C,MAAM,WAAW,qBAAqB;IACpC,6GAA6G;IAC7G,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,UAAU,EAAE,OAAO,GAAE,qBAA0B;IAOpF;;;OAGG;gBACe,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBrD,8BAA8B;gBACZ,OAAO,CAAC,IAAI,CAAC;EAIlC"}
|