@atjson/renderer-commonmark
Advanced tools
Comparing version 0.5.5 to 0.5.6
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var renderer_hir_1 = require("@atjson/renderer-hir"); | ||
var MARKDOWN_RULES = { | ||
'root': function () { | ||
var document; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4]; | ||
case 1: | ||
document = _a.sent(); | ||
return [2, document.join('').trimRight()]; | ||
} | ||
}); | ||
const renderer_hir_1 = require("@atjson/renderer-hir"); | ||
const MARKDOWN_RULES = { | ||
*'root'() { | ||
let document = yield; | ||
return document.join('').trimRight(); | ||
}, | ||
'bold': function () { | ||
var text; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4]; | ||
case 1: | ||
text = _a.sent(); | ||
return [2, "**" + text.join('') + "**"]; | ||
} | ||
}); | ||
*'bold'() { | ||
let text = yield; | ||
return `**${text.join('')}**`; | ||
}, | ||
'blockquote': function () { | ||
var quote; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4]; | ||
case 1: | ||
quote = _a.sent(); | ||
return [2, quote.join('').split('\n').map(function (line) { return "> " + line; }).join('\n')]; | ||
} | ||
}); | ||
*'blockquote'() { | ||
let quote = yield; | ||
return quote.join('').split('\n').map(line => `> ${line}`).join('\n'); | ||
}, | ||
'heading': function (props) { | ||
var hashes, heading; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
hashes = new Array((props.size || 0) + 1).join('#'); | ||
return [4]; | ||
case 1: | ||
heading = _a.sent(); | ||
return [2, hashes + " " + heading.join('')]; | ||
} | ||
}); | ||
*'h1'(props) { | ||
let heading = yield; | ||
return `# ${heading.join('')}`; | ||
}, | ||
'horizontal-rule': function () { | ||
return __generator(this, function (_a) { | ||
return [2, '\n---\n']; | ||
}); | ||
*'h2'(props) { | ||
let heading = yield; | ||
return `## ${heading.join('')}`; | ||
}, | ||
'image': function (props) { | ||
return __generator(this, function (_a) { | ||
return [2, "![" + props.alt + "](" + props.url + ")"]; | ||
}); | ||
*'h3'(props) { | ||
let heading = yield; | ||
return `### ${heading.join('')}`; | ||
}, | ||
'italic': function () { | ||
var text; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4]; | ||
case 1: | ||
text = _a.sent(); | ||
return [2, "*" + text.join('') + "*"]; | ||
} | ||
}); | ||
*'h4'(props) { | ||
let heading = yield; | ||
return `#### ${heading.join('')}`; | ||
}, | ||
'line-break': function () { | ||
return __generator(this, function (_a) { | ||
return [2, ' ']; | ||
}); | ||
*'h5'(props) { | ||
let heading = yield; | ||
return `##### ${heading.join('')}`; | ||
}, | ||
'link': function (props) { | ||
var text; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4]; | ||
case 1: | ||
text = _a.sent(); | ||
return [2, "[" + text.join('') + "](" + props.url + ")"]; | ||
} | ||
}); | ||
*'h6'(props) { | ||
let heading = yield; | ||
return `###### ${heading.join('')}`; | ||
}, | ||
'list-item': function () { | ||
var indent, item, indentedItem; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
indent = ' '.repeat(this.indent); | ||
return [4]; | ||
case 1: | ||
item = _a.sent(); | ||
indentedItem = item.join('').split('\n').map(function (line) { return indent + line; }).join('\n').trim(); | ||
if (this.type === 'ordered-list') { | ||
return [2, "" + indent + this.index++ + ". " + indentedItem]; | ||
} | ||
else if (this.type === 'unordered-list') { | ||
return [2, indent + "- " + indentedItem]; | ||
} | ||
return [2, item]; | ||
} | ||
}); | ||
*'horizontal-rule'() { | ||
return '\n---\n'; | ||
}, | ||
'ordered-list': function () { | ||
var list, markdown; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
this.pushScope({ | ||
annotationLookup: this.annotationLookup, | ||
type: 'ordered-list', | ||
indent: (this.indent + 1) || 0, | ||
index: 1 | ||
}); | ||
return [4]; | ||
case 1: | ||
list = _a.sent(); | ||
this.popScope(); | ||
markdown = list.join('\n') + "\n"; | ||
if (this.type === 'ordered-list' || this.type === 'unordered-list') { | ||
return [2, "\n" + markdown]; | ||
} | ||
return [2, markdown]; | ||
} | ||
*'image'(props) { | ||
return `![${props.alt}](${props.url})`; | ||
}, | ||
*'italic'() { | ||
let text = yield; | ||
return `*${text.join('')}*`; | ||
}, | ||
*'line-break'() { | ||
return ' '; | ||
}, | ||
*'link'(props) { | ||
let text = yield; | ||
return `[${text.join('')}](${props.url})`; | ||
}, | ||
*'list-item'() { | ||
let indent = ' '.repeat(this.indent); | ||
let item = yield; | ||
let indentedItem = item.join('').split('\n').map(line => indent + line).join('\n').trim(); | ||
if (this.type === 'ordered-list') { | ||
return `${indent}${this.index++}. ${indentedItem}`; | ||
} | ||
else if (this.type === 'unordered-list') { | ||
return `${indent}- ${indentedItem}`; | ||
} | ||
return item; | ||
}, | ||
*'ordered-list'() { | ||
this.pushScope({ | ||
annotationLookup: this.annotationLookup, | ||
type: 'ordered-list', | ||
indent: (this.indent + 1) || 0, | ||
index: 1 | ||
}); | ||
let list = yield; | ||
this.popScope(); | ||
let markdown = `${list.join('\n')}\n`; | ||
if (this.type === 'ordered-list' || this.type === 'unordered-list') { | ||
return `\n${markdown}`; | ||
} | ||
return markdown; | ||
}, | ||
'unordered-list': function () { | ||
var list, markdown; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
this.pushScope({ | ||
annotationLookup: this.annotationLookup, | ||
type: 'unordered-list', | ||
indent: (this.indent + 1) || 0 | ||
}); | ||
return [4]; | ||
case 1: | ||
list = _a.sent(); | ||
this.popScope(); | ||
markdown = list.join('\n') + "\n"; | ||
if (this.type === 'ordered-list' || this.type === 'unordered-list') { | ||
return [2, "\n" + markdown]; | ||
} | ||
return [2, markdown]; | ||
} | ||
*'unordered-list'() { | ||
this.pushScope({ | ||
annotationLookup: this.annotationLookup, | ||
type: 'unordered-list', | ||
indent: (this.indent + 1) || 0 | ||
}); | ||
let list = yield; | ||
this.popScope(); | ||
let markdown = `${list.join('\n')}\n`; | ||
if (this.type === 'ordered-list' || this.type === 'unordered-list') { | ||
return `\n${markdown}`; | ||
} | ||
return markdown; | ||
}, | ||
'paragraph': function () { | ||
var text; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4]; | ||
case 1: | ||
text = _a.sent(); | ||
return [2, text.join('') + "\n\n"]; | ||
} | ||
}); | ||
*'paragraph'() { | ||
let text = yield; | ||
return `${text.join('')}\n\n`; | ||
} | ||
}; | ||
var CommonmarkRenderer = (function (_super) { | ||
__extends(CommonmarkRenderer, _super); | ||
function CommonmarkRenderer(annotationLookup) { | ||
var _this = _super.call(this) || this; | ||
_this.annotationLookup = Object.assign(annotationLookup || {}, MARKDOWN_RULES); | ||
return _this; | ||
class CommonmarkRenderer extends renderer_hir_1.default { | ||
constructor(annotationLookup) { | ||
super(); | ||
this.annotationLookup = Object.assign(annotationLookup || {}, MARKDOWN_RULES); | ||
} | ||
CommonmarkRenderer.prototype.registerRule = function (type, rule) { | ||
registerRule(type, rule) { | ||
this.annotationLookup[type] = rule; | ||
}; | ||
CommonmarkRenderer.prototype.unregisterRule = function (type) { | ||
} | ||
unregisterRule(type) { | ||
delete this.annotationLookup[type]; | ||
}; | ||
CommonmarkRenderer.prototype.willRender = function () { | ||
} | ||
willRender() { | ||
this.pushScope({ | ||
annotationLookup: this.annotationLookup | ||
}); | ||
}; | ||
CommonmarkRenderer.prototype.renderAnnotation = function (annotation) { | ||
var rule; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
rule = this.annotationLookup[annotation.type]; | ||
if (!rule) return [3, 2]; | ||
return [5, __values(rule.call(this, annotation.attributes))]; | ||
case 1: return [2, _a.sent()]; | ||
case 2: return [2, "yield.join('')"]; | ||
} | ||
}); | ||
}; | ||
return CommonmarkRenderer; | ||
}(renderer_hir_1.default)); | ||
} | ||
*renderAnnotation(annotation) { | ||
let rule = this.annotationLookup[annotation.type]; | ||
if (rule) { | ||
return yield* rule.call(this, annotation.attributes); | ||
} | ||
else { | ||
return `yield.join('')`; | ||
} | ||
} | ||
} | ||
exports.default = CommonmarkRenderer; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUNBLHFEQUE0QztBQVE1QyxJQUFNLGNBQWMsR0FBcUI7SUFNdEMsTUFBTSxFQUFQOzs7O3dCQUNpQixXQUFLOztvQkFBaEIsUUFBUSxHQUFHLFNBQUs7b0JBQ3BCLFdBQU8sUUFBUSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxTQUFTLEVBQUUsRUFBQzs7O0tBQ3RDO0lBS0EsTUFBTSxFQUFQOzs7O3dCQUNhLFdBQUs7O29CQUFaLElBQUksR0FBRyxTQUFLO29CQUNoQixXQUFPLE9BQUssSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsT0FBSSxFQUFDOzs7S0FDL0I7SUFRQSxZQUFZLEVBQWI7Ozs7d0JBQ3dCLFdBQUs7O29CQUF2QixLQUFLLEdBQWEsU0FBSztvQkFDM0IsV0FBTyxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxHQUFHLENBQUMsVUFBQSxJQUFJLElBQUksT0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BSSxDQUFDLGdCQUFnQjtTQUN4QyxDQUFDLENBQUM7SUFDTCxDQUFDO0lBRUQsQ0FBQyxnQkFBZ0IsQ0FBQyxVQUFtQjtRQUNuQyxJQUFJLElBQUksR0FBRyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQ2xELEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7WUFDVCxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsVUFBVSxDQUFDLFVBQVUsQ0FBQyxDQUFDO1FBQ3ZELENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNOLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQztRQUMxQixDQUFDO0lBQ0gsQ0FBQztDQUNGO0FBOUJELHFDQThCQyJ9 |
@@ -16,7 +16,26 @@ "use strict"; | ||
}, | ||
*'heading'(props) { | ||
let hashes = new Array((props.size || 0) + 1).join('#'); | ||
*'h1'(props) { | ||
let heading = yield; | ||
return `${hashes} ${heading.join('')}`; | ||
return `# ${heading.join('')}`; | ||
}, | ||
*'h2'(props) { | ||
let heading = yield; | ||
return `## ${heading.join('')}`; | ||
}, | ||
*'h3'(props) { | ||
let heading = yield; | ||
return `### ${heading.join('')}`; | ||
}, | ||
*'h4'(props) { | ||
let heading = yield; | ||
return `#### ${heading.join('')}`; | ||
}, | ||
*'h5'(props) { | ||
let heading = yield; | ||
return `##### ${heading.join('')}`; | ||
}, | ||
*'h6'(props) { | ||
let heading = yield; | ||
return `###### ${heading.join('')}`; | ||
}, | ||
*'horizontal-rule'() { | ||
@@ -111,2 +130,2 @@ return '\n---\n'; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW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yxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsVUFBVSxDQUFDLFVBQVUsQ0FBQyxDQUFDO1FBQ3ZELENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNOLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQztRQUMxQixDQUFDO0lBQ0gsQ0FBQztDQUNGIn0= |
{ | ||
"name": "@atjson/renderer-commonmark", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"description": "A brand new TypeScript library.", | ||
@@ -5,0 +5,0 @@ "main": "dist/commonjs/index.js", |
@@ -10,2 +10,3 @@ import { HIRNode } from '@atjson/hir'; | ||
const MARKDOWN_RULES: AnnotationLookup = { | ||
@@ -46,7 +47,26 @@ /** | ||
*/ | ||
*'heading'(props: { size: number }): IterableIterator<string> { | ||
let hashes = new Array((props.size || 0) + 1).join('#'); | ||
*'h1'(props: { size: number }): IterableIterator<string> { | ||
let heading = yield; | ||
return `${hashes} ${heading.join('')}`; | ||
return `# ${heading.join('')}`; | ||
}, | ||
*'h2'(props: { size: number }): IterableIterator<string> { | ||
let heading = yield; | ||
return `## ${heading.join('')}`; | ||
}, | ||
*'h3'(props: { size: number }): IterableIterator<string> { | ||
let heading = yield; | ||
return `### ${heading.join('')}`; | ||
}, | ||
*'h4'(props: { size: number }): IterableIterator<string> { | ||
let heading = yield; | ||
return `#### ${heading.join('')}`; | ||
}, | ||
*'h5'(props: { size: number }): IterableIterator<string> { | ||
let heading = yield; | ||
return `##### ${heading.join('')}`; | ||
}, | ||
*'h6'(props: { size: number }): IterableIterator<string> { | ||
let heading = yield; | ||
return `###### ${heading.join('')}`; | ||
}, | ||
@@ -53,0 +73,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7
26260
474