overtrue/wisteria
擴(kuò)展可以將Markdown格式文章生成精美的項(xiàng)目使用文檔網(wǎng)站膏斤,方便用戶查看。
https://github.com/overtrue/wisteria
生成的文檔效果
安裝
$ composer require overtrue/wisteria -vvv
使用
發(fā)布配置和所需資源
$ php artisan wisteria:install
運(yùn)行上述命令會(huì)創(chuàng)建wisteria的配置文件 config/wisteria.php
, 并且將文檔展示用的靜態(tài)資源文件復(fù)制到 public/vendor/wisteria
目錄下义起。
更新配置文件,并根據(jù)配置創(chuàng)建markdown格式的項(xiàng)目文檔
config/wisteria.php
配置文件說(shuō)明
具體使用參考 EasyWeChat 文檔
https://github.com/easywechat/docs
<?php
return [
'route' => '/topic', # 項(xiàng)目文檔訪問(wèn)路由
'middlewares' => [],
'docs' => [
// Storage path of docs files.
'path' => '/storage/app/topic', # 項(xiàng)目的Markdown格式文檔存儲(chǔ)路徑
// Index page file.
'index' => 'index.md', # 文檔目錄文件褂删,
// Homepage
'home' => 'overview.md', # 文檔首頁(yè)
// Versions
'versions' => [ # 可以設(shè)置多個(gè)文檔版本共存坏挠,如你項(xiàng)目升級(jí)奈懒,每個(gè)版本對(duì)應(yīng)的文檔不同
],
'default_version' => '', # 默認(rèn)打開的文檔版本
// Docs repository
'repository' => [
//'provider' => 'github',
//'url' => 'https://github.com/overtrue/wisteria',
],
],
// UI settings
'ui' => [
'logo' => 'images/topic_logo.png', # 125 * 30 項(xiàng)目logo
'nav-links' => [ # 文檔頂部導(dǎo)航欄
[
'url' => '/',
'label' => '首頁(yè)',
'target' => '_self',
]
],
],
// SEO configs
'seo' => [
'author' => '木偶',
'description' => '木偶SEO站點(diǎn)專題文章',
'keywords' => '木偶SEO',
'og' => [
'title' => '木偶SEO站點(diǎn)專題文章',
'type' => 'article',
'url' => '',
'image' => '',
'description' => '木偶SEO站點(diǎn)專題文章',
],
],
'plugins' => [
'google-analytics' => [
// 'id' => 'UA-XXXXXXXX-1'
],
// Algolia Docsearch
'docsearch' => [
//'api_key' => '',
//'index_name' => '',
//'placeholder' => 'Search',
],
],
'date' => [
'format' => 'Y-m-d H:i:s',
'timezone' => 'UTC',
],
'cache' => [
'ttl' => 300, // seconds
],
];
根據(jù)上述配置文件奠涌,將自己的項(xiàng)目文檔每個(gè)markdown文件放在文檔版本文件夾下,編輯好index.md
文件作為目錄
初始化文檔
創(chuàng)建好文檔后執(zhí)行以下命令使文檔生效
$ php artisan wisteria:refresh
訪問(wèn)文檔
http://{domain}/topic/{version}
————————————————
本文由木偶筆記發(fā)表于 2021-11-07
轉(zhuǎn)載請(qǐng)務(wù)必保留本文鏈接:https://www.muouseo.com/article/m0wekxvp9k.html