cirlmcesc / laravel-mddoc
read markdown file content rendering web page
Installs: 59
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:laravel-package
Requires
- php: ^7.2.5
- erusev/parsedown: ^1.6
- illuminate/console: ^7.0
- illuminate/support: ^7.0
Requires (Dev)
- orchestra/testbench: ~3.6
README
TL;DR
Markdown documentation for Laravel.
Install with composer, create a route to MddocController
.
Automatic analysis of documentation folders, read markdown file content rendering web page, Highest support two level classification.
No public assets, automatic registration routing, UI based on Antd Desgin Vue .
Inspired by star7th's showdoc (run in ThinkPHP).
Install
Install via composer
composer require cirlmcesc/laravel-mddoc
Add Service Provider to config/app.php
in providers
section
Cirlmcesc\LaravelMddoc\LaravelMddocServiceProvider::class,
Then run the following command to publish the resource.
Configuration file will be published to config/
.
The mode of operation can be customized by modifying parameters and attributes.
php artisan mddoc:install
Usage
Generating a template with a artisan command.
The markdown file will be placed under the documentation/
folder under the root directory.
You can also change the parameters in the configuration file to change the directory where the files are stored.
php artisan make:documentation filename
Visit
You can visit on
http://www.example.com/documentation
The routing path can be changed in the published configuration file, or the automatic registration route is cancelled. If the route is registered by yourself, add a route in your web routes file.
Route::get("your/router/path/{first?}/{second?}/{third?}", "Cirlmcesc\LaravelMddoc\MddocController@view");
Other
The home page displays the project's README.md file by default. You can modify the contents of the home page in the published configuration file. An auxiliary function is provided to handle markdown content for home page display.
function parse_markdown(String $markdown_file_path) : String