markdown-read

turn url or html file to markdown

Usage no npm install needed!

<script type="module">
  import markdownRead from 'https://cdn.skypack.dev/markdown-read';
</script>

README

Markdown Read

Npm Version Open Issues Star Npm Month Downloads Type Support Node Version Code Size Install Size Publish Size Minified Size Gzip Size Dependency Count Tree Shaking Support

Get mardown from ANY url.

Demo Preview: HTML To Markdown

Tech Stack

  • @mozilla/readability for read meaning html
  • turndown for html to markdown

Screenshots

Usage

You will need Node.js installed on your system,then install it globally.

$ npm i -g markdown-read

# Turn current page to markdown
$ markdown https://shanyue.tech | head -10
## [#](#山月的琐碎博客记录) 山月的琐碎博客记录

关于平常工作中在前端,后端以及运维中遇到问题的一些文章总结。以后也会做系列文章进行输出,如前端高级进阶系列,个人服务器指南系列。

+   **[阿里云新人优惠服务器 (opens new window)](https://www.aliyun.com/1111/pintuan-share?ptCode=MTY5MzQ0Mjc1MzQyODAwMHx8MTE0fDE%3D&userCode=4sm8juxu)**
+   **[跟着山月管理个人服务器 (opens new window)](https://shanyue.tech/op/)**

## 名字由来

Chrome Extensions

Support Plaforms

  1. 掘金
  2. 知乎
  3. 博客园
  4. 微信公众号平台
  5. Segmentfault
  6. Github
  7. dev.to
  8. CSDN
  9. MDN

API

const { readMd, readHtml, readMdFromText } = require('markdown-read')

// read markdown from url
await readMd('https://www.example.com')

// read readbility content from url
await readHtml('https://www.example.com')

// read markdown from html
const md = readMdFromText('<h1>hello, world</h1>')

readMd(url, options)

url: string

URL will trun to markdown.

options.debug: boolean

Debug mode

options.headers: Headers

Fetch request for URL with headers

readHtml(url, options)

readMdFromText(html)