temp update
parent
d3e6efe8b6
commit
a03dc3d678
5
index.js
5
index.js
|
@ -126,7 +126,8 @@ function parseDirectory(directory){
|
||||||
const filenames = getFilesFromDir(path.resolve(directory));
|
const filenames = getFilesFromDir(path.resolve(directory));
|
||||||
filenames.forEach((filename) => {
|
filenames.forEach((filename) => {
|
||||||
console.log(filename);
|
console.log(filename);
|
||||||
const doc = fs.readFileSync(`${filename}`);
|
const doc = fs.readFileSync(filename);
|
||||||
|
console.log(doc);
|
||||||
let children, errors = parseMarkdown(doc);
|
let children, errors = parseMarkdown(doc);
|
||||||
const langCode = getLangFromFilename(filename);
|
const langCode = getLangFromFilename(filename);
|
||||||
let docJson = {
|
let docJson = {
|
||||||
|
@ -168,7 +169,7 @@ function parseAll(dirArray){
|
||||||
type: 'root',
|
type: 'root',
|
||||||
children: rootChildren
|
children: rootChildren
|
||||||
}
|
}
|
||||||
fs.writeFile('./parser/fpb.json', JSON.stringify(rootJson, null, 3), function(err) {
|
fs.writeFileSync('./parser/fpb.json', JSON.stringify(rootJson, null, 3), function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue