marked

2018-05-16 admin

marked是什么

什么是marked,A markdown parser built for speed

marked介绍

⬇️</g-emoji>low-level compiler for parsing markdown without caching or blocking for long periods of time

  • <g-emoji class=“g-emoji” alias=“balance_scale” fallback-src=“https://assets-cdn.github.com/images/icons/emoji/unicode/2696.png”>⚖️</g-emoji>light-weight while implementing all markdown features from the supported flavors & specifications
  • <g-emoji class=“g-emoji” alias=“globe_with_meridians” fallback-src=“https://assets-cdn.github.com/images/icons/emoji/unicode/1f310.png”>🌐</g-emoji>works in a browser, on a server, or from a command line interface (CLI)

Demo

Checkout the demo page to see marked in action<g-emoji class=“g-emoji” alias=“basketball_man” fallback-src=“https://assets-cdn.github.com/images/icons/emoji/unicode/26f9.png”>⛹️</g-emoji>

Docs

Our documentation pages are also rendered using marked<g-emoji class=“g-emoji” alias=“100” fallback-src=“https://assets-cdn.github.com/images/icons/emoji/unicode/1f4af.png”>💯</g-emoji>

Installation

CLI: npm install -g marked

In-browser: npm install marked --save

Usage

CLI

$ marked -o hello.html
hello world
^D
$ cat hello.html
<p>hello world</p>

Browser

<!doctype html>
<html>
<head>
  <meta charset="utf-8"/>
  <title>Marked in the browser</title>
</head>
<body>
  <div id="content"></div>
  <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
  <script>
    document.getElementById('content').innerHTML =
      marked('# Marked in the browser\n\nRendered by **marked**.');
  </script>
</body>

你可能感兴趣的文章:

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-32342.html

文章标题:marked

回到顶部