Detalhes do pacote

mdka

nabbisen360Apache-2.01.5.4

HTML to Markdown converter

html, markdown, html-to-markdown, markdown-generator

readme (leia-me)

mdka

HTML to Markdown (MD) converter written in Rust.

Summary

A kind of text manipulator named mdka. "ka" means "化 (か)" pointing to conversion.
Designed with in mind:

  • Fast speed
  • Low memory consumption
  • Easy usage

Bindings for Node.js are supported. Functions are available Node.js scripts can import. For more details about functions, check out the docs.

Install

$ npm install mdka

Usage

Convert from HTML text

const { fromHtml } = require("mdka")

console.log(fromHtml("<p>Hello, world.</p>"))
// Hello, world.
//

Convert from HTML file

const { fromFile } = require("mdka")

console.log(fromFile("tests/fixtures/simple-01.html"))
// Hello, world.
//

Convert from HTML text and write the result to file

const { fromHtmlToFile } = require("mdka")

fromHtmlToFile("<p>Hello, world.</p>", "tests/tmp/out.md", false)

Convert from HTML file and write the result to file

const { fromFileToFile } = require("mdka")

fromFileToFile("tests/fixtures/simple-01.html", "tests/tmp/out.md", false)

Open-source, with care

This project is lovingly built and maintained by volunteers.
We hope it helps streamline your API development.
Please understand that the project has its own direction — while we welcome feedback, it might not fit every edge case 🌱

Acknowledgements

Depends on Servo's html5ever / markup5ever. Also, on PyO3's pyo3 / maturin on bindings for Python. napi-rs for binding for Node.js.