blog2md
blog2md copied to clipboard
html table support
Nice program !!
In case, for those who might look for html table support
-
yarn add turndown-plugin-gfm
, or -
npm i --save turndown-plugin-gfm
- add below code (2 lines, noted by >>) in
index.js
, about line 15
>> const tables = require('turndown-plugin-gfm').tables;
const TurndownService = require('turndown');
var tds = new TurndownService({ codeBlockStyle: 'fenced', fence: '```' })
>> tds.use(tables);
=> reference here, https://github.com/domchristie/turndown-plugin-gfm#usage
In addition to that, I like the output files (from blogger) to be organized in folder structure as 2019/12/filename.md Below is the patch, (might not suit everyone need.)
//: line 304
/* delete */ var fname = outputDir + '/' + path.basename(url);
/* add */ var fname = outputDir + '/' + url.substr(url.indexOf(".com")+5);
// line 438
function writeToFile(filename, content, append=false){
>> let f = path.parse(filename);
>> if (!fs.existsSync(f.dir))
>> fs.mkdirSync(f.dir, {recursive: true});
Thanks for you contribution. Leaving the ticket open, if anyone find this useful.