PHPackages                             knuckleswtf/pastel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. knuckleswtf/pastel

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

knuckleswtf/pastel
==================

Write your API docs in Markdown and get them converted into pretty HTML🎨

1.3.7(5y ago)211.2M↓15.9%9[1 PRs](https://github.com/knuckleswtf/pastel/pulls)1MITCSSPHP &gt;=7.2.5

Since Apr 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/knuckleswtf/pastel)[ Packagist](https://packagist.org/packages/knuckleswtf/pastel)[ RSS](/packages/knuckleswtf-pastel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (16)Used By (1)

> This package is deprecated. It was a good idea, but [Scribe](https://github.com/knuckleswtf/scribe) now uses a different system where it generates HTML directly. You can still use this as a basic PHP-based static site generator, but there won't be any new features or maintenance. For more fully-featured PHP SSGs, see [jamstack.org/generators/](https://jamstack.org/generators/).

Pastel 🎨
========

[](#pastel-)

[![Latest release](https://camo.githubusercontent.com/24a23fc00bee8e09a72ed4b41d07f76895ca891e31ff1801afda74c239cedcf0/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6e75636b6c65737774662f70617374656c2e7376673f7374796c653d666c6174)](https://packagist.org/packages/knuckleswtf/pastel)[![Build Status](https://camo.githubusercontent.com/16c7cc11e66c7dbfcbd17becc7856ad15a9150670a7fbbcfd61b259a8f7af50f/68747470733a2f2f7472617669732d63692e636f6d2f6b6e75636b6c65737774662f70617374656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/knuckleswtf/pastel)[![Total Downloads](https://camo.githubusercontent.com/2f258ee948f496461d5188cc02459c9c286579301dc71032a43f97654962f783/68747470733a2f2f706f7365722e707567782e6f72672f6b6e75636b6c65737774662f70617374656c2f646f776e6c6f616473)](https://packagist.org/packages/knuckleswtf/pastel)

Pastel is a tool for generating pretty API documentation from Markdown. Write your docs in Markdown and let Pastel convert it to a HTML page, complete with:

- mobile responsiveness
- syntax highlighting for code examples in multiple languages
- a table of contents for easy navigation
- search functionality
- automatic "Last updated" tag, so your users know how fresh the docs are
- a logo, if you like
- custom HTML and CSS helpers for when you want to apply special styles

Want to see it in action? [Here's what the output looks like](https://knuckleswtf.github.io/pastel).

 [![](./screenshots/pastel-screenshot-1.png)](./screenshots/pastel-screenshot-1.png)

Pastel was forked from [Documentarian](https://github.com/mpociot/documentarian), which is itself a PHP port of [Slate](https://github.com/slatedocs/slate), the API documentation tool. Here's a [Node.js version](https://github.com/knuckleswtf/pastel).

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Writing your docs in Markdown](#writing-your-docs-in-markdown)
    - [Converting your Markdown file to HTML docs](#converting-your-markdown-file-to-html-docs)
    - [Styling helpers](#styling-helpers)
- [Integrations](#integrations)

Installation
------------

[](#installation)

```
composer require --dev knuckleswtf/pastel
```

Usage
-----

[](#usage)

With Pastel, you write your docs in Markdown, and you get complete HTML/CSS?JS output. Here's what you need to know:

### Writing your docs in Markdown

[](#writing-your-docs-in-markdown)

Start off with a single Markdown file. There are two parts:

#### The content

[](#the-content)

Your Markdown file should contain your docs, written as you like. There's no set format, but you can start with an introduction, talk about authentication and any general details, then describe each endpoint in its own section. Write example requests and responses using code blocks, use tables or paragraphs to describe request and response parameters.

There's a good example in the included example Markdown ([stubs/index.md](./stubs/index.md)) and the resulting HTML output ([docs/index.html](./docs/index.html)).

Pastel uses the same Markdown syntax as Slate. See [How to Edit Slate Markdown files](https://github.com/slatedocs/slate/wiki/Markdown-Syntax)

#### The front matter

[](#the-front-matter)

The front matter is a YAML section in your Markdown file that comes before the actual content. It's separated from the main content by a line before and after it containing only "---" (see [stubs/index.md](./stubs/index.md)).

```
---
# This section is the front matter
title: API Docs
---

This section is the content.

```

The front matter provides "meta" information about a Markdown document's contents (in this case, the API doc). You can use it to customise how your documentation will look like. Here are the values Pastel supports:

- `title`: The page title. This is used as the value of ``, so it's only shown on the browser window.
- `language_tabs`: Array of languages to switch between in the code samples. Please list them in the same order your code blocks are. Supported languages for highlighting: `bash`, `csharp`, `go`, `java`, `javascript`, `php`, `python`, `ruby`. You can use other languages too, but you won't get syntax hghlighting.
- `toc_footers`: Array of items to add below your table of contents. See [Slate's docs](https://github.com/slatedocs/slate/wiki/External-Links-in-the-ToC).
- `logo`: If you'd like to use a logo on the sidebar, set this to the path to the logo image file. Must be either a URL or a path relative to the docs destination from a browser. The image will have to fit in a 230px width box (the sidebar), so make sure it scales nicely.
- `includes`: This is where you can append more files to the main Markdown file you're using. Each entry in this array is the path to a Markdown file relative to the main file. So, if your folder structure is like this:

```
source/
  |- index.md
  |- includes/
     |- errors.md
     |- appendix.md

```

you can append the other files to `index.md` by using

```
includes:
- ./includes/appendix.md
- ./includes/errors.md

```

You can also use `*` as a wildcard. In this case, files matching the pattern will be included in alphabetical order.

```
includes:
- ./includes/*.md

```

- `last_updated`: The date on which the docs were last updated. Helpful so your users know if they're looking at something stale. Leave this empty and it will automatically be set to the most recent time you edited your Markdown files (main or includes). If you want to set this manually, you can write whatever you want here. Pastel will render it as is.

Most of these sections can be disabled in the generated documentation by omitting them from the front matter.

### Converting your Markdown file to HTML docs

[](#converting-your-markdown-file-to-html-docs)

```
./vendor/bin/pastel generate docs_source/index.md docs
```

This will generate the HTML output from the file `docs_source/index.md` and place it, along with the needed CSS and JavaScript in your docs/ directory. You can replace `docs_source/index.md` with vendor/knuckleswtf/pastel/stubs/index.md to use the sample Markdown docs included with this package.

You can also call Pastel from PHP. This is especially useful if you're building a tool on top of it (see [Integrations](#integrations) below. Here's how you'd use it:

```
 $pastel = new Knuckles\Pastel\Pastel();
 $pastel->generate("docs_source/index.md", "docs");
```

### Styling helpers

[](#styling-helpers)

#### Badges

[](#badges)

[![](./screenshots/badges-1.png)](./screenshots/badges-1.png) [![](./screenshots/badges-2.png)](./screenshots/badges-2.png)

You can easily add badges by using the `badge` CSS class, along with one of the `badge-` classes.

```
REQUIRES AUTHENTICATION

GET
```

Available colours:

- darkred
- red
- blue
- darkblue
- green
- darkgreen
- purple
- black
- grey

#### Fancy headings

[](#fancy-headings)

You can help your lower-level headings stand out by using the `fancy-heading-panel` class:

```
Body Parameters
```

[![](./screenshots/fancy-headings.png)](./screenshots/fancy-headings.png)

#### Notes and Warnings

[](#notes-and-warnings)

You can add little highlighted warnings and notes using the `` tag and either of the classes "notice", "warning", or "success".

Integrations
------------

[](#integrations)

- [Scribe](https://github.com/knuckleswtf/scribe): Generate documentation for your Laravel API from your codebase.

Todo
----

[](#todo)

- Custom favicon support
- Customizable output templates

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~77 days

Total

15

Last Release

1878d ago

Major Versions

0.2.0 → 1.0.02020-04-09

PHP version history (2 changes)0.1.0PHP &gt;=7.3

1.3.1PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef367e338eb001771b4d439508b7a355d62dc2712ff94017393913e853816abb?d=identicon)[shalvah](/maintainers/shalvah)

---

Top Contributors

[![shalvah](https://avatars.githubusercontent.com/u/14361073?v=4)](https://github.com/shalvah "shalvah (114 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (19 commits)")[![jleonardolemos](https://avatars.githubusercontent.com/u/5474031?v=4)](https://github.com/jleonardolemos "jleonardolemos (1 commits)")[![pashamesh](https://avatars.githubusercontent.com/u/1695806?v=4)](https://github.com/pashamesh "pashamesh (1 commits)")[![tpobozy](https://avatars.githubusercontent.com/u/6358285?v=4)](https://github.com/tpobozy "tpobozy (1 commits)")[![tsprings](https://avatars.githubusercontent.com/u/1232183?v=4)](https://github.com/tsprings "tsprings (1 commits)")

---

Tags

documentationmarkdowngeneration

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/knuckleswtf-pastel/health.svg)

```
[![Health](https://phpackages.com/badges/knuckleswtf-pastel/health.svg)](https://phpackages.com/packages/knuckleswtf-pastel)
```

###  Alternatives

[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

825191.0k1](/packages/daux-dauxio)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)[bookdown/bookdown

Provides DocBook-like rendering of Markdown files.

8257.6k16](/packages/bookdown-bookdown)[grazulex/laravel-atlas

Laravel Atlas scans your Laravel project to generate a complete, structured map of its internal components — models, controllers, routes, jobs, observers, events, commands, and more — and exports visual or machine-readable representations in formats like Mermaid, Markdown, JSON, or PDF.

161.7k](/packages/grazulex-laravel-atlas)[georgringer/doc

Render documentation based on markdown files directly in the backend

2232.7k](/packages/georgringer-doc)[dudo1985/wpdocgen

Documentation Generator for WordPress.

2327.6k](/packages/dudo1985-wpdocgen)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
