You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -52,7 +52,7 @@ info Server running at http://127.0.0.1:8085
52
52
### Step 3
53
53
54
54
Now to test the server using the sampledata.json file provided in the
55
-
citeproc-node sources. Try posting it to your server, from a separate
55
+
citeproc-js-server sources. Try posting it to your server, from a separate
56
56
console:
57
57
58
58
```
@@ -76,24 +76,22 @@ You should see a response similar to this:
76
76
77
77
## Configuration
78
78
79
-
Configuration parameters are specified in the *citeServerConf.json* file.
79
+
citeproc-js-server uses [node-config](https://github.com/lorenwest/node-config) for configuration. Configuration parameters can be specified in config/local.json or other files and formats supported by node-config.
80
80
81
-
Citeproc-node now supports csl styles that has been converted to JSON.
81
+
citeproc-js-server now supports CSL styles that has been converted to JSON.
82
82
This improves performance significantly on style initialization, and somewhat on style execution
83
-
over the jsdom xml parsing mode. Local styles can be converted ahead of time which improves performance
84
-
even futher, otherwise both local and remote styles will be converted at run time.
83
+
over the JSDOM XML parsing mode. Local styles can be converted ahead of time, which improves performance even futher. Otherwise both local and remote styles will be converted at run time.
85
84
86
-
There is now a python script (xmltojson.py) included to convert a single file or a directory, including
87
-
the option to only convert files that have been modified within a specified time limit, to better handle
88
-
periodic pulling of style/locale changes.
89
-
To use pre-converted json styles, just point the cslPath preference at the directory of converted styles.
85
+
There is a Python script, xmltojson.py, to convert a single file or a directory, including
86
+
the option to only convert files that have been modified within a specified time limit, to better handle periodic pulling of style/locale changes.
87
+
To use pre-converted json styles, just point the `cslPath` preference at the directory of converted styles.
90
88
91
89
## Running the tests
92
90
93
91
Start citation server
94
92
95
93
```
96
-
node ./lib/citeServer.js
94
+
npm start
97
95
```
98
96
99
97
Run a test with all independent styles in the csl directory:
@@ -102,22 +100,50 @@ Run a test with all independent styles in the csl directory:
102
100
node ./test/testallstyles.js
103
101
```
104
102
103
+
## Using the web service
104
+
105
+
The service responds to HTTP `OPTIONS` or `POST` requests only.
106
+
107
+
When sending a request, various options should be set in the query string of the URL, and
108
+
the CSL-JSON data should be sent in the content body.
109
+
110
+
The following query string parameters are recognized:
111
+
112
+
* responseformat - One of `html`, `json`, or `rtf`
113
+
(value is passed through to citeproc.js). Default is `json`.
114
+
* bibliography - Default is `1`.
115
+
* style - This is a URL or a name of a CSL style. Default is `chicago-author-date`.
116
+
* locale - Default is `en-US`
117
+
* citations - Default is `0`.
118
+
* outputformat - Default is `html`.
119
+
* memoryUsage - If this is `1`, and the server has debug enabled, the server will respond
120
+
with a report of memory usage (and nothing else). Default is `0`.
121
+
* linkwrap - Default is `0`
122
+
* clearCache - If this `1`, then the server will clear any cached style engines, and
123
+
reread the CSL styles. This can only be sent from the localhost. Default is `0`.
124
+
125
+
The POST data JSON object can have these members:
126
+
127
+
* items - either an array or a hash of items
128
+
* itemIDs - an array of identifiers of those items to convert. If this is not
129
+
given, the default is to convert all of the items.
130
+
* citationClusters
131
+
* styleXML - a CSL style to use
132
+
105
133
106
134
## Included libraries
107
135
108
136
### csl
109
137
110
-
Included as a Git submodule.
138
+
CSL citation styles, included as a Git submodule
111
139
112
140
### csl-locales
113
141
114
-
Included as a Git submodule.
142
+
CSL locales, included as a Git submodule
115
143
116
144
### citeproc-js
117
145
118
-
Built from [citeproc-js](https://bitbucket.org/fbennett/citeproc-js)
119
-
Currently needs minor modifications to work with citeproc-node, so you should not
120
-
just drop in new versions at the moment.
146
+
The [citeproc-js citation processor](https://github.com/Juris-M/citeproc-js)
121
147
122
148
## Logging
123
149
@@ -139,34 +165,3 @@ In the code, to create a log message at a particular level, for example,
139
165
```javascript
140
166
log.warn("Uh-oh!");
141
167
```
142
-
143
-
## Using the web service
144
-
145
-
The service responds to HTTP `OPTIONS` or `POST` requests only.
146
-
147
-
When sending a request, various options should be set in the query string of the URL, and
148
-
the CSL-JSON data should be sent in the content body.
149
-
150
-
The following query string parameters are recognized:
151
-
152
-
* responseformat - One of `html`, `json`, or `rtf`
153
-
(value is passed through to citeproc.js). Default is `json`.
154
-
* bibliography - Default is `1`.
155
-
* style - This is a URL or a name of a CSL style. Default is `chicago-author-date`.
156
-
* locale - Default is `en-US`
157
-
* citations - Default is `0`.
158
-
* outputformat - Default is `html`.
159
-
* memoryUsage - If this is `1`, and the server has debug enabled, the server will respond
160
-
with a report of memory usage (and nothing else). Default is `0`.
161
-
* linkwrap - Default is `0`
162
-
* clearCache - If this `1`, then the server will clear any cached style engines, and
163
-
reread the CSL styles. This can only be sent from the localhost. Default is `0`.
164
-
165
-
The POST data JSON object can have these members:
166
-
167
-
* items - either an array or a hash of items
168
-
* itemIDs - an array of identifiers of those items to convert. If this is not
169
-
given, the default is to convert all of the items.
0 commit comments