marky-markdown npm 的 markdown 解析器开源项目

我要开发同款
匿名用户2016年08月15日
184阅读

技术信息

开源地址
https://github.com/npm/marky-markdown
授权协议
ISC

作品详情

marky-markdow是pm的官方markdow解析器,基于NodeJS编写,旨在用 GitHub-stylemarkdow进行奇偶校验。它由一个最好的 CommoMarkmarkdow解析器——markdow-it构建。

安装

pm istall marky-markdow --save

编程中使用

marky-markdow输出单独函数。为了基本使用,这个函数使用一个由字符串转换而成的参数。

var marky = require("marky-markdow")marky("# hello, I'm markdow").html()

命令行使用

你可以在shell中使用marky-markdow来解析markdow文件,最简单的方法是全局安装它。

pm i -g marky-markdowmarky-markdow some.md > some.html

它能做什么

Parsesmarkdowwithmarkdow-it,afastadcommomark-compliatparser.

Removesbrokeadmalicioususeriputwithsaitize-html

AppliessytaxhighlightigtoGitHub-flavoredcodeblocksusigthehighlightslibraryfromAtom.

UsescheeriotoperformvariousfeatsofDOMmaipulatio.

Coverts:emoji:-styleshortcutstouicodeemojis.

Covertsheadigs(h1,h2,etc)itoachoredhyperliks.

CovertsrelativeGitHublikstotheirabsoluteequivalets.

CovertsrelativeGitHubimagessourcestotheirGitHubrawequivalets.

CovertsisecureGravatarURLstoHTTPS.

Covertslistitemswithleadig[]ad[x]itoGitHub-styletasklists

WrapsembeddedYouTubevideossotheycabestyled.

Parsesadsaitizespackage.descriptioasmarkdow.

AppliesCSSclassestoredudatcotetthatcloselymatchespmpackageameaddescriptio.

AppliesCSSclassestobadgeimages,sowecadosomethigiterestigwiththemoeday.

pm包

var package = {  ame: "foo",  descriptio: "foo is a thig",  repository: {    type: "git",    url: "https://github.com/kug/foo"  }}marky(  "# hello, I am the foo readme",  {package: package}).html()

功能介绍

marky-markdown 是 npm 的官方 markdown 解析器,基于 NodeJS 编写,旨在用 GitHub-style markdown 进行奇偶校验。它由一个最好的 Commo...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论