$ composer require --dev kosuha606/minidoc
Инструмент для быстрого сбора документации из аннтоаций классов в проекте.
Пример вывода документации:
<?php
echo (new DocsBuilder())
->addParseParam('category')
->addParseParam('description')
->addParseParam('version')
->addClassRegexp('/classes/')
->addPreloadClassesDir(__DIR__.'/classes')
->buildTemplate()
;
Добавить стили или скритпы в шаблон:
$docsBuilder->addStyle(new ResourceDTO(__DIR__.'/resources/style.css', ResourceDTO::TYPE_FILE));
$docsBuilder->addScript(new ResourceDTO(__DIR__.'/resources/script.js', ResourceDTO::TYPE_FILE));
Отрендерить свой шаблон документации:
$docsBuilder->setViewTemplate(__DIR__.'/views/main.php');
Добавтиь свои параметры для парсинга в аннотациях:
$docsBuilder->setParseParams(['category', 'description']);
$docsBuilder->addParseParam('mark');
Настроить предзагрузку классов путем передачи пути к директории с классами:
$docsBuilder->addPreloadClassesDir(__DIR__.'/../../../../contexts');
Обработать данные после их построения
$docBuilder->afterBuildData(function() {});
Установить регулярное выражение для выбора файлов из указанной директории
$docBuilder->setFilesRegexp();
Выбрать язык вывода или указать свой языковой файл
$docBuilder->setLanguage('ru');
// Или указать свой массив переводов
$docBuilder->setTranslations(require_once __DIR__.'/ch.php');
- Фикс ошибки сброса кэша
- Фикс метода setCacheFile
- Добавил парсинг анотаций методов
- Поправил привязку к внешним пакетам composer
- Добавлена интернационализация
- Добавлено кэширование и возможность сброса кэша