开源项目 remarkable 使用教程

开源项目 remarkable 使用教程

remarkableMarkdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.项目地址:https://gitcode.com/gh_mirrors/re/remarkable

1. 项目的目录结构及介绍

remarkable/
├── lib/
│   ├── block.js
│   ├── core.js
│   ├── helpers.js
│   ├── index.js
│   ├── inline.js
│   ├── parser.js
│   ├── renderer.js
│   └── utils.js
├── test/
│   ├── block.js
│   ├── core.js
│   ├── helpers.js
│   ├── inline.js
│   ├── parser.js
│   ├── renderer.js
│   └── utils.js
├── .editorconfig
├── .eslintrc
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── index.js
└── package.json

目录结构介绍

  • lib/:包含项目的核心代码文件。
    • block.js:处理块级元素。
    • core.js:核心功能实现。
    • helpers.js:辅助函数。
    • index.js:入口文件。
    • inline.js:处理行内元素。
    • parser.js:解析器。
    • renderer.js:渲染器。
    • utils.js:工具函数。
  • test/:包含项目的测试文件。
  • .editorconfig:编辑器配置文件。
  • .eslintrc:ESLint 配置文件。
  • .gitignore:Git 忽略文件配置。
  • .travis.yml:Travis CI 配置文件。
  • LICENSE:项目许可证。
  • README.md:项目说明文档。
  • index.js:项目入口文件。
  • package.json:项目依赖和配置文件。

2. 项目的启动文件介绍

项目的启动文件是 index.js,它作为项目的入口点,负责初始化和调用核心功能。

// index.js
const Remarkable = require('./lib/index');
module.exports = Remarkable;

启动文件介绍

  • index.js 导入了 lib/index.js 中的 Remarkable 类,并将其作为模块导出。

3. 项目的配置文件介绍

项目的配置文件主要包括 package.json.eslintrc

package.json

package.json 文件包含了项目的依赖、脚本和其他元数据。

{
  "name": "remarkable",
  "version": "2.0.1",
  "description": "Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins, high speed - all in one.",
  "main": "index.js",
  "scripts": {
    "test": "mocha --reporter spec --check-leaks test/",
    "lint": "eslint ."
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/jonschlinkert/remarkable.git"
  },
  "keywords": [
    "markdown",
    "md",
    "commonmark",
    "parser"
  ],
  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/jonschlinkert/remarkable/issues"
  },
  "homepage": "https://github.com/jonschlinkert/remarkable",
  "dependencies": {
    "argparse": "^1.0.7",
    "entities": "^2.0.0",
    "escape-html": "^1.0.3",
    "linkify-it": "^2.0.0",
    "uc.micro": "^1.0.3"
  },
  "devDependencies": {
    "eslint": "^5.16.0",
    "eslint-config-standard": "^12.0.0",
    "eslint-plugin-import": "^2.17.2",
    "eslint-plugin-node": "^8.0.1",
    "eslint-plugin-promise": "^4.1.1",
    "eslint-plugin-standard": "^4.0.0",
    "mocha": "^6.1

remarkableMarkdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.项目地址:https://gitcode.com/gh_mirrors/re/remarkable

  • 15
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夏庭彭Maxine

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值