Download the PHP package hoa/kitab without Composer

On this page you can find all versions of the php package hoa/kitab. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kitab


Build status Packagist License

Kitab is the ideal companion for Documentation-Driven Quality for PHP programs.

Made with ❤️ by Hoa

The goal of Kitab is twofold, render and test the documentation:

  1. Generate a quality and searchable documentation based on your code. The documentation inside your code is compiled into static HTML files with a powerful static search engine,

  2. Test the documentation itself. Indeed, a documentation contains examples, and these examples are compiled into test suites that are run directly to ensure the examples are still up-to-date and working.

Kitab (كتاب) means “book” in Arabic. It should pronounced /kitaːb/.

Static documentation

Kitab is able to compile the documentation inside your code into static HTML files. A carefully crafted design is provided to ensure a great look for your documentation. This is possible to customize the logo, the project name, etc.

A static search engine is compiled specifically for your documentation. It contains all the modern features we can expect from a search engine, like tokenizing, stemming, stop word filtering, term frequency-inverse document frequency (TF-ID), inverted index etc. The search engine database is pre-computed and optimized to load as fast as possible.

The more your documentation provides details and smart vocabulary, the more the search engine will be able to provide relevant results.

The following command line compiles the documentation from your code in src into HTML files stored in doc:

The --with-composer option asks Kitab to use Composer for PSR-4 mapping definitions. This is useful to map README.md files to namespace directories, more below. The --open option opens the documentation in your default browser as soon as it is generated successfully.

DocTest

Documentation test suites, aka DocTest, are generated based on the examples present in your documentation. Examples are compiled into test suites and executed on-the-fly. A cache is generated to avoid to re-compile examples into test suites each time.

For instance, the following example will succeed:

php

The following command line generates and executes the documentation test suites from the src directory:

Behind the scene, Kitab uses the atoum test framework.

Dependencies

Kitab requires PHP and NodeJS to be installed: PHP because this is a PHP program, and NodeJS to pre-compile the static search engine (which is written in Elm).

Standards and formats

Kitab expects documentation in your PHP code to be written in CommonMark (a standard variant of Markdown). It can be mixed with HTML.

Each block of documentation can declare sections, and any kind of CommonMark elements, like:

php

There are only 2 special section names: Examples, and Exceptions. Use them to introduce one or more examples, and exceptions explanations. This is a common standard used by many other tools.

Any kind of entities can be documented: Classes, interfaces, traits, class attributes, constants, methods, and functions.

Namespaces cannot be documented directly from the code, because of the way they are declared (entities are declared inside a namespace; the namespace is not declared as is). However, they can be documented through special files, named README.md. If your code follows the PSR-4 specification, then run Kitab with the --with-composer option to specify the location of the composer.json file of your project in order to allow Kitab to automatically find PSR-4 mappings. These mappings are necessary to transform a namespace into a path to a directory. For each directory representing a namespace, if a README.md file exists, then it will be used as the documentation of this particular namespace. For instance, Kitab\ maps to src/, so the documentation for the Kitab\Compiler namespace is expected to be find in the src/Compiler/README.md file, that simple. This is pretty straightforward at usage.

Entity and namespace documentations are inserted at the top of their respective documentation page. This is the introduction. The rest of the page contains information about the entity or the namespace.

Block of codes

Documentation can contain block of codes. This is possible to specify the type of the block with this standard notation:

where type can be php, http, sh, html, css etc.

The type has 2 impacts:

  1. It specifies the syntax highlighting when rendering the documentation in HTML,
  2. It is an identifier for a potential code block handler. A code block handler is responsible to compile a code block content into a valid test.

Indeed, all code blocks inside the Examples and Exceptions Sections can be compiled into test suites with the ./bin/kitab test command. For instance, with the php code block type, one can specify the expectation of the test case:

Consequently, the following example will be a success:

Extensible

It is possible to write specific code block handlers. It means that you can write extensions to Kitab to compile your documentation into specific tests. To learn more, check the Kitab\Compiler\Target\DocTest\CodeBlockHandler\Definition interface and implementations.

Configurations

It is possible to configure Kitab with external PHP files. The file names are free, but we recommend the following:

Both files must respectively return an instance of the Kitab\Compiler\Target\Html\Configuration and Kitab\Compiler\Target\DocTest\Configuration classes.

The following example illustrates a common .kitab.target.html.php file:

The following example illustrates a common .kitab.target.doctest.php file:

Both commands kitab compile and kitab test accept an option named --configuration-file to use a particular configuration file for the defaults, e.g.:


All versions of kitab with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
atoum/atoum Version ~3.2
hoa/console Version ~3.0
hoa/dispatcher Version ~1.0
hoa/exception Version ~1.0
hoa/file Version ~1.0, >=1.17.07.11
hoa/protocol Version ~1.0
hoa/router Version ~3.0
hoa/view Version ~3.0
league/commonmark Version ~0.16
nikic/php-parser Version ~4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hoa/kitab contains the following files

Loading the files please wait ....