diff --git a/README.md b/README.md index 130dcce..7e1a89d 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,112 @@ # JSSTE + + +[](https://www.npmjs.com/package/jsste) + +[](https://www.npmjs.com/package/jsste) + +## Desciption + JSSTE is a NodeJS-Module for rendering data in static HTML -## Example Page (JSON) +## Usage -```json -{ - "_STYLES_": ["Example1", "Example2"], - "_TEMPLATE_": "firstexample", - "TITLE": "app2", - "LINK": "http://www.example.de" -} +### Installation + +You can jsste install using [npm](https://www.npmjs.com/package/jsste) or [yarn](https://yarnpkg.com/package/jsste). + +```sh +npm install jsste ``` -## Example Template (HTML) +```sh +yarn add jsste +``` -```html - - +#### including in your project + +```javascript +const jsste = require("jsste"); +``` + +### Rendering + +```javascript +jsste.render(pagecode, tempaltecode); +``` + +#### Example + + +```javascript +const templatecode = ` +
- - -<[VARNAME2]>
-``` +`; -## Result (HTML) +const pagecode = {"VARNAME1":"Hello World", "VARNAME2":"This is a test"}; -```html +let result = Jsste.render(pagecode, templatecode); - - - - - - -This is a test
+// +// ``` -## special constants: +### Special Variables - `_TEMPLATE_` -> Defines the path to the temp file - `_STYLES_` -> Defines a list of CSS files that will be implemented + + +#### Example + + +```javascript +const templatecode = ` + + +<[VARNAME2]>
+ + +`; + +const pagecode = {"_STYLES_":["./main","./othercss"] "VARNAME1":"Hello World", "VARNAME2":"This is a test"}; + +let result = Jsste.render(pagecode, templatecode); + +// result +// +// +//This is a test
+// +// + + +``` \ No newline at end of file diff --git a/package.json b/package.json index c6133b8..e72f414 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsste", - "version": "1.1.1", + "version": "1.1.2", "description": "A Javascript Static Template Emgine", "main": "src/index.js", "directories": { @@ -30,8 +30,7 @@ "url": "https://github.com/lucaspalomodevelop/JSSTE/issues" }, "homepage": "https://github.com/lucaspalomodevelop/JSSTE#readme", - "dependencies": { - }, + "dependencies": {}, "engines": { "node": ">= 0.10.0" },