node-riner 1.1.0 → 1.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.
Files changed (2) hide show
  1. package/index.ts +18 -3
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -48,10 +48,25 @@ export default class Ride {
48
48
  this.pages[route] = `<title>${this.name}</title>` + generatedhtml
49
49
  });
50
50
  } else {
51
+ let page = this.parsedJson["Root"]["Page"]
51
52
  let route = this.parsedJson["Root"]["Page"]['@_route']
52
- let generatedhtml = Object.keys(this.parsedJson["Root"]["Page"]['Content']).map(tags => {
53
- return `<${tags}>${this.parsedJson["Root"]["Page"]['Content'][tags]}</${tags}>`
54
- }).join('');
53
+ let generatedhtml = Object.keys(page['Content']).map(tags => {
54
+ let match = page['Content'][tags].match(/{.*}/g)
55
+ console.log(match)
56
+
57
+ if(match) {
58
+ console.log("matched")
59
+ let matched : string = match[0]
60
+ matched = matched.replace("{", "")
61
+ matched = matched.replace("}", "")
62
+ writeFileSync("./runs.js", matched)
63
+ let out = execSync("node runs.js").toString()
64
+ console.log(matched)
65
+ page['Content'][tags] = page['Content'][tags].replace(/{.*}/, out)
66
+ }
67
+ console.log("e:" + page['Content'][tags])
68
+ return `<${tags}>${page['Content'][tags]}</${tags}>`
69
+ }).join('')
55
70
  this.pages[route] = generatedhtml
56
71
  }
57
72
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-riner",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",