Download the PHP package smnandre/twigdoc without Composer

On this page you can find all versions of the php package smnandre/twigdoc. 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 twigdoc

TwigDoc

Document Twig templates, validate their inputs early, and ship confident UI changes.

  PHP Version   CI   Release   GitHub Sponsors   License

TwigDoc is a zero-config companion for Twig projects. It extracts @var annotations, turns them into documentation, and lets you fail fast by validating template contexts during development, CI, or custom tooling.


Features

Write documentation where it matters

: Keep @block, @var, nullable hints, and array shapes beside the Twig markup they describe.

Generate shareable documentation

: Build HTML or Markdown portals from annotations with twigdoc generate, complete with search, folder trees, and placeholder coverage tracking.

Validate template inputs early

: TwigDoc::validate() and the twigdoc validate command compare runtime data to the declared contract so CI or local dev trips on missing fields before reviewers do.


Install

The CLI lives in vendor/bin/twigdoc; the PHP API is namespaced under TwigDoc\.

Usage

Generate Reports: twigdoc generate

Turn annotations into HTML or Markdown docs for your team:

HTML output

Markdown output

Validate Templates: twigdoc validate

Fail fast when runtime context deviates from the documented contract:

Show Template Docs: twigdoc show

Inspect the parsed documentation for a single template during reviews or pairing:

Documentation

Doc blocks

Reference

Directive Example Meaning
@var <type> $name [description] @var string $title Page title Declares a documented variable using PHP-style types.
Nullable types @var ?string $bio Allows null or omission; non-nullables must exist in runtime context.
Arrays @var Item[] $items Expects an array where every entry matches the inner type.
Scalars string, int, float, bool (aliases integer, double, boolean). Primitives follow PHP naming.
@block ... @block Product detail page Adds human-friendly copy for docs and search indices.
Descriptions @var int $age User age in years Optional free text surfaced in HTML/Markdown outputs.

Anything without annotations is ignored unless you pass --include-empty, which creates placeholder docs for coverage tracking.

Contributing

Contributions, bug reports, and RFCs are welcome! Please open issues or pull requests.

Licence

TwigDoc is released under the MIT Licence. See LICENSE for details.


All versions of twigdoc with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
symfony/console Version ^6.0 || ^7.0
twig/twig Version ^3.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 smnandre/twigdoc contains the following files

Loading the files please wait ...