markdansi 0.1.0 → 0.1.1
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 +12 -10
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +151 -0
- package/dist/hyperlink.d.ts +9 -0
- package/{src → dist}/hyperlink.js +8 -7
- package/dist/index.d.ts +8 -45
- package/dist/index.js +15 -0
- package/dist/parser.d.ts +2 -0
- package/{src → dist}/parser.js +4 -5
- package/dist/render.d.ts +9 -0
- package/dist/render.js +424 -0
- package/dist/theme.d.ts +18 -0
- package/dist/theme.js +105 -0
- package/dist/types.d.ts +58 -0
- package/dist/types.js +1 -0
- package/dist/wrap.d.ts +10 -0
- package/dist/wrap.js +48 -0
- package/docs/spec.md +23 -10
- package/package.json +10 -10
- package/tsconfig.json +2 -4
- package/src/cli.js +0 -62
- package/src/index.js +0 -12
- package/src/render.js +0 -342
- package/src/theme.js +0 -53
- package/src/wrap.js +0 -45
- package/types/index.ts +0 -74
package/types/index.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// Public API typings for Markdansi.
|
|
2
|
-
// Hand-authored source for `pnpm types` (tsc --emitDeclarationOnly)
|
|
3
|
-
// to produce dist/index.d.ts. Keep in sync with src/ changes.
|
|
4
|
-
|
|
5
|
-
export type ColorName =
|
|
6
|
-
| "black"
|
|
7
|
-
| "red"
|
|
8
|
-
| "green"
|
|
9
|
-
| "yellow"
|
|
10
|
-
| "blue"
|
|
11
|
-
| "magenta"
|
|
12
|
-
| "cyan"
|
|
13
|
-
| "white"
|
|
14
|
-
| `#${string}`
|
|
15
|
-
| `${number}`;
|
|
16
|
-
|
|
17
|
-
export type StyleIntent = {
|
|
18
|
-
color?: ColorName;
|
|
19
|
-
bgColor?: ColorName;
|
|
20
|
-
bold?: boolean;
|
|
21
|
-
italic?: boolean;
|
|
22
|
-
underline?: boolean;
|
|
23
|
-
dim?: boolean;
|
|
24
|
-
strike?: boolean;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type Theme = {
|
|
28
|
-
heading?: StyleIntent;
|
|
29
|
-
strong?: StyleIntent;
|
|
30
|
-
emph?: StyleIntent;
|
|
31
|
-
inlineCode?: StyleIntent;
|
|
32
|
-
blockCode?: StyleIntent;
|
|
33
|
-
code?: StyleIntent;
|
|
34
|
-
link?: StyleIntent;
|
|
35
|
-
quote?: StyleIntent;
|
|
36
|
-
hr?: StyleIntent;
|
|
37
|
-
listMarker?: StyleIntent;
|
|
38
|
-
tableHeader?: StyleIntent;
|
|
39
|
-
tableCell?: StyleIntent;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type ThemeName = "default" | "dim" | "bright";
|
|
43
|
-
|
|
44
|
-
export type Highlighter = (code: string, lang?: string) => string;
|
|
45
|
-
|
|
46
|
-
export interface RenderOptions {
|
|
47
|
-
wrap?: boolean;
|
|
48
|
-
width?: number;
|
|
49
|
-
hyperlinks?: boolean;
|
|
50
|
-
color?: boolean;
|
|
51
|
-
theme?: ThemeName | Theme;
|
|
52
|
-
/**
|
|
53
|
-
* Spaces per nesting level for lists (default 2).
|
|
54
|
-
*/
|
|
55
|
-
listIndent?: number;
|
|
56
|
-
/**
|
|
57
|
-
* Prefix used for blockquotes (default "│ ").
|
|
58
|
-
*/
|
|
59
|
-
quotePrefix?: string;
|
|
60
|
-
highlighter?: Highlighter;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export declare function render(
|
|
64
|
-
markdown: string,
|
|
65
|
-
options?: RenderOptions,
|
|
66
|
-
): string;
|
|
67
|
-
export declare function createRenderer(
|
|
68
|
-
options?: RenderOptions,
|
|
69
|
-
): (markdown: string) => string;
|
|
70
|
-
export declare function strip(
|
|
71
|
-
markdown: string,
|
|
72
|
-
options?: RenderOptions,
|
|
73
|
-
): string;
|
|
74
|
-
export declare const themes: Record<ThemeName | string, Theme>;
|