barnythorpe/clarify

A CLI command for your PHP projects to convert PHPDoc into MarkDown based documentation.

Maintainers

👁 barnythorpe

Package info

github.com/Barny-Thorpe/clarify

pkg:composer/barnythorpe/clarify

Statistics

Installs: 14

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 3

0.1.0 2025-04-16 11:01 UTC

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 1deab282f9f10ed55535aa7ca3b3c3a693d0e162

  • Barny-Thorpe <bmcthorpe.woop@gmail.com>

This package is auto-updated.

Last update: 2026-06-16 13:44:23 UTC


README

 ________ ___ ________ ________ ___ ________ ___ ___ 
 |\ ____\|\ \ |\ __ \|\ __ \|\ \|\ _____\\ \ / /|
 \ \ \___|\ \ \ \ \ \|\ \ \ \|\ \ \ \ \ \__/\ \ \/ / /
 \ \ \ \ \ \ \ \ __ \ \ _ _\ \ \ \ __\\ \ / / 
 \ \ \____\ \ \____\ \ \ \ \ \ \\ \\ \ \ \ \_| \/ / / 
 \ \_______\ \_______\ \__\ \__\ \__\\ _\\ \__\ \__\__/ / / 
 \|_______|\|_______|\|__|\|__|\|__|\|__|\|__|\|__|\___/ / 
 \|___|/ 

Convert PHPDoc comments into structured Markdown documentation with ease.

About

This project provides a PHP-based documentation generator that extracts PHPDoc comments from your code and converts them into Markdown files. Using a flexible configuration system, it allows you to customize the output structure with a comprehensible fluent interface.

🔧 Installation

1️⃣ Install via Composer:

composer require --dev barnythorpe/clarify

2️⃣ Run the Documentation Generator:

./vendor/bin/clarify build --config=clarify.config.php

or add to your composer.json as a script like so:

"scripts": {
 "doc": "clarify"
},

and run:

composer doc

🛠 Configuration Example

Create a config file clarify.config.php:

<?php
use Barnythorpe\clarify\DocBuilder;
use Barnythorpe\clarify\OutputStrategies\MarkdownStrategy;

return DocBuilder::make()
 ->setOutputStrategy(new MarkdownStrategy())
 ->startPage('docs/api.md'))
 ->addHeading('API Documentation', 1)
 ->addParagraph('This is an example doc.')
 ->addFile('src/Example.php')
 ->endPage();