PHPackages                             kunoichi/toc-generator - 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. kunoichi/toc-generator

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

kunoichi/toc-generator
======================

TOC generator from h1-h6 tags.

1.0.3(1y ago)010.2k11GPL-3.0-or-laterPHPPHP &gt;=7.0

Since Sep 2Pushed 1y agoCompare

[ Source](https://github.com/kuno1/toc-generator)[ Packagist](https://packagist.org/packages/kunoichi/toc-generator)[ RSS](/packages/kunoichi-toc-generator/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (4)Versions (8)Used By (1)

toc-generator
=============

[](#toc-generator)

Generate table of contents from h1-h6 tags.

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

[](#installation)

Run composer.

```
comopser require kunoichi/toc-generator
```

And include autoloader.

```
require __DIR__ . '/vendor/autoload.php';
```

Usage
-----

[](#usage)

### PHP

[](#php)

W.I.P

### WordPress

[](#wordpress)

In your `functions.php`

```
// Register TOC.
// If you have theme option for it,
// detect conditions.
add_action( 'init', function() {
   	$parser = new Kunoichi\TocGenerator\WpParser();
	$parser->set_title( __( 'Table of Contents', 'your-theme' ) );
} );
```

And render TOC where you want(e.g. In your `singular.php`). You need `$post_id` to render TOC. In this case, `get_queried_object_id()` is used.

```
Kunoichi\TocGenerator\WpParser::render( get_queried_object_id() );
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance40

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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

Every ~398 days

Recently: every ~431 days

Total

6

Last Release

505d ago

Major Versions

0.8.1 → 1.0.02023-08-21

PHP version history (2 changes)0.8.0PHP ^5.6|^7.0

1.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/84587?v=4)[Takahashi Fumiki](/maintainers/fumikito)[@fumikito](https://github.com/fumikito)

---

Top Contributors

[![fumikito](https://avatars.githubusercontent.com/u/84587?v=4)](https://github.com/fumikito "fumikito (16 commits)")[![ko31](https://avatars.githubusercontent.com/u/84167?v=4)](https://github.com/ko31 "ko31 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kunoichi-toc-generator/health.svg)

```
[![Health](https://phpackages.com/badges/kunoichi-toc-generator/health.svg)](https://phpackages.com/packages/kunoichi-toc-generator)
```

###  Alternatives

[roundcube/roundcubemail

The Roundcube Webmail suite

7.1k2.4k3](/packages/roundcube-roundcubemail)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[silverstripe/framework

The SilverStripe framework

7313.7M2.8k](/packages/silverstripe-framework)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[lullabot/amp

A set of useful classes and utilities to convert html to AMP html (See https://www.ampproject.org/)

3793.0M10](/packages/lullabot-amp)[code16/sharp

Laravel Content Management Framework

79164.7k8](/packages/code16-sharp)

PHPackages © 2026

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