docsui-cli 0.0.59
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 +279 -0
- package/dist/commands/add.d.ts +5 -0
- package/dist/commands/add.js +254 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.js +250 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.js +548 -0
- package/dist/commands/list.d.ts +5 -0
- package/dist/commands/list.js +84 -0
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.js +1562 -0
- package/dist/commands/new.d.ts +5 -0
- package/dist/commands/new.js +113 -0
- package/dist/commands/remove.d.ts +5 -0
- package/dist/commands/remove.js +134 -0
- package/dist/commands/save.d.ts +5 -0
- package/dist/commands/save.js +60 -0
- package/dist/commands/update.d.ts +5 -0
- package/dist/commands/update.js +247 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +88 -0
- package/dist/latex-to-primitives.d.ts +59 -0
- package/dist/latex-to-primitives.js +1019 -0
- package/dist/lib/component-registry.d.ts +33 -0
- package/dist/lib/component-registry.js +843 -0
- package/dist/lib/css-tokens.d.ts +8 -0
- package/dist/lib/css-tokens.js +294 -0
- package/dist/metadata.d.ts +1 -0
- package/dist/metadata.js +4 -0
- package/dist/symbol-map.d.ts +30 -0
- package/dist/symbol-map.js +1607 -0
- package/dist/utils/detect-structure.d.ts +16 -0
- package/dist/utils/detect-structure.js +58 -0
- package/dist/utils/fetch-component.d.ts +13 -0
- package/dist/utils/fetch-component.js +81 -0
- package/dist/utils/get-config.d.ts +14 -0
- package/dist/utils/get-config.js +19 -0
- package/dist/utils/install-deps.d.ts +3 -0
- package/dist/utils/install-deps.js +23 -0
- package/dist/utils/save-mdx-page.d.ts +35 -0
- package/dist/utils/save-mdx-page.js +44 -0
- package/dist/utils/scan-mdx.d.ts +20 -0
- package/dist/utils/scan-mdx.js +106 -0
- package/dist/utils/telemetry.d.ts +3 -0
- package/dist/utils/telemetry.js +42 -0
- package/dist/utils/write-component.d.ts +7 -0
- package/dist/utils/write-component.js +25 -0
- package/dist/webview-bundle.js +3478 -0
- package/package.json +94 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a LaTeX math string to docsui primitive component JSX.
|
|
3
|
+
*
|
|
4
|
+
* @param latex - Raw LaTeX string (without $ delimiters)
|
|
5
|
+
* @param block - If true, wraps in <Equation>; if false, emits inline
|
|
6
|
+
* @returns MDX JSX string using primitive components
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* latexToPrimitives("\\frac{a}{b}")
|
|
10
|
+
* // → '<Frac num="a" den="b" />'
|
|
11
|
+
*
|
|
12
|
+
* latexToPrimitives("\\int_{-\\infty}^{\\infty} f(x)\\,dx")
|
|
13
|
+
* // → '<Integral from={<span>−<Inf /></span>} to={<Inf />}>f(x) dx</Integral>'
|
|
14
|
+
*/
|
|
15
|
+
declare function latexToPrimitives(latex: string, block?: boolean): string;
|
|
16
|
+
/**
|
|
17
|
+
* Convert a full MDX/Markdown string — replaces all $...$ and $$...$$ with primitives.
|
|
18
|
+
* Leaves all other content untouched.
|
|
19
|
+
*/
|
|
20
|
+
declare function convertMarkdownMath(mdx: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a string contains any LaTeX that should be converted.
|
|
23
|
+
*/
|
|
24
|
+
declare function hasLatex(content: string): boolean;
|
|
25
|
+
interface ParsedSolution {
|
|
26
|
+
title: string;
|
|
27
|
+
steps: Array<{
|
|
28
|
+
expr: string;
|
|
29
|
+
reason: string | null;
|
|
30
|
+
highlight?: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
answer: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse a plain-text step-by-step math solution into structured data.
|
|
36
|
+
*
|
|
37
|
+
* Handles both ⇒-separated and line-by-line formats.
|
|
38
|
+
*/
|
|
39
|
+
declare function parseSolutionText(text: string): ParsedSolution;
|
|
40
|
+
/**
|
|
41
|
+
* Convert a parsed solution to MDX using Solution/SolutionStep/SolutionAnswer components.
|
|
42
|
+
*/
|
|
43
|
+
declare function solutionToMdx(parsed: ParsedSolution, convertMath?: boolean): string;
|
|
44
|
+
/**
|
|
45
|
+
* One-shot: parse plain-text solution and emit MDX.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* parseSolution(`
|
|
49
|
+
* 8x/3 - 3/x = 2
|
|
50
|
+
* Solution:
|
|
51
|
+
* ⇒ 8x/3 - 3/x = 2/1
|
|
52
|
+
* ⇒ 8x - 3 = 2 × 3x (Cross-multiplication)
|
|
53
|
+
* ⇒ 2x = 3
|
|
54
|
+
* ⇒ x = 3/2
|
|
55
|
+
* `)
|
|
56
|
+
*/
|
|
57
|
+
declare function parseSolution(text: string): string;
|
|
58
|
+
|
|
59
|
+
export { type ParsedSolution, convertMarkdownMath, hasLatex, latexToPrimitives, parseSolution, parseSolutionText, solutionToMdx };
|