mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
13 lines
433 B
JavaScript
13 lines
433 B
JavaScript
|
const path = require('path')
|
||
|
const fs = require('fs')
|
||
|
|
||
|
const showdown = require('showdown')
|
||
|
const converter = new showdown.Converter({
|
||
|
tables: true
|
||
|
})
|
||
|
const text = fs.readFileSync(path.resolve(__dirname, '..', 'README.md')).toString()
|
||
|
const html = converter.makeHtml(text)
|
||
|
|
||
|
const htmlPath = path.resolve(__dirname, '../demo/readme.js')
|
||
|
fs.writeFileSync(htmlPath, 'export default `<div class="markdown-body">' + html + '</div>`\n')
|