markable
v0.1.1
Published
Make non-English Markdown plain text markable
Readme
Markable
Markable allows you to write markdown documents in any language. Markable translates your non-English Markdown syntax related symbols into English, so that they can be parsed by any markdown parser.
Read this in other languages: English | 简体中文
Demo
Checkout the demo to see markable in action.
Installation
npm install markableSupported Symbols
| Markdown Syntax | Chinese Input | Output |
|---|---|---|
| Heading | # 标题 | # 标题 |
| Bold | **加粗** | **加粗** |
| Italic | *斜体* | *斜体* |
| Strikethrough | ~~删除线~~ | ~~删除线~~ |
| Blockquote | 》 引用 | > 引用 |
| Inline Code | ·code· | `code` |
| Code Block | ···js | ```js |
| Link | 【标题】(url) | [标题](url) |
| Image | !【alt】(url) |  |
| Table | |head| | \|head\| |
| Horizontal Rule | --- | --- |
Usage
Node
var markable = require('markable');
console.log(markable('# 青山一道同云雨')); // # 青山一道同云雨
console.log(markable('**加粗**')); // **加粗**
console.log(markable('》 引用')); // > 引用Browser
You can use markable with marked
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Marked Markable in the browser</title>
</head>
<body>
<div id="content"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/markable.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
var text = '# Hello\n\n》 青山一道同云雨\n\n···js\n Hello World\n···';
document.getElementById('content').innerHTML =
marked(markable(text));
</script>
</body>
</html>Contributing
Contributions are always welcome, no matter how large or small. Before contributing, please read the Contributing.
