annotate nodejs/README @ 700:8f49e0235097

Reformat README for nodejs binding
author Thinker K.F. Li <thinker@branda.to>
date Wed, 11 Aug 2010 20:14:18 +0800
parents d45c928f6523
children 4ca7a7ad7364
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
700
8f49e0235097 Reformat README for nodejs binding
Thinker K.F. Li <thinker@branda.to>
parents: 624
diff changeset
4 The sample code to load an SVG file. It requires the libxml, which is
8f49e0235097 Reformat README for nodejs binding
Thinker K.F. Li <thinker@branda.to>
parents: 624
diff changeset
5 available at http://github.com/polotek/libxmljs/tree/refactor. Please
8f49e0235097 Reformat README for nodejs binding
Thinker K.F. Li <thinker@branda.to>
parents: 624
diff changeset
6 copy the libxmljs.node to the objs/default if you want to test the
8f49e0235097 Reformat README for nodejs binding
Thinker K.F. Li <thinker@branda.to>
parents: 624
diff changeset
7 libxml+mbfly without installing them into the system. The path can be
8f49e0235097 Reformat README for nodejs binding
Thinker K.F. Li <thinker@branda.to>
parents: 624
diff changeset
8 defined by the NODE_PATH environment variable.
624
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
9
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
10 (1) Compile MadButterfly with nodejs support
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
11 ~user/MadButterfly$ ./configure --enable-nodejs; make
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
12
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
13 (2) Compile libxml
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
14 ~user/MadButterfly/nodejs$ git clone http://github.com/polotek/libxmljs.git
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
15 ~user/MadButterfly/nodejs$ cd libxml; make
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
16
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
17 (3) Copy the libxml.node to the nodejs build directory
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
18 ~user/MadButterfly/nodejs$ cp libxml/libxml.node objs/default
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
19 (4) Set the path
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
20 ~user/MadButterfly/nodejs$ export NODE_PATH=objs/default
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
21
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
22 (5) Execute svg.js
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
23 ~user/MadButterfly/nodejs$ node svg.js
d45c928f6523 Add SVG parser sample code.
wycc
parents:
diff changeset
24