@tadaima/sekkei
Advanced tools
Comparing version 0.1.0 to 0.1.2
@@ -39,3 +39,2 @@ 'use strict'; | ||
console.log(this.output); | ||
try { | ||
@@ -53,6 +52,6 @@ fs.writeFileSync(path, this.output, 'utf8'); | ||
var Parser = function () { | ||
function Parser(doc, config) { | ||
function Parser(docPath, config) { | ||
_classCallCheck(this, Parser); | ||
this._doc = doc; | ||
this._doc = new Document(docPath); | ||
this._config = config; | ||
@@ -162,85 +161,2 @@ if (this._doc._source === null) { | ||
// class Parser { | ||
// constructor(doc, config) { | ||
// this._doc = doc; | ||
// this._config = config; | ||
// } | ||
// parseVariable(key, value) { | ||
// if (!key || !value) return false; | ||
// const re = new RegExp(`\{${key}\}`, "g"); | ||
// if (re.test(this.doc.output)) { | ||
// this.doc.output = this.doc.output.replace(re, `${value}`); | ||
// } else { | ||
// console.error(`${key} cannot be found`); | ||
// } | ||
// } | ||
// } | ||
// | ||
// class HTMLParser extends Parser { | ||
// constructor(doc, config) { | ||
// super(doc, config); | ||
// this.parse = { | ||
// a: { | ||
// variable: this.parseVariable.bind(this), | ||
// link: this.parseLink.bind(this) | ||
// }, | ||
// links: this.parseLinks.bind(this) | ||
// } | ||
// } | ||
// // {link name:placeholder class:classOne, classTwo} | ||
// parseLink(linkName) { | ||
// if (!this._config.links[linkName]) { | ||
// console.error("Link cannot be found."); | ||
// return false; | ||
// } | ||
// let link = this._config.links[linkName]; | ||
// console.log(link); | ||
// let re = new RegExp(`{link (?:name:${link.placeholder}(?: class:([\w,\s]+)|)}`, "gm"); | ||
// if (re.test(this._doc)) { | ||
// let match = re.exec(this._doc); | ||
// let classes = match[2].replace(/[,\s]+/g, ' '); | ||
// this.doc.output = this.doc.output.replace(re, `<a href='${link.href}' class='${classes}'>${link.title}</a>`); | ||
// } else { | ||
// console.error(`Title tag for ${link.placeholder} could not be found`); | ||
// } | ||
// } | ||
// parseLinks(links=userData.links) { | ||
// let re = new RegExp("\{block:links\}(.+)\{\/block:links\}", "gis"); | ||
// let blocks = re.exec(this.doc.output); | ||
// for (const block of blocks) { | ||
// for (const link in links) { | ||
// this.parseLink(links[`${link}`], block); | ||
// } | ||
// } | ||
// } | ||
// } | ||
// | ||
// class CSSParser extends Parser { | ||
// constructor(doc, config) { | ||
// super(doc, config); | ||
// this._doc = doc; | ||
// this._config = config; | ||
// this.parse = { | ||
// a: { | ||
// variable: this.parseVariable.bind(this) | ||
// } | ||
// } | ||
// } | ||
// } | ||
// | ||
// class Document { | ||
// constructor(path) { | ||
// this._path = path; | ||
// this._source = fs.readFileSync(this._path, 'utf8'); | ||
// this.output = this._source; | ||
// } | ||
// async save(path=this._path) { | ||
// console.log("saving..."); | ||
// console.log(path); | ||
// await writeFile(path, this.output, 'utf8'); | ||
// } | ||
// } | ||
// | ||
module.exports = { | ||
@@ -247,0 +163,0 @@ Parser: Parser, |
{ | ||
"name": "@tadaima/sekkei", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"description": "API for the parsing of Tadaima startpages", | ||
@@ -15,2 +15,3 @@ "main": "sekkei.js", | ||
], | ||
"repository": "github:liamelgie/sekkei", | ||
"author": "Liam Elgie", | ||
@@ -24,3 +25,2 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@tadaima/settei": "^0.1.0", | ||
"babel-cli": "^6.0.0", | ||
@@ -27,0 +27,0 @@ "babel-preset-env": "^1.7.0" |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
2
7662
145