PHPackages                             vannghia/make\_table\_of\_content - 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. vannghia/make\_table\_of\_content

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

vannghia/make\_table\_of\_content
=================================

Make table of content (TOC) from content of document

v1.0.0(2y ago)03PHP

Since Feb 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/vn0202/make_table_of_content)[ Packagist](https://packagist.org/packages/vannghia/make_table_of_content)[ RSS](/packages/vannghia-make-table-of-content/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

Make Table Of Content.
======================

[](#make-table-of-content)

Create a Table Of Content from H1-&gt;H6 tag in HTML string

This package provide a simple way to build a Table-Of-Contents from HTML markups. Assume you are create post or article, this package provide you a generator that help you build a Table Of Content automatically.

Install
-------

[](#install)

```
composer require vannghia/make_table_of_content
```

Usage
-----

[](#usage)

This package have one class with 2 method:

- One for make menu( return under array ).
- Other for generate HTML Table Of Content from above menu.

Assume you have post content() stored in database. You can retrieve database to get post's content and assign it to $html like this :

```
$contents = This is heading 2

                    This is heading 3
                    This is heading 3

                            This is heading 4
                            This is heading 4

                    This is heading 2
                    This is heading 2

```

In blade, You can use like this :

```

    @php
    if(!empty($contents))
    $tableOfContent = GenerateTOC::generateTableFromContent($contents) ?: [];
    @endphp
    @if($tableOfContent)
           {!! $tableOfContent !!}
    @endif

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

860d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9fe0e895add90028fc46c12628cf37ecd7bd62ace5a412516cc6f55972ed8bc?d=identicon)[hellangelnd](/maintainers/hellangelnd)

---

Top Contributors

[![vn0202](https://avatars.githubusercontent.com/u/94747520?v=4)](https://github.com/vn0202 "vn0202 (7 commits)")

### Embed Badge

![Health badge](/badges/vannghia-make-table-of-content/health.svg)

```
[![Health](https://phpackages.com/badges/vannghia-make-table-of-content/health.svg)](https://phpackages.com/packages/vannghia-make-table-of-content)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[spatie/crawler

Crawl all internal links found on a website

2.8k18.5M67](/packages/spatie-crawler)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49617.1k](/packages/blackfire-player)[drupal/drupal-extension

Drupal extension for Behat

22215.7M173](/packages/drupal-drupal-extension)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M344](/packages/drupal-core-dev)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
