PHPackages                             mogita/docbuilder - 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. mogita/docbuilder

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

mogita/docbuilder
=================

Tool for making config files for documentations generators like MkDocs and build the docs.

0.0.4(9y ago)087MITPHPPHP &gt;=5.4.0

Since Oct 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mogita/docbuilder)[ Packagist](https://packagist.org/packages/mogita/docbuilder)[ Docs](http://github.com/mogita/docbuilder)[ RSS](/packages/mogita-docbuilder/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

DocBuilder
==========

[](#docbuilder)

Tool for making config files for documentation or static site generators like [MkDocs](http://www.mkdocs.org/) and help generate the docs from your PHP web apps.

> Current version is in alpha stage, and only supports MkDocs (presuming you have it installed already).

**Requirements:**

- PHP version &gt;= 5.5.9
- Appropriate docs generator programmes installed in the same system that runs this tool, e.g. [MkDocs](http://www.mkdocs.org/).

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

[](#installation)

Use [Composer](https://getcomposer.org) to install:

```
composer require mogita/docbuilder
```

Usage
-----

[](#usage)

You'll need to prepare all the markdown files before building a Doc. DocBuilder will later support generating markdown files from the data source you provide.

Follow either of these two ways to make configs and build the Docs.

### By passing in a config definition

[](#by-passing-in-a-config-definition)

```
use Mogita\DocBuilder\MkDocs;

$options = [
    'site_name' => 'A New Docs Site',
    'pages' => [
        ['Home' => 'index.md'],
        ['About' => 'about.md'],
        ['API Docs' => [
            ['User' => 'user.md'],
            ['Data' => 'data.md']
        ]]
    ],
    'extra' => [
        'i18n' => [
            'prev' => '前一页',
            'next' => '后一页'
        ]
    ],
    'theme' => 'material'
];

$mkdocs = new MkDocs(getcwd() . '/docs', $options);

$res = $mkdocs->build();

if ($res === true) {
    echo 'Success!';
}
else {
    var_dump($res);
}
```

### By using the step-by-step setter methods

[](#by-using-the-step-by-step-setter-methods)

```
use Mogita\DocBuilder\MkDocs;

$mkdocs = new MkDocs(getcwd() . '/docs');

$mkdocs->setHeaderLink('http://www.example.com');
$mkdocs->setSiteName('Title new');
$mkdocs->setTheme('material'); // You'll have to install the specific themes to your system first

$mkdocs->addPage('Home', 'index.md');
$mkdocs->addPage('About', 'about.md');

$mkdocs->addPage('API Docs', []); // this creates a secondary level, so that you can add pages to this level
$mkdocs->addPage('User', 'user.md', 'API Docs');
$mkdocs->addPage('Data', 'data.md', 'API Docs');

$mkdocs->setPrev('前一页');
$mkdocs->setNext('后一页');
$mkdocs->setPrimaryColor('purple');
$mkdocs->setAccentColor('teal');

$res = $mkdocs->build();

if ($res === true) {
    echo 'Success!';
}
else {
    var_dump($res);
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/mogita/docbuilder/blob/master/LICENSE) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community1

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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 ~0 days

Total

4

Last Release

3487d ago

### Community

### Embed Badge

![Health badge](/badges/mogita-docbuilder/health.svg)

```
[![Health](https://phpackages.com/badges/mogita-docbuilder/health.svg)](https://phpackages.com/packages/mogita-docbuilder)
```

PHPackages © 2026

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