Build Status Scrutinizer Code Quality Latest Stable Version License Total Downloads Gitter


Api documentation generator (JSON-RPC / REST)

(No matter whether you're using REST or JSON-RPC or some other api architecture/scheme)


There is an example documentation directory: demo, as you can see above. Generated example documentation:

Extended Markdown syntax

#include <>


$variable = <value>

$uuid = 123e4567-e89b-12d3-a456-426655440000

Inline variable usage

User uuid is {$uuid}

$$blockVariable ... $$

	"jsonrpc": "2.0",
	"result": {},
	"id": null

Block variable usage

Server returns response:


@ <sectionName>:<>

High-level section definition. This macro available only in file.

@ About

@@ <sectionName>:<>

Method section definition. This macro available only in file.

@@ user.login:methods/
@@ user.logout:methods/
@@ user.register:methods/
@@ user.confirm-registration:methods/

[File link](foo/bar/data.json)

File link will create a link to file (foo/bar/data.json). The file will be copied to documentation output directory for safety reasons.

[File link](foo/bar/data.json)
[Project root directory file link](../app/schema/user.json)

How to use anabelle

~ $ cd myApi
~/myApi $ composer require ublaboo/anabelle
~/myApi $ vendor/bin/anabelle docs-src docs

CLI options

Automatically overwrite output directory

vendor/bin/anabelle docs-src docs -o
// Or
vendor/bin/anabelle docs-src docs --overwriteOutputDir

Add http auth to generated files

Beware! Anabelle generates by default .html files. If you are using http auth, it generates .php files due to the need of validating http auth headers.

vendor/bin/anabelle docs-src docs -u user -p pass
// Or
vendor/bin/anabelle docs-src docs --httpAuthUser user -httpAuthPass pass

Generator workflow

  1. Most important (and only required) file is In this file, you can use only (different Markdown markup is ignored in
    • # <h1>
    • ## <h2>
    • #include <>
    • $variable = <value>
    • $$blockVariable ... $$
    • @ <sectionName>:<>
    • @@ <sectionName>:<>)
  2. #include macros are replaced
  3. <h1> is used as documentation page title (only the first found one is used)
  4. <h2> can be used wherever you want in the sidebar
  5. @ and @@ sections are rendered in the sidebar nav
  6. Content of @ and @@ sections is rendered into separate files and loaded into the main section detail after clicking particular section link in the nav
  • v2.2.0 v2.2.0

    Bump! 🏋️‍♂️

    Diff: v2.1.0...v2.2.0

    • layout.js: setting element data-section attribute on section change
  • v2.1.0 v2.1.0

    Bump! 🧶

    Diff: v2.0.0...v2.1.0

    • Added cli option --addCss to include another css file into docs output
  • v2.0.1 v2.0.1

  • v2.0.0 v2.0.0

    • Nette 3.0
  • v1.6.0 v1.6.0


    • When key "F" is pressed, focus to search input
  • v1.5.0 v1.5.0


    • Added static search for method section names
  • v1.4.1 v1.4.1

    • left menu made scrollable
  • v1.4.0 v1.4.0

    • Added "## / h2" option to
  • v1.3.0 v1.3.0

    • composer.json: require symfony console v3 | v4
  • v1.2.0 v1.2.0

    • Added ability to use inline + block macros in block macros and inline macros in inline macros (both to max depth of 3)
  • v1.1.20 v1.1.20

    • MacroBlockVariable made non-greedy
  • v1.1.19 v1.1.19

    • MacroBlockVariableOutput: added automatic identation
  • v1.1.17 v1.1.17

    • Added styles for table
  • v1.1.13 v1.1.13

    • Added new macro (MacroInlineFileLink) to link external files to documentations output directory
  • v1.1.12 v1.1.12

    • FIxed php 7.2 compatibility
  • v1.1.11 Version 1.1.11

    • add support to include files of every type (e. g. json)

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette