import {marked} from 'marked';
import fs from 'fs';
// 读取README.md文件
fs.readFile('README.md', 'utf8', function(err, data) {
if (err) {
console.error("Error reading README.md:", err);
return;
}
// 使用marked将Markdown转换为HTML
let html = "
drpyS(drpy-node)";
html = html.replace("${htmlContent}",marked(data));
// 写入转换后的HTML到README.html
fs.writeFile('public/index.html', html, function(err) {
if (err) {
console.error("Error writing index.html:", err);
} else {
console.log("index.html has been created.");
}
});
});