cable8mm/document2

Document2用于生成Laravel风格的文档并生成静态网站。

安装: 0

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

语言:HTML

类型:项目

v0.4.1 2024-04-12 12:11 UTC

This package is auto-updated.

Last update: 2024-09-12 13:24:17 UTC


README

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

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许可证