wwechat-to-markdown
v0.1.2
Published
解析微信文章 URL 为 markdown
Downloads
4
Readme
description
Enter the WeChat public address to convert it to markdown format
English | 简体中文
return options
| Properties | Description | Types | | ---- | ---- | ---- | | title | title | string | | author | author | string | | content | markdown content | string |
Basic Usage
CommonJs
const { transformHtml2Markdown } = require('@ryan-liu/wechat-to-markdown')
setTimeout(async () => {
const { title, author, content } = await transformHtml2Markdown('https://mp.weixin.qq.com/s/9d5DWg7YdMHPvVl-2KLH2w')
console.log('title', title)
console.log('author', author)
console.log('content', content)
}, 0)
vue3
index.ts
import { transformHtml2Markdown } from '@ryan-liu/wechat-to-markdown'
setup() {
const getData = async () => {
const { title, author, content } = await transformHtml2Markdown(
'/api/s/9d5DWg7YdMHPvVl-2KLH2w'
)
console.log('title', title)
console.log('author', author)
console.log('content', content)
}
getData()
return {}
},
vite.config.ts
...
server: {
proxy: {
'/api': {
target: 'https://mp.weixin.qq.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
...
Packages
turndown-plugin-gfm (turndown parsing partial html element plugin)