anandpilania / laravel-docs
laravel 的文档阅读器。
1.0.0
2017-06-29 14:12 UTC
Requires
- erusev/parsedown-extra: 0.7.1
- illuminate/config: 5.*
- illuminate/filesystem: 5.*
- illuminate/http: 5.*
- illuminate/routing: 5.*
- illuminate/support: 5.*
- league/commonmark: 0.15.*
- symfony/browser-kit: ~3.3
This package is auto-updated.
Last update: 2024-09-13 04:34:21 UTC
README
laravel 的文档阅读器,目前支持的扩展为: .md
,有助于将其用作项目的 知识库
或 常见问题解答
。
特性
- 渲染
.md
文档 - 安全:配置访问
- 您可以请求/建议更多功能
如何使用
-
安装
-
git
:git clone https://github.com/AnandPilania/laravel-docs.git
-
composer
:composer install anandpilania/laravel-docs
-
将
Provider
注册到config/app.php
-
AP\Docs\ServiceProvider::class
我使用了
Contract
而不是Facade
,因此Docs
可以直接被任何class
访问。 -
-
发布
config
和resources
php artisan vendor:publish
-
根据您的需求配置包 (
app/docs.php
)disk.root
=> 所有文档的根路径(默认:storage/app/docs)
http
: 负责默认路由prefix
=> 路由前缀(默认:/docs)middleware
=> 默认使用web
作为中间件组
default' :
该部分负责渲染默认的doc
vendor
=> 默认:storage/app/docs/laravelversion
=> 默认:5.4page
=> 访问 //HOSTNAME/docs/laravel/5.4 时加载默认(安装)文件index
=> 默认index
文件extension
=> 目前此包仅支持.md
,请勿更改。
security
: 限制docs
的访问enabled
=> 是否启用此功能由您决定。true
||false
file
=> 根据您的意愿配置security
文件的名称。默认security.json
将此security.file
添加到vendor
目录。
扩展
:supported
=> 添加支持渲染的扩展(目前为.md
),剩余扩展将被排除excluded
=> 包含这些扩展的文件将不会显示在列表中
-
示例
security.json
(例如:/storage/docs/app/laravel/security.json){ "roles": ["users"], "permissions": ["docs.show.versions"] }