miolae / yii2-markdown-doc
Yii2 module to write documentation with MarkDown files
Installs: 3 926
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Type:yii2-module
Requires
- php: >=5.6
- kartik-v/yii2-markdown: *
- yiisoft/yii2: ~2.0.11
Requires (Dev)
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: *
This package is auto-updated.
Last update: 2024-11-05 00:46:29 UTC
README
Yii2 module to display the content of all markdown file in a directory and its sub-folder.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist "miolae/yii2-markdown-doc" "2"
or add
"miolae/yii2-markdown-doc": "2"
to the require section of your composer.json
file.
Configure
- Configure the module in config/web.php as follows
'modules' => [ ////////////////// 'doc' => [ 'class' => 'miolae\yii2\doc\Module', // Directory to list 'rootDocDir' => '@app/docs', // set false if you don't want to cache generated html, useful for debugging 'cache' => true, // Prefix for browser title, i.e: Documentation: Page Title 'titlePrefix' => 'Documentation:', ], ////////////////// ],
- Add
miolae\yii2\doc\controllers\DefaultController
either tocontrollerMap
or tourlManager
. Example for url manager with pretty url enabled:
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ '/doc/<page:[\w\/-\#]+>' => 'doc/default/index', '/doc' => 'doc/default/index', ], ],
Usage
- Add
README.md
to yourdocs
directory (or other one you specified inrootDocDir
option) - To access the doc, go to http://yoursite.com/doc/