A php API documentation generator, fork of Sami

Overview

Doctum, a PHP API documentation generator. Fork of Sami

Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documentation.

Our badges

GitHub marketplace action Project code coverage by Codecov Project test suite

Installation

Caution!

Doctum requires PHP 7.2.20 or later.

Get Doctum as a phar file:

$ curl -O https://doctum.long-term.support/releases/latest/doctum.phar

You can also find some alternative phar versions:

  • major
  • major. minor (any version since 5.1)
  • major. minor. patch
  • latest
  • dev (not always up to date)
  • major-dev
  • major. minor-dev (most of the time it exists)
  • major. minor. patch-dev (sometimes it exists)
$ curl -O https://doctum.long-term.support/releases/${version}/doctum.phar && chmod +x doctum.phar

Check that everything worked as expected by executing the doctum.phar file without any arguments:

$ doctum.phar

Since 5.3.0 the phar does not require to use php keyword anymore because the shebang was added to the phar file. You can now call doctum.phar directly after adding execution rights onto the file.

You can use our GitHub marketplace action into your GitHub CI.

Configuration

Before generating documentation, you must create a configuration file. Here is the simplest possible one:

<?php

return new Doctum\Doctum('/path/to/yourlib/src');

The configuration file must return an instance of Doctum\Doctum and the first argument of the constructor is the path to the code you want to generate documentation for.

Actually, instead of a directory, you can use any valid PHP iterator (and for that matter any instance of the Symfony Finder class):

<?php

use Doctum\Doctum;
use Symfony\Component\Finder\Finder;

$iterator = Finder::create()
    ->files()
    ->name('*.php')
    ->exclude('Resources')
    ->exclude('Tests')
    ->in('/path/to/yourlib/src');

return new Doctum($iterator);

The Doctum constructor optionally takes an array of options as a second argument:

return new Doctum($iterator, [
    'theme'                => 'symfony',
    'title'                => 'yourlib API',
    'language'             => 'en', // Could be 'fr'
    'build_dir'            => __DIR__ . '/build',
    'cache_dir'            => __DIR__ . '/cache',
    'source_dir'           => '/path/to/repository/',
    'remote_repository'    => new GitHubRemoteRepository('username/repository', '/path/to/repository'),
    'default_opened_level' => 2,
]);

And here is how you can configure different versions:

<?php

use Doctum\Doctum;
use Doctum\RemoteRepository\GitHubRemoteRepository;
use Doctum\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;

$dir = '/path/to/yourlib/src';
$iterator = Finder::create()
    ->files()
    ->name('*.php')
    ->exclude('Resources')
    ->exclude('Tests')
    ->in($dir);

// generate documentation for all v2.0.* tags, the 2.0 branch, and the main one
$versions = GitVersionCollection::create($dir)
    ->addFromTags('v2.0.*')
    ->add('2.0', '2.0 branch')
    ->add('main', 'main branch');

return new Doctum($iterator, [
    'theme'                => 'symfony',
    'versions'             => $versions,
    'title'                => 'yourlib API',
    'language'             => 'en', // Could be 'fr'
    'build_dir'            => __DIR__ . '/../build/sf2/%version%',
    'cache_dir'            => __DIR__ . '/../cache/sf2/%version%',
    'source_dir'           => dirname($dir) . '/',
    'remote_repository'    => new GitHubRemoteRepository('yourorg/yourlib', dirname($dir)),
    'default_opened_level' => 2,
]);

And here is how you can configure a footer link below the Doctum link:

All footer_link keys are optional.

<?php

use Doctum\Doctum;
use Symfony\Component\Finder\Finder;

$dir = '/path/to/yourlib/src';
$iterator = Finder::create()
    ->files()
    ->name('*.php')
    ->exclude('Resources')
    ->exclude('Tests')
    ->in($dir);

return new Doctum($iterator, [
    'title'                => 'yourlib API',
    'source_dir'           => dirname($dir) . '/',
    'remote_repository'    => new GitHubRemoteRepository('yourorg/yourlib', dirname($dir)),
    'footer_link'          => [
        'href'        => 'https://github.com/code-lts/doctum',
        'rel'         => 'noreferrer noopener',
        'target'      => '_blank',
        'before_text' => 'You can edit the configuration',
        'link_text'   => 'on this', // Required if the href key is set
        'after_text'  => 'repository',
    ],
]);

To enable OpenSearch feature in your users browsers:

<?php

use Doctum\Doctum;
use Symfony\Component\Finder\Finder;

$dir = '/path/to/yourlib/src';
$iterator = Finder::create()
    ->files()
    ->name('*.php')
    ->exclude('Resources')
    ->exclude('Tests')
    ->in($dir);

return new Doctum($iterator, [
    'title'    => 'Project Api Documentation',
    // Necessary to enable the opensearch.xml file generation
    'base_url' => 'https://apidocs.company.tld/',
    // If you have a favicon
    // 'favicon' => 'https://company.tld/favicon.ico',
    // ... more configs
]);

You can find more configuration examples under the examples/ directory of the source code.

Doctum only documents the public API (public properties and methods); override the default configured filter to change this behavior:

<?php

use Doctum\Parser\Filter\TrueFilter;

$doctum = new Doctum(...);
// document all methods and properties
$doctum['filter'] = function () {
    return new TrueFilter();
};

Rendering

Now that we have a configuration file, let's generate the API documentation:

$ doctum.phar update /path/to/config.php

The generated documentation can be found under the configured build/ directory (note that the client side search engine does not work on Chrome due to JavaScript execution restriction, unless Chrome is started with the "--allow-file-access-from-files" option -- it works fine in Firefox).

By default, Doctum is configured to run in "incremental" mode. It means that when running the update command, Doctum only re-generates the files that needs to be updated based on what has changed in your code since the last execution.

Doctum also detects problems in your phpdoc and can tell you what you need to fix if you add the -v option:

$ doctum.phar update /path/to/config.php -v

Creating a Theme

If the default themes do not suit your needs, you can very easily create a new one, or just override an existing one.

A theme is just a directory with a manifest.yml file that describes the theme (this is a YAML file):

name:   symfony
parent: default

The above configuration creates a new symfony theme based on the default built-in theme. To override a template, just create a file with the same name as the original one. For instance, here is how you can extend the default class template to prefix the class name with "Class " in the class page title:

{# pages/class.twig #}

{% extends 'default/pages/class.twig' %}

{% block title %}Class {{ parent() }}{% endblock %}

If you are familiar with Twig, you will be able to very easily tweak every aspect of the templates as everything has been well isolated in named Twig blocks.

A theme can also add more templates and static files. Here is the manifest for the default theme:

name: default

static:
    'css/doctum.css': 'css/doctum.css'
    'css/bootstrap.min.css': 'css/bootstrap.min.css'
    'css/bootstrap-theme.min.css': 'css/bootstrap-theme.min.css'
    'fonts/doctum-font.css': 'fonts/doctum-font.css'
    'fonts/doctum.woff': 'fonts/doctum.woff'
    'fonts/doctum.woff2': 'fonts/doctum.woff2'
    'fonts/doctum.ttf': 'fonts/doctum.ttf'
    'fonts/doctum.svg': 'fonts/doctum.svg'
    'fonts/doctum.eot': 'fonts/doctum.eot'
    'js/jquery-3.5.1.slim.min.js': 'js/jquery-3.5.1.slim.min.js'
    'js/bootstrap.min.js': 'js/bootstrap.min.js'
    'js/typeahead.min.js': 'js/typeahead.min.js'

global:
    'index.twig':      'index.html'
    'doc-index.twig':  'doc-index.html'
    'namespaces.twig': 'namespaces.html'
    'classes.twig':    'classes.html'
    'interfaces.twig': 'interfaces.html'
    'traits.twig':     'traits.html'
    'opensearch.twig': 'opensearch.xml'
    'search.twig':     'search.html'
    'doctum.js.twig':    'doctum.js'

namespace:
    'namespace.twig': '%s.html'

class:
    'class.twig': '%s.html'

Files are contained into sections, depending on how Doctum needs to treat them:

  • static: Files are copied as is (for assets like images, stylesheets, or JavaScript files);
  • global: Templates that do not depend on the current class context;
  • namespace: Templates that should be generated for every namespace;
  • class: Templates that should be generated for every class.

Search Index

The autocomplete and search functionality of Doctum is provided through a search index that is generated based on the classes, namespaces, interfaces, and traits of a project. You can customize the search index by overriding the search_index_extra block of doctum.js.twig.

The search_index_extra allows you to extend the default theme and add more entries to the index. For example, some projects implement magic methods that are dynamically generated at runtime. You might wish to document these methods while generating API documentation and add them to the search index.

Each entry in the search index is a JavaScript object that contains the following keys:

type
The type associated with the entry. Built-in types are "Class", "Namespace", "Interface", "Trait". You can add additional types specific to an application, and the type information will appear next to the search result.
name
The name of the entry. This is the element in the index that is searchable (e.g., class name, namespace name, etc).
fromName
The parent of the element (if any). This can be used to provide context for the entry. For example, the fromName of a class would be the namespace of the class.
fromLink
The link to the parent of the entry (if any). This is used to link a child to a parent. For example, this would be a link from a class to the class namespace.
doc
A short text description of the entry.

One such example of when overriding the index is useful could be documenting dynamically generated API operations of a web service client. Here's a simple example that adds dynamically generated API operations for a web service client to the search index:

{% extends "default/doctum.js.twig" %}

{% block search_index_extra %}
    {% for operation in operations -%}
        {
            type: 'Operation'|trans,
            link: operation.path,
            name: operation.name,
            doc: operation.doc,
        }|json_encode|raw
    {%- endfor %}
{% endblock %}

This example assumes that the template has a variable operations available which contains an array of operations.

Note

Always include a trailing comma for each entry you add to the index. Doctum will take care of ensuring that trailing commas are handled properly.

Comments
  • PHAR fails when relative cache || build path is used

    PHAR fails when relative cache || build path is used

    With 5.2.1, the phar version fails to create directories within cache or build path, when relative cache/build paths are used in config. Here is an example run:

    ptomulik@barakus:$ php bin/doctum.phar update --force -vvv docs/doctum-relative.conf.php 
     Updating project 
    
    Version main
    -------------
    
    
    In Filesystem.php line 105:
                                                                
      [Symfony\Component\Filesystem\Exception\IOException]      
      Failed to create "docs/cache/html": mkdir(): File exists  
                                                                
    
    Exception trace:
      at phar:///tmp/test/bin/doctum.phar/vendor/symfony/filesystem/Filesystem.php:105
     Symfony\Component\Filesystem\Filesystem->mkdir() at phar:///tmp/test/bin/doctum.phar/src/Project.php:380
     Doctum\Project->flushDir() at phar:///tmp/test/bin/doctum.phar/src/Project.php:431
     Doctum\Project->prepareDir() at phar:///tmp/test/bin/doctum.phar/src/Project.php:374
     Doctum\Project->getCacheDir() at phar:///tmp/test/bin/doctum.phar/src/Store/JsonStore.php:76
     Doctum\Store\JsonStore->getStoreDir() at phar:///tmp/test/bin/doctum.phar/src/Store/JsonStore.php:64
     Doctum\Store\JsonStore->flushProject() at phar:///tmp/test/bin/doctum.phar/src/Project.php:464
     Doctum\Project->parseVersion() at phar:///tmp/test/bin/doctum.phar/src/Project.php:125
     Doctum\Project->update() at phar:///tmp/test/bin/doctum.phar/src/Console/Command/Command.php:183
     Doctum\Console\Command\Command->update() at phar:///tmp/test/bin/doctum.phar/src/Console/Command/UpdateCommand.php:54
     Doctum\Console\Command\UpdateCommand->execute() at phar:///tmp/test/bin/doctum.phar/vendor/symfony/console/Command/Command.php:255
     Symfony\Component\Console\Command\Command->run() at phar:///tmp/test/bin/doctum.phar/vendor/symfony/console/Application.php:1009
     Symfony\Component\Console\Application->doRunCommand() at phar:///tmp/test/bin/doctum.phar/vendor/symfony/console/Application.php:273
     Symfony\Component\Console\Application->doRun() at phar:///tmp/test/bin/doctum.phar/vendor/symfony/console/Application.php:149
     Symfony\Component\Console\Application->run() at phar:///tmp/test/bin/doctum.phar/bin/doctum-binary.php:26
     include() at /tmp/test/bin/doctum.phar:9
    
    update [--only-version ONLY-VERSION] [--force] [--output-format OUTPUT-FORMAT] [--no-progress] [--ignore-parse-errors] [--] <config>
    

    The problem does not appear with non-phar version. Absolute paths work well.

    I attach an archive containing a minimal example. The issue looks very strange and may be related to Symfony\Filesystem.

    test.tar.gz

    bug 
    opened by ptomulik 25
  • Fix - Not url encoding the version string used for navigation

    Fix - Not url encoding the version string used for navigation

    Me again!

    I've resolved the issues outlined in the prior PR #31;

    • signed the commits using the correct email
    • no longer made the unnecessary changes to the tests
    • used the url_encode twig filter rather than creating a property on the Version class

    Thanks for your input on the changes, and again for the great utility.

    Hope my Github naivety wasn't too frustrating :angel:

    bug 
    opened by mad-briller 13
  • Class property hints do not resolve aliases

    Class property hints do not resolve aliases

    Type aliases are not resolved for class properties. E.g. the following code snipet would not generate the expected some\namespace\someClass type hint in the docs:

    use some\namespace\someClass;
    class Foo {
    /** @var someClass */
    protected $someClass;
    }
    

    This seems to be the case for the current version of doctum as well. Would you consider this a bug or is this something doctum doesn't and will not support?

    bug 
    opened by CHItA 13
  • Add function section in Namespace

    Add function section in Namespace

    Create an independent function reflection to use in Namespace section. This is early work and some part (like internal reflection properties) need to be adjusted.

    Fixes #12 .

    enhancement 
    opened by Abdillah 13
  • Output everything as json

    Output everything as json

    Instead of html output I'd like to generate a json for each class and the navigation. Do you have any idea how I could achieve this?

    Thank you in advance for your help.

    question 
    opened by Wulfheart 10
  • PHP 8.0 compability

    PHP 8.0 compability

    Hey,

    I saw that doctum throws many deprecation when it is executed on PHP 8.0 like

    ERROR: 8192: Method ReflectionParameter::getClass() is deprecated in phar:///home/shyim/Code/opensearch-php/doctum.phar/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php line 241 on "OpenSearch\Client::$transport" in /home/shyim/Code/opensearch-php/util/../src/OpenSearch/Client.php:86

    I expect the library needs just to bump up reflection-docblock 🤔

    opened by shyim 9
  • Error: The ProgressBar is not started

    Error: The ProgressBar is not started

    On an already rendered project

    $ $(composer global config bin-dir --absolute --quiet)/doctum.php --no-interaction -vvv update ./test/doctum-config.php
     Updating project 
    
    Version master
    ---------------
    
    
    In SymfonyStyle.php line 417:
                                                              
      [Symfony\Component\Console\Exception\RuntimeException]  
      The ProgressBar is not started.                         
                                                              
    
    Exception trace:
      at /home/williamdes/.config/composer/vendor/symfony/console/Style/SymfonyStyle.php:417
     Symfony\Component\Console\Style\SymfonyStyle->getProgressBar() at /home/williamdes/.config/composer/vendor/symfony/console/Style/SymfonyStyle.php:321
     Symfony\Component\Console\Style\SymfonyStyle->progressFinish() at /home/williamdes/.config/composer/vendor/code-lts/cli-tools/src/ErrorsConsoleStyle.php:152
     CodeLts\CliTools\ErrorsConsoleStyle->progressFinish() at /home/williamdes/.config/composer/vendor/code-lts/cli-tools/src/Symfony/SymfonyStyle.php:116
     CodeLts\CliTools\Symfony\SymfonyStyle->progressFinish() at /home/williamdes/.config/composer/vendor/code-lts/doctum/src/Console/Command/Command.php:310
     Doctum\Console\Command\Command->endProgress() at /home/williamdes/.config/composer/vendor/code-lts/doctum/src/Console/Command/Command.php:281
     Doctum\Console\Command\Command->messageCallback() at n/a:n/a
     call_user_func() at /home/williamdes/.config/composer/vendor/code-lts/doctum/src/Project.php:474
     Doctum\Project->parseVersion() at /home/williamdes/.config/composer/vendor/code-lts/doctum/src/Project.php:125
     Doctum\Project->update() at /home/williamdes/.config/composer/vendor/code-lts/doctum/src/Console/Command/Command.php:183
     Doctum\Console\Command\Command->update() at /home/williamdes/.config/composer/vendor/code-lts/doctum/src/Console/Command/UpdateCommand.php:54
     Doctum\Console\Command\UpdateCommand->execute() at /home/williamdes/.config/composer/vendor/symfony/console/Command/Command.php:258
     Symfony\Component\Console\Command\Command->run() at /home/williamdes/.config/composer/vendor/symfony/console/Application.php:911
     Symfony\Component\Console\Application->doRunCommand() at /home/williamdes/.config/composer/vendor/symfony/console/Application.php:264
     Symfony\Component\Console\Application->doRun() at /home/williamdes/.config/composer/vendor/symfony/console/Application.php:140
     Symfony\Component\Console\Application->run() at /home/williamdes/.config/composer/vendor/code-lts/doctum/bin/doctum-binary.php:26
     require_once() at /home/williamdes/.config/composer/vendor/code-lts/doctum/bin/doctum.php:4
    
    
    bug 
    opened by williamdes 8
  • Release v5

    Release v5

    Version 5.0

    Version 5.0 will be released some day, soon I hope.

    The changelog is here: https://github.com/code-lts/doctum/blob/main/CHANGELOG.md#unreleased

    Links:

    • https://github.com/phpmyadmin/scripts/issues/27
    • https://github.com/phpmyadmin/phpmyadmin/issues/14644
    opened by williamdes 7
  • Fix composer warnings about PSR-4

    Fix composer warnings about PSR-4

    Class Doctum\Tests\Command\CommandHelpTest located in code-lts/doctum/tests/Console/CommandHelpTest.php does not comply with psr-4 autoloading standard. Skipping. Class Doctum\Tests\Command\CommandTest located in code-lts/doctum/tests/Console/CommandTest.php does not comply with psr-4 autoloading standard. Skipping. Class Doctum\Tests\Renderer\RendererTest located in code-lts/doctum/tests/Renderer/DiffTest.php does not comply with psr-4 autoloading standard. Skipping.

    opened by alecpl 6
  • Supporting the `@group` / `@category` tags

    Supporting the `@group` / `@category` tags

    We use the @group tag to indicate which groups a method belongs to, since @category was deprecated.

    Is this something you'd be open to support inside Doctum optionally, or should we use our own theme to display that tag?

    Either unofficial @group, or the old @category.

    enhancement 
    opened by tillkruss 5
  • Theming - Striping in left sidebar off-alignment with text

    Theming - Striping in left sidebar off-alignment with text

    Screenshot 2021-12-20 at 12-46-00 Namespaces Drupal Core API Explorer

    This is on Firefox. I actually don't see the striping at all on Chromium. It kinda-sorta appears when I'm using the element inspector (beyond the blue selection highlight) but not there at all when viewing as an end-user.

    I'm not amazing at CSS so I'm not sure the "right" way to do this? Something with :nth-child() is the first thing that comes to mind but nesting makes that complicated.

    bug 
    opened by bradjones1 5
  • How to create a custom theme?

    How to create a custom theme?

    Hello, after read the docs, i still don't get how to create my own custom theme. It is noticed that "a theme is just a directory with a manifest.yml". So i created a folder with a manifest.yml file in the documentRoot where doctum.phar and config.php is stored. When trying to build with doctum.phar update /path/to/config.php -v it outputs a message, that my custom theme could not found.

    My question is: Where do I have to put the theme folder to be recognized?

    Best, Rene

    bug documentation 
    opened by iseries 3
  • Parse iterable pseudo-type

    Parse iterable pseudo-type

    The PHP 7.1 iterable pseudo-type is currently resolved as a reference name in the current namespace instead of the pseudo-type.

    For example, in this sample, the documentation shows iterable as Acme\Foo\iterable:

    namespace Acme\Foo;
    
    public function update (iterable $iterable) : self {
        // ...
    }
    

    A link to https://www.php.net/manual/en/language.types.iterable.php would be nice instead.

    phpDocumentor docblock parser uses their TypeResolver library to parse it, and it seems to support it: https://github.com/phpDocumentor/TypeResolver/pull/80 (support for iterable<key type, value type>)

    bug enhancement 
    opened by dereckson 1
  • The @api doc block annotation

    The @api doc block annotation

    Hey there,

    Currently, Doctum responds to the @internal tag by adding a label to the structural element's documentation. This is great to help guide users away from methods that they should not be using, or that aren't covered by backwards compatibility promises

    However, the @api tag also exists: https://docs.phpdoc.org/guide/references/phpdoc/tags/api.html This tag is meant to do the opposite; guide a user to look at the public interface / backwards compatible ensured elements first.

    I think Doctum could handle the @api tag, and i propose a few things it could do when it detects it:

    • add a label similar to the internal one, that's green or some other positive color
    • sort @api elements to the top of their respective list, so they are seen first

    As always, thanks your time and input.

    enhancement 
    opened by mad-briller 2
  • Broken link to github source file - missing .

    Broken link to github source file - missing .

    I found Doctum while searching for an auto doc generator with Laravel in mind. I installed and and ran it on our existing app code. It already picked up comments and made a nice static site. So the doc generator seems to work great. So far so good...

    But when i try using the links to the github repo file, it wont work because the link is incorrect. It seems to miss the "." in the url.

    image

    Adding a "." before "php" will solve the issue and redirect to Github properly.

    In the doctum config i have added the most common values, as mentioned in the Doctum doc sample image

    Any ideas how to solve the missing . problem ?

    question 
    opened by myosotisgit 7
  • Dark mode theme

    Dark mode theme

    Hey there, me again!

    It would be great if Doctum supported a dark mode theme out of the box.

    Many modern documentation sites etc. ship with the ability for either the user to toggle the theme or for it to respect the user's preference using the prefers-color-scheme media query.

    Would this be difficult to achieve in Doctum by default? I looked into the css in use and it seems that the theme was generated using a bootstrap theme generation utility, it would be possible to generate an alternate theme that is dark and then swap these out at run-time, but you would lose the ability to use the media query provide the user with their preference.

    Another approach is to replace all color values with css variables and re-assigning those inside the media query:

    :root {
      --bg-primary: #fff;
     }
     
    @media (prefers-color-scheme: dark) {
      :root {
      --bg-primary: #000;
     }
    }
    

    This secondary approach would probably require a lot more work as it would require changing the theme generated by the external tool, and making everything a css variable, but it would provide the best user experience and require no javascript to modify classes or swap out script tags.

    Let me know if you have any thoughts, and thanks for your time.

    enhancement 
    opened by mad-briller 2
Releases(v5.5.1)
  • v5.5.1(Feb 17, 2022)

  • v5.5.0(Jan 9, 2022)

    Version 5.5.0

    • Fixed PHP errors when non configuration file was given, now it displays the error message
    • Adjust error handler for PHP 8.0 silenced errors
    • Fix PHP 8.1 errors on ArrayAccess methods signatures
    • Fix HTML markup missing close tag <a> on a function in the global namespace (#37)
    • Fix a PHP error when the @throws tag is invalid
    • Fix some texts that got escaped into <p> tags when it was not worth it
    • Do not print the error summary for frozen versions (ex: git tags) and add CLI --print-frozen-errors to reverse this change (#33)
    • Implement source line and remote links on functions of the global namespace (#38)
    • Internal: rename ClassTraverser to ProjectTraverser
    • Internal: add "file" and "relative_file" property on cached file for a function
    • Themes: all calls to the |desc(function) filter will now need to add |md_to_html filter to convert the Markdown output to HTML
    • Allow to search for non class functions on the search box and search page (#38)
    • Added more strings to translate and updated the French translation
    • Fixed the HTML node lang attribute according to the currently used language
    • Added a version selector for small displays not having the left sidebar (#41)
    • Fixed CSS striping in the left sidebar having some off-alignment with the text on some browsers (#42)
    • GitLabRemoteRepository class now uses the separator /-/ in source URLs, a new constructor parameter can change this back
    • AbstractRemoteRepository class now has types in the signatures
    • Filter out in a non case sensitive way the tags on GitVersionCollection class and document filtering on the README
    • Reduce the size of the tree, create a new class TreeNode and build the tree using JS code and not injected HTML code
    • Select the global namespace in the tree while viewing it
    • Disable "spellcheck", "autocorrect", "autocomplete" and "autocapitalize" on the search input
    • Completely refactor the search box to drop "typeahead.js" and replace it by "autocomplete.js" (#43)
    • Reduce the loading times by a lot by spliting out the search index into "doctum-search.json" and loading it only when needed (#43)
    • Fix missing namespaces in the global namespace for non namespace functions (#39)
    • Fixed URL encoding for versions (#32)

    ⚠️ Custom themes may need to add doctum-search.json in the manifest like the README examples show it

    Source code(tar.gz)
    Source code(zip)
    doctum.phar(3.99 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(78 bytes)
    doctum.phar.sha256.asc(833 bytes)
  • v5.4.1(Apr 21, 2021)

    Version 5.4.1

    • Fixed Search results descriptions render
    • Fixed PHP 8.0 usort does not want bool anymore on GitVersionCollection setups
    • Fixed CSS issues with method descriptions
    • Fixed phpdoc blocks render having <code> HTML tags
    • Fixed composer autoload warnings on PSR-4 classes
    • Adjusted .gitattributes to exclude useless files from composer bundles
    • Added tests on for the final composer package
    • Support {@link function}, {@link Class::function} or {@link https://example.com} syntax
    Source code(tar.gz)
    Source code(zip)
    doctum.phar(3.80 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(78 bytes)
    doctum.phar.sha256.asc(833 bytes)
  • v5.3.3(Apr 21, 2021)

    Version 5.3.3

    LTS release (PHP 7.1 only)

    • Fixed Search results descriptions render
    • Fixed PHP 8.0 usort does not want bool anymore on GitVersionCollection setups
    • Fixed CSS issues with method descriptions
    • Fixed phpdoc blocks render having <code> HTML tags
    • Fixed composer autoload warnings on PSR-4 classes
    • Adjusted .gitattributes to exclude useless files from composer bundles
    Source code(tar.gz)
    Source code(zip)
    doctum.phar(3.52 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(78 bytes)
    doctum.phar.sha256.asc(833 bytes)
  • v5.3.2(Apr 12, 2021)

    Version 5.3.2

    LTS release (PHP 7.1 only)

    • Disabled all other PHP versions for the 5.3.x series, only PHP 7.1 is allowed. Use Doctum 5.4 instead.
    • Fixed a bug that removed @return and @var descriptions since 5.3.0
    • Fix OpenSearch feature and documented the config
    • Fix favicon config and document an example config
    • Fixed global namespace handling
    • Fixed a resume after parse step missing data
    • Add more tests on render, parse and update CLIs
    • Remove old lib michelf/php-markdown and use erusev/parsedown to fix an HTML parsing bug
    • Add GitHub SECURITY and FUNDING configs
    • Support UnionType of PHP 8
    • Support namespace {//code} syntax for namespaces without a name
    Source code(tar.gz)
    Source code(zip)
    doctum.phar(6.68 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(78 bytes)
    doctum.phar.sha256.asc(833 bytes)
  • v5.4.0(Apr 10, 2021)

    Version 5.4.0

    Project related

    • Add GitHub SECURITY and FUNDING configs (you can sponsor me 😉 )
    • Added methods for functions to the StoreInterface class
    • Changed return body of readProject method of StoreInterface to also return functions

    Drop

    • Drop support for PHP 7.1
    • Require PHP 7.2.20
    • Enable support for PHP 8.0 on the PHAR
    • Drop support for phpdocumentor/reflection-docblock 4.3 series

    Features

    • Added detection for duplicated @var and @return tags
    • Added a "version" command to avoid having users parsing unsafe output
    • Added support for @mixin annotations on classes
    • Added support for @property-write and @property-read annotations on classes
    • Added support for @readonly annotations on methods and classes
    • Added support for @internal annotations on methods and classes
    • Added support for @deprecated annotations on properties
    • Added support for @since annotations on classes, methods, properties
    • Better support for @method annotations on classes, added static keyword support
    • Add support for @internal, @deprecated, @since on constants
    • Add support for @example on methods
    • Add support for @public, @private, @protected, @final, @access annotations
    • Added access handling on constants
    • Add Stringable PHP 8.0 class to internal PHP class list
    • Add WeakReference PHP 7.4 class to internal PHP class list
    • Support UnionType of PHP 8
    • Support namespace {//code} syntax for namespaces without a name
    • Remove old lib michelf/php-markdown and use erusev/parsedown to fix an HTML parsing bug

    Bug fixes

    • Fixed OpenSearch feature and documented the config
    • Fixed favicon config and documented the config
    • Resolve type aliases in docblocks (#23, PR: #24) thank you @CHItA for the fix
    • Fixed a bug that removed @return and @var descriptions since 5.3.0
    • Fixed invalid @see annotations parsing and rendering
    • Fixed global namespace handling
    • Fix some resume after parse step missing data
    • Add more tests on render, parse and update CLIs

    Library upgrades

    • Upgrade Twig to ^3.0
    • Upgrade code-lts/cli-tools to ^1.4
    • Upgrade wdes/php-i18n-l10n to ^4.0
    Source code(tar.gz)
    Source code(zip)
    doctum.phar(3.80 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(78 bytes)
    doctum.phar.sha256.asc(833 bytes)
  • v5.3.1(Dec 30, 2020)

  • v5.3.0(Dec 20, 2020)

    Version 5.3.0

    • Added: A shebang to all the new PHARs distributed
    • Added: Support for a custom footer_link configuration
    • Fixed: Error: The ProgressBar is not started (#19)
    • Fixed: "3" @param tags are expected but only "4" found (#21)
    • Reworked the @param tag error detection and added new error messages
    • For custom implementations
      • Added: NodeVisitor::getPropertyReflectionFromParserProperty
      • Added: Renderer::getVariablesFromClassReflection
    Source code(tar.gz)
    Source code(zip)
    doctum.phar(3.55 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(78 bytes)
    doctum.phar.sha256.asc(833 bytes)
  • v5.2.1(Nov 30, 2020)

  • v5.2.0(Nov 29, 2020)

    Version 5.2.0

    • Support custom composer vendor autoload files using the ENV DOCTUM_COMPOSER_AUTOLOAD_FILE
    • Add function reflection & doc section in Namespace (#12)
    • Refactor and improve the progress bar
    • Add CLI --output-format option that supports a lot of formats: raw, rawtext, table, checkstyle, json, junit, prettyJson, gitlab, github, teamcity
    • Add CLI --no-progress to disable progress bars but keep output
    • Fixed --no-ansi not displaying text
    • RENDER_PROGRESS callback takes $this->step, $this->steps instead of $this->getProgression() for users hacking the tool
    • PARSE_CLASS callback uses $this->step, $this->steps instead of the calculated progression
    • Most error reports are sent to stderr now, you can use --no-progress --output-format=checkstyle 2> checkstyle.xml
    • Add new dependency code-lts/cli-tools
    Source code(tar.gz)
    Source code(zip)
    doctum.phar(3.55 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(78 bytes)
    doctum.phar.sha256.asc(833 bytes)
  • v5.1.0(Aug 29, 2020)

  • v5.0.2(Aug 15, 2020)

  • v5.0.0(Jul 18, 2020)

    Version 5.0.0

    • Forked the project
    • Removed all GIT tags
    • Migrated from TravisCI to GitHub actions
    • Improved README
    • Improved CHANGELOG
    • Moved tests to tests directory
    • Removed symfony/phpunit-bridge in favor of phpunit/phpunit
    • Removed blackfire testing
    • Updated composer.json
    • Move source files to src directory
    • Rename Sami to Doctum
    • Move the binary to bin/doctum.php
    • Add phpstan
    • Fix some issues reported by phpstan
    • Upgrade nikic/php-parser from ~3.0 to ~4.5
    • Upgrade twig/twig from ~2.0 to ~2.12
    • Apply some coding standard rules on the code-base
    • Add PHP constants visibility
    • Drop simulate_namespaces config option
    • #7 - Translate Doctum, thank you @Guileas
    • Support 'language' in the configuration block, available languages are ('fr' and 'en') for now, default 'en'.
    • #6 - Upgrade phpdocumentor/reflection-docblock from ~2.0 to ~5.1
    • Clean the .css .js vendor files
    • Re-build the font using https://fontello.com/
    • #4 - build a release process and phar bundling
    Source code(tar.gz)
    Source code(zip)
    doctum.phar(3.73 MB)
    doctum.phar.asc(833 bytes)
    doctum.phar.sha256(86 bytes)
    doctum.phar.sha256.asc(833 bytes)
Owner
Code LTS
Long term support for existing code
Code LTS
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io - Deprecation Notice This repository is deprecated! Daux.io has been moved to an organization, to guarantee future development and support. So

Justin Walsh 4.6k Dec 16, 2022
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io Daux.io is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It help

Daux.io 719 Jan 1, 2023
An API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

null 2k Dec 17, 2022
Documentation Generator for PHP

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Dec 28, 2022
Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)

phpDox phpDox is a documentation generator for PHP projects. This includes, but is not limited to, API documentation. The main focus is on enriching t

Arne Blankerts 588 Dec 22, 2022
Documentation Generator for WordPress.

Pronamic WordPress Documentor is a tool to automatically extract data about the actions and filters of your WordPress theme or plugin.

Pronamic 36 Dec 8, 2022
phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to generate a complete set of API Documentation

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Jan 3, 2023
Generates documentation for your REST API from annotations

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Nelmio 2.1k Jan 6, 2023
Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations

Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations

Robert Allen 4.6k Jan 6, 2023
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Dec 22, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Apr 20, 2021
Generate Sphinx/ReStructured documentation from PHPDoc

PHP-phpdoc-to-rst Forked from Francesco "Abbadon1334" Danti by AeonDigital. In this fork the changes has only visual and superficial effects [ just be

Rianna Cantarelli 0 Nov 16, 2021
Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API

Luracast Restler ![Gitter](https://badges.gitter.im/Join Chat.svg) Version 3.0 Release Candidate 5 Restler is a simple and effective multi-format Web

Luracast 1.4k Jan 2, 2023
A PHP framework foucs on API fast development.接口,从简单开始!PhalApi简称π框架,一个轻量级PHP开源接口框架,专注于接口服务开发。

PhalApi开源接口框架 / PhalApi API Framework 读音:派框架 Stargazers over time 开发文档 / Documents 专为PHPer准备的优雅而详细的开发文档,请看:PhalApi 2.x 开发文档。 PhalApi 2.x English Docs.

dogstar 1.5k Dec 30, 2022
Yii2 Annotations Generate API Document Extension

Generate online api document by code annotation for yii2 easily

Trevor 16 Dec 15, 2021
Learn how to implement the most important Design Patterns into your PHP application, uses PHP 8.1

Learn how to implement the most important Design Patterns into your PHP application. This project uses PHP 8.1. it has examples for each Pattern and an Article explaining how to use them step by step, their advantages, and disadvantages.

Gabriel Anhaia 203 Dec 15, 2022
Industrial-strength annotations for PHP

php-annotations Source-code annotations for PHP. Copyright (C) 2011-2015 Rasmus Schultz [email protected] https://github.com/php-annotations/php-anno

php-annotations 138 Dec 29, 2022
30 seconds of code Short PHP code snippets for all your development needs

30 seconds of code Short PHP code snippets for all your development needs Visit our website to view our snippet collection. Use the Search page to fin

30 seconds of code 2.5k Jan 1, 2023
Source Code for 'PHP 8 Solutions' by David Powers

Apress Source Code This repository accompanies PHP 8 Solutions by David Powers (Apress, 2022). Download the files as a zip using the green button, or

Apress 8 Oct 27, 2022