Download the PHP package kreuzberg-dev/html-to-markdown without Composer

On this page you can find all versions of the php package kreuzberg-dev/html-to-markdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package html-to-markdown

html-to-markdown

Bindings Rust Python Node.js WASM Java Go C# PHP Ruby Elixir R Dart Kotlin Swift Zig C FFI License Documentation
html-to-markdown
Join Discord Live Demo

Fast, robust HTML → Markdown for 16 languages. A tiered converter that picks the safest fastest path per input without losing content.

Documentation | API Reference

Highlights

Architecture

The converter routes each input through one of three tiers based on a fast prescan of the byte stream:

  1. Tier-1 — Single-pass byte scanner. Walks html.as_bytes() once and emits Markdown directly. Handles 110+ HTML tags including paragraphs, headings, lists, GFM tables, links, images, inline emphasis, blockquotes, indented code blocks. Bails (returns a structured error) on any construct it cannot prove byte-equivalent to Tier-2 — custom elements, CDATA, malformed entities, nested tables, mixed table sections, multi-line table cells, etc.

  2. Tier-2 — tl::parse DOM walker. Picks up Tier-1's bails and inputs the classifier rejected up front (non-default style options, non-Markdown output, etc.). Handles the full HTML5 spec via a tolerant DOM walk.

  3. Tier-3 — html5ever standards-conformant parser. Engaged when Tier-2 detects HTML requiring full HTML5 repair (custom elements, structural recovery, weird namespace transitions).

The dispatcher is invisible to the caller. The same convert() call works regardless of which tier handled the input; the output is byte-identical across tiers (enforced by a 116-snapshot oracle).

Performance

Best-of-3 measurements on the harness corpus (Apple Silicon, cargo build --release):

Fixture Size ms (best of 3) Throughput
wikipedia/medium_python.html 1.24 MB 62.58 ms 19.0 MB/s
wikipedia/large_rust.html 1.07 MB 37.17 ms 27.3 MB/s
wikipedia/small_html.html 973 KB 29.32 ms 31.6 MB/s
wikipedia/tables_countries.html 756 KB 18.95 ms 38.1 MB/s
mdream/github-markdown-complete.html 430 KB 10.57 ms 38.7 MB/s
mdream/react-learn.html 265 KB 12.11 ms 20.9 MB/s
mdream/wikipedia-small.html 166 KB 5.63 ms 28.1 MB/s
issues/gh-121-hacker-news.html 57 KB 1.08 ms 50.3 MB/s
mdream/nuxt-example.html 3.6 KB 0.029 ms 116.1 MB/s

Corpus: 29 fixtures totalling 6.4 MB across clean_small, clean_medium, clean_large, spec_rules, adversarial, and fallthrough_* groups. Per-group regression thresholds (5–30%) are enforced on every PR via task bench:compare. Run task bench:run to reproduce on your hardware.

Capabilities

Quick Start

See the package READMEs for the full list: PHP, Go, Java, C#, Elixir, R, Dart, Kotlin (Android), Swift, Zig, WASM, and a C ABI for everything else.

Usage

convert() is the single entry point. It returns a structured ConversionResult:

Language Bindings

Language Package Install
Rust html-to-markdown-rs cargo add html-to-markdown-rs
Python html-to-markdown pip install html-to-markdown
TypeScript / Node.js @kreuzberg/html-to-markdown-node npm install @kreuzberg/html-to-markdown-node
WebAssembly @kreuzberg/html-to-markdown-wasm npm install @kreuzberg/html-to-markdown-wasm
Ruby html-to-markdown gem install html-to-markdown
PHP kreuzberg-dev/html-to-markdown composer require kreuzberg-dev/html-to-markdown
Go htmltomarkdown go get github.com/kreuzberg-dev/html-to-markdown/packages/go/v3
Java dev.kreuzberg:html-to-markdown Maven / Gradle
C# KreuzbergDev.HtmlToMarkdown dotnet add package KreuzbergDev.HtmlToMarkdown
Elixir html_to_markdown mix deps.get html_to_markdown
R htmltomarkdown install.packages("htmltomarkdown")
C (FFI) releases Pre-built .so / .dll / .dylib

Part of Kreuzberg.dev

Contributing

Contributions welcome! See CONTRIBUTING.md for setup instructions and guidelines.

License

MIT License — see LICENSE for details.


All versions of html-to-markdown with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kreuzberg-dev/html-to-markdown contains the following files

Loading the files please wait ...