Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dev:citeproc-node [2011/04/01 11:22] – rmzelle | dev:citeproc-node [2017/11/12 19:53] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Setting up the standalone citeproc-node server ====== | + | < |
+ | in the process of updating the documentation for | ||
+ | <a href=" | ||
+ | may be outdated in the meantime. Thanks for your understanding.</ | ||
- | 1. Get citeproc-node | ||
- | <code bash>svn co https:// | + | See [[dev/citation_styles/ |
- | <code bash>cd citeproc-node</ | + | |
- | + | ||
- | 2. Get CSL 1.0 citation styles | + | |
- | <code bash>git clone https:// | + | |
- | + | ||
- | 3. Move CSL styles to where citeproc-node can find them | + | |
- | <code bash>mv styles csl1.0</ | + | |
- | + | ||
- | 4. Get citeproc-js | + | |
- | <code bash>hg clone https:// | + | |
- | + | ||
- | 5. Get sample data from citeproc-js | + | |
- | <code bash>mv citeproc-js/ | + | |
- | + | ||
- | 6. Remove citeproc-js directory | + | |
- | <code bash>rm -rf citeproc-js</ | + | |
- | + | ||
- | 7. Get node-o3-xml processing library | + | |
- | <code bash>git clone https:// | + | |
- | + | ||
- | If no prebuild of node-o3-xml is available for your platform (e.g. 32-bit Mac OS X), you can built it yourself: | + | |
- | <code bash>git clone https:// | + | |
- | cd o3 | + | |
- | ./ | + | |
- | cp build/ | + | |
- | + | ||
- | 8. Get CSL locale files | + | |
- | <code bash>git clone https:// | + | |
- | + | ||
- | 9. Move CSL locale files to where citeproc-node can find them | + | |
- | <code bash>mv locales csl-locales</ | + | |
- | + | ||
- | Your directory listing is now | + | |
- | <code bash> | + | |
- | citeprocmodule.js | + | |
- | citeprocnode.js | + | |
- | citeServerConf.json | + | |
- | citeServer.js | + | |
- | + | ||
- | (csl1.0, node-o3-xml, | + | |
- | + | ||
- | 10. Change configured path to xml library | + | |
- | <code bash> | + | |
- | + | ||
- | change the line: | + | |
- | " | + | |
- | to: | + | |
- | " | + | |
- | + | ||
- | 11. Start the server (assuming node binary is in your path): | + | |
- | <code bash> | + | |
- | + | ||
- | If all is well, you will see: | + | |
- | + | ||
- | < | + | |
- | precaching CSL engines | + | |
- | processStyleIdentifier | + | |
- | short name only | + | |
- | Server running at http:// | + | |
- | zcite.createEngine | + | |
- | cpSys created | + | |
- | en-US</ | + | |
- | + | ||
- | and in 20 or 30 seconds also: | + | |
- | + | ||
- | < | + | |
- | zcite.cacheSaveEngine | + | |
- | http:// | + | |
- | saving engine | + | |
- | turn precache flag off | + | |
- | last Step</ | + | |
- | + | ||
- | -------- | + | |
- | Now to test the server. Open another window and cd into your citeproc-node directory. | + | |
- | + | ||
- | 1. Edit the sampledata.html document to the expected JSON format to POST: | + | |
- | <code bash>vi sampledata.html</ | + | |
- | get rid of the HTML markup at the top & bottom of the file | + | |
- | + | ||
- | delete: | + | |
- | + | ||
- | <code html>< | + | |
- | < | + | |
- | <meta http-equiv=" | + | |
- | < | + | |
- | </ | + | |
- | < | + | |
- | < | + | |
- | + | ||
- | and delete (note the semicolon -- I think that is a typo in the file, so make sure and delete it): | + | |
- | + | ||
- | <code html>; | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | 2. Now you should have a valid JSON file, BUT the server expects to find an " | + | |
- | + | ||
- | < | + | |
- | + | ||
- | and, of course, this as a last line: | + | |
- | + | ||
- | < | + | |
- | + | ||
- | 3. Save this file as " | + | |
- | + | ||
- | 4. Try posting it to your server (which you should still have running): | + | |
- | + | ||
- | < | + | |
- | + | ||
- | You should see this response appear on your screen: | + | |
- | + | ||
- | <code html>< | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | <div class=" | + | |
- | </ | + |