Git Product home page Git Product logo

minidoc's Introduction

Minidoc

Установка

$ composer require --dev kosuha606/minidoc

Quick Start

Инструмент для быстрого сбора документации из аннтоаций классов в проекте.

Пример вывода документации:

<?php
echo (new DocsBuilder())
    ->addParseParam('category')
    ->addParseParam('description')
    ->addParseParam('version')
    ->addClassRegexp('/classes/')
    ->addPreloadClassesDir(__DIR__.'/classes')
    ->buildTemplate()
;

Пример работы

alt text

Настройка

Добавить стили или скритпы в шаблон:

$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');

Change log

1.0.13 (2020-04-14)

  • Фикс ошибки сброса кэша

1.0.12 (2020-04-14)

  • Фикс метода setCacheFile

1.0.11 (2020-04-14)

  • Добавил парсинг анотаций методов

1.0.10 (2020-04-14)

  • Поправил привязку к внешним пакетам composer

1.0.9 (2020-04-11)

  • Добавлена интернационализация
  • Добавлено кэширование и возможность сброса кэша

minidoc's People

Contributors

kosuha606 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.