@difizen/libro-markdown 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/es/anchor.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ import type { PluginWithOptions } from 'markdown-it';
2
+ import type State from 'markdown-it/lib/rules_core/state_core.js';
3
+ import type Token from 'markdown-it/lib/token.js';
4
+ export type RenderHref = (slug: string, state: State) => string;
5
+ export type RenderAttrs = (slug: string, state: State) => Record<string, string | number>;
6
+ export interface PermalinkOptions {
7
+ class: string;
8
+ symbol: string;
9
+ renderHref: RenderHref;
10
+ renderAttrs: RenderAttrs;
11
+ space: boolean;
12
+ placement: keyof typeof position;
13
+ ariaHidden: boolean;
14
+ }
15
+ export declare function renderHref(slug: string): string;
16
+ export declare function renderAttrs(_slug: string): {};
17
+ declare const position: {
18
+ readonly false: "push";
19
+ readonly true: "unshift";
20
+ readonly after: "push";
21
+ readonly before: "unshift";
22
+ };
23
+ export type PermalinkGenerator = (slug: string, opts: Partial<PermalinkOptions>, state: State, index: number) => void;
24
+ export declare const linkInsideHeader: PermalinkGenerator;
25
+ interface AnchorOptions {
26
+ level: number;
27
+ slugify: (val: string) => string;
28
+ getTokensText(tokens: Token[]): string;
29
+ uniqueSlugStartIndex: number;
30
+ tabIndex: string | false;
31
+ permalink: PermalinkGenerator;
32
+ permalinkOptions: Partial<PermalinkOptions>;
33
+ }
34
+ export declare const slugify: (s: string) => string;
35
+ /**
36
+ * fork from markdown-it-anchor
37
+ * @param md
38
+ * @param options
39
+ */
40
+ export declare const libroAnchor: PluginWithOptions<Partial<AnchorOptions>>;
41
+ export {};
42
+ //# sourceMappingURL=anchor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../src/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,KAAK,M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CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,OAAO,MAAO,MAAM,WACwC,CAAC;AAiD1E;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC,CAoDjE,CAAC"}
package/es/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from './anchor.js';
2
+ export * from './markdown-protocol.js';
3
+ export * from './markdown-render.js';
4
+ export * from './module.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const MarkdownParser: unique symbol;
2
+ export interface MarkdownRenderOption {
3
+ cellId?: string;
4
+ }
5
+ /**
6
+ * The interface for a Markdown parser.
7
+ */
8
+ export interface MarkdownParser {
9
+ /**
10
+ * Render a markdown source.
11
+ *
12
+ * @param source - The string to render.
13
+ * @returns - string.
14
+ */
15
+ render(source: string, options?: MarkdownRenderOption): string;
16
+ slugify: (val: string) => string;
17
+ }
18
+ //# sourceMappingURL=markdown-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-protocol.d.ts","sourceRoot":"","sources":["../src/markdown-protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAAC;IAE/D,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAClC"}
@@ -0,0 +1,11 @@
1
+ import MarkdownIt from 'markdown-it';
2
+ import type { MarkdownRenderOption } from './markdown-protocol.js';
3
+ import { MarkdownParser } from './markdown-protocol.js';
4
+ export declare class MarkdownRender implements MarkdownParser {
5
+ protected mkt: MarkdownIt;
6
+ slugify: (s: string) => string;
7
+ enablePermalink: boolean;
8
+ init(): void;
9
+ render(markdownText: string, options?: MarkdownRenderOption): string;
10
+ }
11
+ //# sourceMappingURL=markdown-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-render.d.ts","sourceRoot":"","sources":["../src/markdown-render.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,aAAa,CAAC;AAGrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,qBACa,cAAe,YAAW,cAAc;IACnD,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC;IAC1B,OAAO,wBAAW;IAClB,eAAe,UAAS;IAGxB,IAAI;IAaJ,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM;CAIrE"}
package/es/module.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { ManaModule } from '@difizen/mana-app';
2
+ export declare const MarkdownModule: ManaModule;
3
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,eAAO,MAAM,cAAc,YAG1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-markdown",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",