dev-master
9999999-dev https://github.com/petrleocompel/yii2-markdown-docsYii2 markdown documentation module
BSD-3-Clause
The Requires
- php >=5.5.0
- yiisoft/yii2 2.0.*
by Petr Leo Compel
yii2 module markdown
Yii2 markdown documentation module
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
php composer.phar require --prefer-dist petrleocompel/yii2-markdown-docs "*"
or run, (*3)
composer require petrleocompel/yii2-markdown-docs
or add, (*4)
"petrleocompel/yii2-markdown-docs": "*"
to the require section of your composer.json
file., (*5)
Enable the module in your confguration:, (*6)
'modules' => [ 'docs' => [ 'class' => 'petrleocompel\yii2\markdowndocs\Module', // You can set custom parserClass //'parserClass' => 'cebe\markdown\GithubMarkdown' 'skipFirstHeading' => false, // if you want to skip rendering of first heading ], ],
Add a rule to your url manager component:, (*7)
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ... [ 'pattern' => 'doc<page:.+>', 'route' => 'doc/default/view', 'encodeParams' => false ], ... ], ],
Your documentation would then be accessible under your application's /doc
URL., (*8)
You can change this url but if your
@app
is your@webroot
then if you will change it to/docs
there could be collision., (*9)
So for compatibility i recommend to use /doc
, (*10)
This module assumes your documentation lives under the @app/docs
alias., (*11)
Under @app/docs
you should make your md files. You dont have to create listing its automatic., (*12)
On every 1 line of file should be #
means Heading 1, (*13)
Yii2 markdown documentation module
BSD-3-Clause
yii2 module markdown