@sealcode/jdd 0.1.1 → 0.2.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/@types/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/@types/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type JDDocument = Array<{
|
|
|
10
10
|
}>;
|
|
11
11
|
export interface JDDContext {
|
|
12
12
|
render_image: (path_to_image: string) => FlatTemplatable;
|
|
13
|
+
render_markdown: (markdown: string) => FlatTemplatable;
|
|
13
14
|
}
|
|
14
15
|
export declare const simpleJDDContext: JDDContext;
|
|
15
16
|
export declare function render(registry: Registry, document: JDDocument, context: JDDContext): import("stream").Readable;
|
package/lib/index.js
CHANGED
|
@@ -16,11 +16,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.render = exports.simpleJDDContext = void 0;
|
|
18
18
|
const tempstream_1 = require("tempstream");
|
|
19
|
+
const marked_1 = require("marked");
|
|
19
20
|
__exportStar(require("./component-arguments"), exports);
|
|
20
21
|
__exportStar(require("./component"), exports);
|
|
21
22
|
__exportStar(require("./registry"), exports);
|
|
22
23
|
exports.simpleJDDContext = {
|
|
23
24
|
render_image: (path) => /* HTML */ `<img src="file://path" />`,
|
|
25
|
+
render_markdown: (string) => marked_1.marked.parse(string),
|
|
24
26
|
};
|
|
25
27
|
function render(registry, document, context) {
|
|
26
28
|
return (0, tempstream_1.tempstream) `${document.map(({ component_name, args }) => {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyD;AAEzD,wDAAsC;AACtC,8CAA4B;AAC5B,6CAA2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyD;AAEzD,mCAAgC;AAChC,wDAAsC;AACtC,8CAA4B;AAC5B,6CAA2B;AAYd,QAAA,gBAAgB,GAAe;IAC3C,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,2BAA2B;IAC9D,eAAe,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC;CACjD,CAAC;AAEF,SAAgB,MAAM,CACrB,QAAkB,EAClB,QAAoB,EACpB,OAAmB;IAEnB,OAAO,IAAA,uBAAU,EAAA,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,EAAE;QAC7D,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,EAAE;YACf,OAAO,CAAC,IAAI,CACX,uCAAuC,GAAG,cAAc,CACxD,CAAC;YACF,OAAO,EAAE,CAAC;SACV;QACD,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,EAAE,CAAC;AACN,CAAC;AAfD,wBAeC"}
|