UNPKG

1.35 kBtext/x-handlebars-templateView Raw
1Getting started
2------
3
4### Requirements
5
6+ [node.js][nodejs_url]
7
8
9### Installation
10
11{{pkg.name}} is available as an [npm][npm_url] package.
12
13```bash
14# Install {{pkg.name}} as a global module.
15$ npm install {{pkg.name}} -g
16```
17
18Or you can install it without `-g` option and use [Programmatic API](#programmatic-api).
19For more details, see tutorial section "[01 - Installing coz][01_installing_coz_url]".
20
21
22### Quickstart
23
24**.who-likes-what.txt.bud** (bud file)
25```javascript
26{{{read './example/01-minimum-demo/.who-likes-what.txt.bud'}}}
27```
28
29As you see, `.bud` file is actuary a JavaScript file and could be exported a Node.js module.
30
31Save this file as `.who-likes-what.txt.bud` and then, run:
32
33```bash
34# Render the bud file
35$ coz render ".who-likes-what.txt.bud"
36```
37
38This will generate a file named `who-likes-what.txt`.
39
40For more details, see tutorial section "[02 - Rendering bud files][02_rendering_bud_files_url]".
41
42
43<a name="programmatic-api" />
44### Programmatic API
45
46{{pkg.name}} provides programmatic API which enables you to execute {{pkg.name}} commands from Node.js program.
47
48```javascript
49{{{read './example/04-from-programmatic-api/run_rendering.js'}}}
50```
51
52For more details, see tutorial section "[04 - Using programmatic API][04_using_programmatic_a_p_i_url]".
53
54
55[nodejs_url]: https://nodejs.org/en/
56[npm_url]: https://www.npmjs.com/
57
\No newline at end of file