cable8mm / document2
The Document2 is to generate Laravel style documents to static website.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:HTML
Type:project
Requires
- php: ^8.1
- cable8mm/commonmark-unfenced: ^1.0
- illuminate/log: ^10.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- illuminate/view: ^9.0|^10.0
- laravel-zero/framework: ^10.2
- nunomaduro/termwind: ^1.15.1
- symfony/dom-crawler: ^6.0|^7.0
- torchlight/torchlight-commonmark: ^0.5.5
Requires (Dev)
- intonate/tinker-zero: ^1.2
- laravel/pint: ^1.0
- mockery/mockery: ^1.6
- pestphp/pest: ^2.22
Suggests
- cable8mm/commonmark-unfenced: Required to view tabs of source code block.
- intonate/tinker-zero: Required to debug using tinkerwell.
- laravel-zero/framework: Required to application framework.
- symfony/dom-crawler: Required to get DOM contents.
- torchlight/torchlight-commonmark: Required to highlight source code.
README
The Document2 is to generate Laravel style documents to 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 install cable8mm/document2
Usage
Three official three 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.