2017 © Pedro Peláez
 

yii2-extension yii2-markdown-docs

Yii2 markdown documentation module

image

petrleocompel/yii2-markdown-docs

Yii2 markdown documentation module

  • Saturday, October 15, 2016
  • by petrleocompel
  • Repository
  • 1 Watchers
  • 1 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 Markdown docs

Installation

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)

Configuration

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
    ],
],

Routing

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)

Usage

This module assumes your documentation lives under the @app/docs alias., (*11)

Make doc

Under @app/docs you should make your md files. You dont have to create listing its automatic., (*12)

Titles of doc

On every 1 line of file should be # means Heading 1, (*13)

The Versions

15/10 2016

dev-master

9999999-dev https://github.com/petrleocompel/yii2-markdown-docs

Yii2 markdown documentation module

  Sources   Download

BSD-3-Clause

The Requires

 

by Petr Leo Compel

yii2 module markdown