cable8mm/document2

The Document2 is to generate Laravel style documents to static website.

Maintainers

Package info

github.com/cable8mm/document2

Language:HTML

Type:project

pkg:composer/cable8mm/document2

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.5.0 2026-07-15 06:20 UTC

This package is auto-updated.

Last update: 2026-07-15 06:22:13 UTC


README

code-style run-tests Packagist Version Packagist Downloads Packagist Dependency Version Packagist Dependency Version Packagist Stars Packagist License

Document2 generates Laravel-style documentation as a static website.

We have done our best to create a convenient tool for you all. Take a moment to see how it works.

Features

  • Generate static website from documentations
  • Versions are supported
  • Templates are supported
  • Testing available locally
  • Dark theme is supported
  • Skeleton Theme is supported
  • Search is supported
  • Publish GitHub Pages with actions
  • SEO is supported

Installation

composer require cable8mm/document2

Usage

Three official templates are available. We can introduce them for creating as soon as possible.

Select your template:

bin/install-theme.sh https://github.com/cable8mm/laravel-theme

And clone the documentation files:

bin/checkout_latest_docs.sh
# Import laravel documentations into `docs` folder

Finally, run the following command to generate the static htmls

./document2
# Generate the static html files into the `public` folder

./document2 -d docs -b 10.x -f artisan.md
# Generate the static html file of directory `docs`, branch `10.x` and filename `artisan.md`

If Laravel Valet or Laravel Herd has been installed, you can visit https://document2.test.

Development Templates

Create

cd templates

npm run dev

and visit http://localhost:5173/. The port can be different.

Reserved Placeholders

{{ section_title }} : replaces the section title
{{ title }} : replaces the title
{{ version }} : replaces the documentation version
{{ canonical }} : replaces the canonical url of the documentation
{{ app_url }} : replaces the documentation url
{{ original_url }} : replaces the original website url out of docs

Reserved Dividers

<!-- doc.navigator.start -->
The navigator html is inserted in this area
<!-- doc.navigator.end -->

<!-- version.options.start -->
The option html is inserted in this area
<!-- version.options.end -->

<!-- doc.content.start -->
The markdown documentation html is inserted in this area
<!-- doc.content.end -->

Testing

composer test

Formatting

composer lint
# Modify all files to comply with the PSR-12.

composer inspect
# Inspect all files to ensure compliance with PSR-12.

License

The Document2 project is open-sourced software licensed under the MIT license.