624
|
1 svg.js:
|
|
2 ===============
|
|
3
|
|
4 The sample code to load an SVG file. It requires the libxml, which is available at http://github.com/polotek/libxmljs/tree/refactor.
|
|
5 Please copy the libxmljs.node to the objs/default if you want to test the libxml+mbfly without installing them into the system. The
|
|
6 path can be defined by the NODE_PATH environment variable.
|
|
7
|
|
8 (1) Compile MadButterfly with nodejs support
|
|
9 ~user/MadButterfly$ ./configure --enable-nodejs; make
|
|
10
|
|
11 (2) Compile libxml
|
|
12 ~user/MadButterfly/nodejs$ git clone http://github.com/polotek/libxmljs.git
|
|
13 ~user/MadButterfly/nodejs$ cd libxml; make
|
|
14
|
|
15 (3) Copy the libxml.node to the nodejs build directory
|
|
16 ~user/MadButterfly/nodejs$ cp libxml/libxml.node objs/default
|
|
17 (4) Set the path
|
|
18 ~user/MadButterfly/nodejs$ export NODE_PATH=objs/default
|
|
19
|
|
20 (5) Execute svg.js
|
|
21 ~user/MadButterfly/nodejs$ node svg.js
|
|
22
|