Skip to content

Commit 2b3ad00

Browse files
committed
Added examples in README.md
1 parent 734c892 commit 2b3ad00

File tree

3 files changed

+37
-26
lines changed

3 files changed

+37
-26
lines changed

README.md

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The module mapfile-ejs allows you to use [Embedded JavaScript (EJS)](http://ejs.
44

55
## Installation
66

7-
1. Install `Node.js` and `npm` from <https://nodejs.org/>
7+
1. Install `Node.js` and `npm` from <https://nodejs.org/>
88
2. Install `mapfile-ejs` with `npm i mapfile-ejs -g`
99

1010
## Getting started
@@ -77,52 +77,58 @@ and at the [examples directory](https://github.com/stadt-bielefeld/mapfile-ejs/t
7777

7878
### Mapfile
7979

80-
Input (example.emap):
80+
**Input (example.emap):**
8181

8282
```js
8383
MAP
84-
8584
<%
8685
//Loop to create 3 layers
8786
for(let i = 0; i < 3; i++) {
88-
%>
89-
90-
LAYER
91-
NAME "layer_<%- i %>"
92-
END
93-
87+
-%>
88+
LAYER
89+
NAME "layer_<%- i %>"
90+
END
9491
<%
9592
} //End of loop
96-
%>
97-
93+
-%>
9894
END
9995
```
10096

101-
Output (example.map):
97+
**Output (example.map):**
10298

10399
```js
104100
MAP
105-
106-
LAYER
107-
NAME "layer_0"
101+
LAYER
102+
NAME "layer_0"
103+
END
104+
LAYER
105+
NAME "layer_1"
106+
END
107+
LAYER
108+
NAME "layer_2"
109+
END
108110
END
111+
```
109112

110-
LAYER
111-
NAME "layer_1"
112-
END
113+
**How to use require and include:**
113114

114-
LAYER
115-
NAME "layer_2"
116-
END
115+
```js
116+
<%
117+
// require is available like
118+
const path = require(`path`);
119+
-%>
117120

118-
END
121+
<%
122+
// include is available (include_file.ejs) like
123+
-%>
124+
<%- include('include_file', { }); %>
119125
```
120126

121127
## Documentation
122128

123-
* [API Documentation](https://stadt-bielefeld.github.io/mapfile-ejs/docs/api/index.html)
124-
* [Changelog](https://github.com/stadt-bielefeld/mapfile-ejs/tree/master/docs/changelog/index.md)
125-
129+
- [API Documentation](https://stadt-bielefeld.github.io/mapfile-ejs/docs/api/index.html)
130+
- [Changelog](https://github.com/stadt-bielefeld/mapfile-ejs/tree/master/docs/changelog/index.md)
131+
126132
## Developer
127133

128134
**Build API Documentation:**
@@ -147,4 +153,4 @@ node examples\watch\index.js
147153

148154
## License
149155

150-
[MIT](https://github.com/stadt-bielefeld/mapfile-ejs/blob/master/LICENSE)
156+
[MIT](https://github.com/stadt-bielefeld/mapfile-ejs/blob/master/LICENSE)

docs/changelog/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Changelog
22

3+
* [v2.0.1](v2.0.1.md)
34
* [v2.0.0](v2.0.0.md)

docs/changelog/v2.0.1.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# v2.0.1
2+
3+
* Fixed log bugs in the cli tool `emap`
4+
* Added examples in `README.md`

0 commit comments

Comments
 (0)