Skip to content

Commit f40a4ec

Browse files
committed
cleanup
removed the "raw" subfolder for holding html html is now expected at project root
1 parent 82926a9 commit f40a4ec

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
raw/
1+
*.html
22
node_modules
33

44
*.pdf

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Hence, this project exists and can be used create visualizations or progamatical
1616

1717
1. yarn or npm install the dependencies
1818
2. view `config.js` # Categories are limited to a default set.
19-
3. `node save_data.js` # Download pages containing raw HTML (seed files)
19+
3. `node save_data.js` # Download pages containing input HTML data (seed files)
2020
4. `node run.js > schema.json` # Generate structured representation (JSON artifact) from the seed files
2121

2222
## Constraints

save_data.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ const http = require('http');
33
const {createWriteStream, existsSync} = require('fs');
44

55
const {categories, doc_base} = require('./config');
6-
const {normalize} = require('./util');
6+
const {normalize} = require('./src/util');
77

88
for (const _category of categories) {
99
const category = normalize(_category);
10-
const targetFile = `./raw/${category}.html`;
11-
const page = `${doc_base}/${category}.html`;
10+
const fileName = `${category}.html`;
11+
const targetFile = `./${fileName}`;
12+
const page = `${doc_base}/${fileName}`;
1213
if (existsSync(targetFile)) {
13-
console.log(`skipped download cached entity [${category}] ${page}`);
14+
console.log(` [${category}]: page in cache ${fileName} (skipped)`);
1415
continue;
1516
}
1617

src/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const {JSDOM} = require("jsdom");
88
* in a browser-free environment.
99
*/
1010
const createDOM = (category) => {
11-
const fData = readFileSync("./raw/" + category + ".html")
11+
const fData = readFileSync("./" + category + ".html")
1212
const dom = new JSDOM(fData);
1313
return dom;
1414
}

0 commit comments

Comments
 (0)