Skip to content

Commit

Permalink
tools, refactor: update fib-spliter to v1.4.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Apr 7, 2023
1 parent 9134f64 commit 9392354
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 52 deletions.
17 changes: 15 additions & 2 deletions tools/gen_index.js
@@ -1,7 +1,7 @@
const path = require('path');
const db = require('db');
const hash = require('hash');
const split_folder = require('./util/split_folder');
const { split_folder } = require('fib-spliter');
const ChatGTP = require('./util/chatgpt');

const chatgpt = new ChatGTP(process.env.OPENAI_API_KEY);
Expand All @@ -11,7 +11,20 @@ var nodes = split_folder([
path.join(__dirname, '../docs/web/dist/docs/manual/module/ifs'),
path.join(__dirname, '../docs/web/dist/docs/manual/object/ifs'),
path.join(__dirname, '../test')
]);
], {
".html": {
ignore_tags: [
'svg'
],
before_split: function (html) {
html = html.replace(/<p>[0-9\r\n]*<\/p>/g, '');
html = html.replace(/<h3 /g, '</div><div><h3 ');
html = html.replace(/<code>/g, '<code>```\n');
html = html.replace(/<\/code>/g, '\n```</code>');
return html;
}
}
});

console.log(nodes.length, 'nodes');

Expand Down
2 changes: 1 addition & 1 deletion tools/package.json
Expand Up @@ -9,6 +9,6 @@
"uglify-js": "^3.0.27",
"devtools-protocol": "^0.0.856957",
"dts-dom": "^3.6.0",
"fib-spliter": "^1.2.0"
"fib-spliter": "^1.4.0"
}
}
49 changes: 0 additions & 49 deletions tools/util/split_folder.js

This file was deleted.

0 comments on commit 9392354

Please sign in to comment.