annotate nodejs/README @ 624:d45c928f6523

Add SVG parser sample code.
author wycc
date Thu, 15 Jul 2010 22:34:04 +0800
parents
children 8f49e0235097
rev   line source
624
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
1 svg.js:
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
2 ===============
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
3
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
4 The sample code to load an SVG file. It requires the libxml, which is available at http://github.com/polotek/libxmljs/tree/refactor.
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
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
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
6 path can be defined by the NODE_PATH environment variable.
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
7
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
8 (1) Compile MadButterfly with nodejs support
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
9 ~user/MadButterfly$ ./configure --enable-nodejs; make
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
10
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
11 (2) Compile libxml
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
12 ~user/MadButterfly/nodejs$ git clone http://github.com/polotek/libxmljs.git
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
13 ~user/MadButterfly/nodejs$ cd libxml; make
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
14
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
15 (3) Copy the libxml.node to the nodejs build directory
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
16 ~user/MadButterfly/nodejs$ cp libxml/libxml.node objs/default
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
17 (4) Set the path
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
18 ~user/MadButterfly/nodejs$ export NODE_PATH=objs/default
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
19
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
20 (5) Execute svg.js
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
21 ~user/MadButterfly/nodejs$ node svg.js
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
22