Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[第 97 期]【自荐】多平台(微信、知乎、掘金、csdn) html 转 markdown 工具 Sitdown #1111

Open
LinFeng1997 opened this issue Mar 2, 2020 · 0 comments

Comments

@LinFeng1997
Copy link

项目推荐

项目地址:https://github.com/mdnice/sitdown

文档地址:https://sitdown.mdnice.com/

类别:JavaScript/Typescript

项目后续更新计划:支持更多平台(如语雀等)、兼容更多冷门语法

项目描述:Sitdown 是使用 JavaScript 将 HTML 转换为 Markdown 的 JS 库。支持 GitHub Flavored Markdown 规范。也支持大部分的微信、知乎、CSDN、掘金的 HTML。

必写:主要是解决广大技术自媒体 up 主在转发文章时和多平台同步内容的格式统一问题。

截图:
sitdown demo

示例代码:

// Node
var { Sitdown } = require('sitdown')

var sitdown = new Sitdown()
var markdown = sitdown.HTMLToMD('你的 html')
// ES
import { Sitdown } from 'sitdown/src.esm'

var sitdown = new Sitdown()
var markdown = sitdown.HTMLToMD('你的 html')

使用插件:

import { Sitdown } from 'sitdown/src.esm';
import { applyJuejinRule } from '@sitdown/juejin/src.esm';

let sitdown = new Sitdown({
      keepFilter: ['style'],
      codeBlockStyle: 'fenced',
      bulletListMarker: '-',
      hr: '---',
});
sitdown.use(applyJuejinRule);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant