Yamldocs
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Getting Started

Yamldocs is a versatile markdown generator that can be installed and used in different ways, depending on how much customization you need.

Requirements

To install and execute Yamldocs, you’ll need the following:

  • a PHP 8.1+ cli environment with the following extensions:
    • php-xml
  • Composer

Installing Yamldocs as part of an existing PHP application

This is the recommended method to use Yamldocs. It will give you more customization options, such as creating custom markdown builders that are specific to each type of YAML you have in your project.

Install yamldocs as a dependency:

composer require erikaheidi/yamldocs

This will make available the ./vendor/bin/yamldocs executable that you can call directly from your application root folder.

Creating a Yamldocs application

If you can’t include Yamldocs in your main application, or you just want to keep Yamldocs as a separate project for automating your docs (with GitHub Actions, for instance), you can bootstrap a placeholder app with Minicli:

composer create-project minicli/application my-super-docs

This will create a barebones Minicli application (cli-only) where you can set up your custom templates and builders. It gives the same benefits as the previous method, but keeps everything separate from your main application - also useful when your main application is not written in PHP.

Then you can proceed with the recommended installation method, which includes Yamldocs as a dependency:

composer require erikaheidi/yamldocs

Installing Yamldocs as standalone app

If you prefer to install Yamldocs locally as a standalone application, you’ll need PHP 8.1+ and Composer. Please note that this may make it harder to customize the app while maintaining it up-to-date with any new releases, since updating would overwrite your modified local files.

To proceed with this method, clone the Yamldocs repository and install dependencies with Composer:

git clone https://github.com/erikaheidi/yamldocs.git
cd yamldocs
composer install

Then you’ll be able to run yamldocs like this:

./bin/yamldocs build markdown file=example.yaml output=example.md