PHPackages                             mathsgod/markdown-splitter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mathsgod/markdown-splitter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mathsgod/markdown-splitter
==========================

A Markdown splitter that divides content based on heading levels.

1.0.0(1y ago)03MITPHPPHP ^7.4 || ^8.0

Since Apr 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mathsgod/markdown-splitter)[ Packagist](https://packagist.org/packages/mathsgod/markdown-splitter)[ RSS](/packages/mathsgod-markdown-splitter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Markdown Splitter
=================

[](#markdown-splitter)

This project is a Markdown splitter that divides Markdown content based on different heading levels. It provides functionality to output the split sections for easier management and navigation of Markdown documents.

Project Structure
-----------------

[](#project-structure)

```
markdown-splitter
├── src
│   ├── MarkdownSplitter.php        # Handles the logic for splitting Markdown files based on heading levels.
│   └── utils
│       └── markdown_helper.php  # Contains helper functions for processing Markdown text.
├── index.php               # Entry point of the application, receives input Markdown text and calls splitter functions.
├── composer.json           # Composer configuration file listing project dependencies and autoload settings.
└── README.md               # Documentation for the project, explaining how to use the Markdown splitter and its features.

```

Installation
------------

[](#installation)

To install the project, clone the repository and run the following command to install the dependencies:

```
composer install

```

Usage
-----

[](#usage)

### Using the MarkdownSplitter class in your code

[](#using-the-markdownsplitter-class-in-your-code)

You can use the `MarkdownSplitter` class directly in your PHP code to split Markdown content by heading levels. Example:

```
require_once 'src/MarkdownSplitter.php';

$markdownContent =
