Skip to content

Commit 1b452ab

Browse files
committed
Fix missing packages & update readme
1 parent 995f240 commit 1b452ab

File tree

3 files changed

+23
-37
lines changed

3 files changed

+23
-37
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# freemarker-parser
22

3-
[![CircleCI](https://circleci.com/gh/armano2/freemarker-parser/tree/master.svg?style=svg)](https://circleci.com/gh/armano2/freemarker-parser/tree/master)
4-
[![Coverage Status](https://codecov.io/gh/armano2/freemarker-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/armano2/freemarker-parser)
5-
[![Greenkeeper badge](https://badges.greenkeeper.io/armano2/freemarker-parser.svg)](https://greenkeeper.io/)
3+
[![Codecov](https://img.shields.io/codecov/c/github/armano2/freemarker-parser.svg?style=for-the-badge)](https://circleci.com/gh/armano2/freemarker-parser/tree/master)
4+
[![CircleCI](https://img.shields.io/circleci/project/github/armano2/freemarker-parser/master.svg?style=for-the-badge)](https://circleci.com/gh/armano2/freemarker-parser/tree/master)
5+
[![License](https://img.shields.io/github/license/armano2/freemarker-parser.svg)](https://github.com/armano2/freemarker-parser/blob/master/LICENSE.md)
6+
[![Greenkeeper](https://badges.greenkeeper.io/armano2/freemarker-parser.svg)](https://github.com/armano2/freemarker-parser/blob/master/LICENSE.md)
7+
[![npm](https://img.shields.io/npm/v/freemarker-parser.svg)](https://www.npmjs.com/package/freemarker-parser)
68

79
Freemarker Parser is a javascript implementation of the Freemarker (http://freemarker.sourceforge.com).
810

9-
This project contains experimental version of parser ftl to ast tree
11+
This project contains **experimental version** of parser ftl to ast tree
1012

1113
## Installation
1214
You can install `freemarker-parser` using [npm](https://npmjs.com):
@@ -18,12 +20,8 @@ $ npm install freemarker-parser --save-dev
1820
## Usage
1921
Require `freemarker-parser` inside of your JavaScript:
2022

21-
```js
22-
const freemarker = require("freemarker-parser");
23-
```
24-
2523
### Parser
26-
```freemarker
24+
```ftl
2725
<#assign f=1>
2826
2927
<#if f gt 0>
@@ -34,17 +32,20 @@ const freemarker = require("freemarker-parser");
3432
```
3533

3634
```js
35+
const freemarker = require("freemarker-parser")
36+
3737
const parser = new freemarker.Parser()
38-
const astTree = parser.parse(template)
38+
const data = parser.parse(template)
3939

40-
console.log(astTree)
40+
console.log(data.ast)
41+
console.log(data.tokens)
4142
```
4243

4344
## Currently supported:
4445
- interpolations `${foo}`
4546
- methods, i.e. `${avg(3, 5)}`
4647
- executing macro
47-
- directives:
48+
- directives: http://freemarker.sourceforge.net/docs/ref_directives.html
4849
- `#attempt`
4950
- `#recover`
5051
- `#assign`
@@ -80,7 +81,7 @@ console.log(astTree)
8081
- support default values, i.e. `${user!"Anonymous"}`
8182
- null resistance in above expressions if in parenthesis
8283
- alternative syntax if starts with `[#ftl]`
83-
- directives: http://freemarker.sourceforge.net/docs/ref_directives.html
84+
- directives:
8485
- `#escape`
8586
- `#noescape`
8687
- `#fallback`

package-lock.json

Lines changed: 3 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "freemarker-parser",
3-
"version": "1.0.1",
3+
"version": "1.1.2",
44
"description": "Freemarker Parser is a javascript implementation of the Freemarker",
55
"scripts": {
66
"build": "npm run lint & tsc",
@@ -29,33 +29,31 @@
2929
"node": ">=6.0.0"
3030
},
3131
"author": "Armano (https://github.com/armano2)",
32-
"license": "Apache-2.0",
32+
"license": "MIT",
3333
"bugs": {
3434
"url": "https://github.com/armano2/freemarker-parser/issues"
3535
},
36-
"main": "index.js",
36+
"main": "dist/index.js",
3737
"files": [
38-
"index.d.ts",
39-
"index.js",
40-
"index.js.map"
38+
"dist/*.d.ts",
39+
"dist/*.js"
4140
],
4241
"homepage": "https://github.com/armano2/freemarker-parser#readme",
4342
"devDependencies": {
4443
"@types/glob": "^7.1.1",
45-
"@types/json-stringify-safe": "^5.0.0",
4644
"@types/mocha": "^5.2.5",
4745
"@types/node": "^10.12.0",
4846
"codecov": "^3.1.0",
4947
"glob": "^7.1.3",
5048
"mocha": "^5.2.0",
49+
"mocha-junit-reporter": "^1.18.0",
5150
"nyc": "^13.1.0",
5251
"source-map-support": "^0.5.9",
5352
"ts-node": "^7.0.1",
5453
"tslint": "^5.11.0",
5554
"typescript": "^3.1.3"
5655
},
5756
"dependencies": {
58-
"debug": "^4.1.0",
5957
"lines-and-columns": "^1.1.6"
6058
},
6159
"nyc": {

0 commit comments

Comments
 (0)