npm 的 markdown 解析器 marky-markdown

码农软件 · 软件分类 · 语法解析工具 · 2019-12-12 11:28:42

软件介绍

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

安装

npm install marky-markdown --save

编程中使用

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

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

命令行使用

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

npm i -g marky-markdown
marky-markdown some.md > some.html

它能做什么

  • Parses markdown with markdown-it, a fast and commonmark-compliant parser.

  • Removes broken and malicious user input with sanitize-html

  • Applies syntax highlighting to GitHub-flavored code blocks using the highlights library from Atom.

  • Uses cheerio to perform various feats of DOM manipulation.

  • Converts :emoji:-style shortcuts to unicode emojis.

  • Converts headings (h1, h2, etc) into anchored hyperlinks.

  • Converts relative GitHub links to their absolute equivalents.

  • Converts relative GitHub images sources to their GitHub raw equivalents.

  • Converts insecure Gravatar URLs to HTTPS.

  • Converts list items with leading [ ] and [x] into GitHub-style task lists

  • Wraps embedded YouTube videos so they can be styled.

  • Parses and sanitizes package.description as markdown.

  • Applies CSS classes to redundant content that closely matches npm package name and description.

  • Applies CSS classes to badge images, so we can do something interesting with them one day.

npm 包

var package = {
  name: "foo",
  description: "foo is a thing",
  repository: {
    type: "git",
    url: "https://github.com/kung/foo"
  }
}
marky(
  "# hello, I am the foo readme",
  {package: package}
).html()

本文地址:https://www.codercto.com/soft/d/20978.html

python学习手册(原书第5版)

python学习手册(原书第5版)

马克·卢茨 / 机械工业出版社 / 2018-10 / 219

如果你想动手编写高效、高质量并且很容易与其他语言和工具集成的代码,本书将快速地帮助你利用Python提高效率。本书基于Python专家的流程培训课程编写,内容通俗易懂。本书包含很多注释的例子和插图,以帮助你开始使用Python2.7和3.3。每章都包含关于Python语言的重要组成部分的一节课。本书主要内容:了解Python的主要内置对象类型,如数字、列表和字典;创建和处理对象的Python语句,......一起来看看 《python学习手册(原书第5版)》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具