mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
d6dc5eea7a
Create a script to convert and inject README.md to documentation. Replace Emoji in this page with image from github. Because emoji in Ubuntu is ridiculously ugly...
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')
|