Skip to content

Commit eabdcdc

Browse files
Merge branch 'dev' of github.com:watson-developer-cloud/nodejs-wrapper into dev
2 parents 97a93d9 + f55f078 commit eabdcdc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/document_conversion.v1-experimental.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ var document_conversion = watson.document_conversion({
1212
// convert a single document
1313
document_conversion.convert({
1414
// (JSON) ANSWER_UNITS, NORMALIZED_HTML, or NORMALIZED_TEXT
15-
file: fs.createReadStream(__dirname + '/resources/document_conversion/sample-docx.docx'),
16-
conversion_target: document_conversion.conversion_target.ANSWER_UNITS
15+
file: fs.createReadStream(__dirname + '/resources/example.html'),
16+
conversion_target: document_conversion.conversion_target.ANSWER_UNITS,
17+
config: {
18+
// split the html file by "h2", "h3" and "h4" tags
19+
html_to_answer_units: {
20+
selectors: [ 'h2','h3', 'h4']
21+
}
22+
}
1723
}, function (err, response) {
1824
if (err) {
1925
console.error(err);
2026
} else {
2127
console.log(JSON.stringify(response, null, 2));
2228
}
23-
});
29+
});

0 commit comments

Comments
 (0)