cable8mm / document2
Document2用于生成Laravel风格的文档并生成静态网站。
v0.4.1
2024-04-12 12:11 UTC
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
Document2用于生成Laravel风格的文档并生成静态网站。
我们尽力为您创建了一个方便的工具。花点时间看看它是如何工作的。
功能
- 从文档生成静态网站
- 支持版本
- 支持模板
- 本地测试可用
- 支持暗黑主题
- 支持骨架主题
- 支持搜索
- 使用操作发布GitHub Pages
- 支持SEO
安装
composer install cable8mm/document2
使用
提供三个官方模板。我们可以立即介绍它们以创建。
选择您的模板
bin/install-theme.sh https://github.com/cable8mm/laravel-theme
并克隆文档文件
bin/checkout_latest_docs.sh
# Import laravel documentations into `docs` folder
最后,运行以下命令以生成静态HTML
./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`
如果已安装Laravel Valet或Laravel Herd,您可以通过https://document2.test访问。
开发模板
创建
cd templates
npm run dev
并访问https://:5173/。端口号可能不同。
保留占位符
{{ 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
保留分隔符
<!-- 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 -->
测试
composer test
格式化
composer lint # Modify all files to comply with the PSR-12. composer inspect # Inspect all files to ensure compliance with PSR-12.
许可证
Document2项目是开源软件,许可证为MIT许可证。