Download the PHP package benbjurstrom/markdown-object without Composer

On this page you can find all versions of the php package benbjurstrom/markdown-object. 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 markdown-object

Markdown Object

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status GitHub PHPStan Action Status Total Downloads

Intelligent Markdown chunking that preserves document structure and semantic relationships. Creates token-aware chunks optimized for embedding model context windows. Built on League CommonMark and Yethee\Tiktoken.

Try It Out

Clone the Interactive Demo to experiment with chunking in real-time. Paste your Markdown, adjust parameters, and see how content gets split into semantic chunks.

markdown-object-demo

Basic Usage

Installation

You can install the package via composer:

Advanced Usage

JSON Serialization

Custom Tokenizer

Custom Chunking Parameters

A note on Token Counts

Chunk token counts include separator tokens (\n\n) added when joining content pieces, so they may be slightly higher than the sum of individual node tokens. This is expected and ensures the count accurately reflects what will be embedded.

Chunking Strategy

The package uses hierarchical greedy packing to create semantically coherent chunks that respect your document's natural structure.

Algorithm Overview

The chunker intelligently splits content using a two-threshold system:

How It Works

  1. Start whole – If the entire document fits within hardCap, return as a single chunk
  2. Split hierarchically – When too large, split at the highest heading level (H1, then H2, etc.)
  3. Pack greedily – Combine sibling sections that fit together within hardCap
  4. Recurse deeply – Sections that don't fit are processed recursively with updated breadcrumbs
  5. Minimize fragments – After recursion, continue packing remaining siblings to avoid orphaned content
  6. Split smartly – Long paragraphs, code blocks, and tables break at target boundaries while preserving readability

Testing

Run the tests with:

Documentation

For detailed architecture documentation, see ARCHITECTURE.md.

For examples of hierarchical packing behavior, see EXAMPLES.md.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of markdown-object with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
league/commonmark Version ^2.7
yethee/tiktoken Version ^0.11.1
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 benbjurstrom/markdown-object contains the following files

Loading the files please wait ...