Burivuh - notepad with markdown editor
Simple notepad with markdown editor for yii2
Все это на русском, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist zabachok/yii2-burivuh "*"
or add, (*4)
"zabachok/yii2-burivuh": "*"
to the require section of your composer.json
file., (*5)
Run module migration:, (*6)
php yii migrate --migrationPath=@vendor/zabachok/yii2-burivuh/migrations
Activating
Add to you config file:, (*7)
'modules' => [
...
'burivuh' => [
'class' => zabachok\burivuh\Module::class,
],
]
and to bootstrapping:, (*8)
'bootstrap' => [..., zabachok\burivuh\Bootstrap::class],
Options
-
db
- name of database component:
'burivuh' => [
'class' => zabachok\burivuh\Module::class,
'db'=>'db',
...
],
-
usernameCallback
- anonymous function for generate username:
'burivuh' => [
'class' => zabachok\burivuh\Module::class,
'usernameCallback' =>function($user_id)
{
$user = \common\models\user\User::findIdentity($user_id);
return is_null($user) ? 'Undefined' : $user->username;
},
...
],
-
route
- you can use custom route to this module. For example:
'burivuh' => [
'class' => zabachok\burivuh\Module::class,
'route' => 'wiki',
...
],
It will be generate links like example.com/wiki/doc/mydoc
1. accessRules
- this option configuring AccessControl::rules component. For example:, (*9)
'burivuh' => [
'class' => zabachok\burivuh\Module::class,
'as access' => [
'class' => yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['?'],
],
],
],
...
],
Usage
Open url: http://your-site.com/burivuh
You can create, update and delete categories and documents. All actions is available only for authorized users., (*10)
Hot keys
In list
Arrow up and arrow down - moving up and down in list
Enter - open dir or file
Backspace - up in filesystem tree, (*11)
In view
Ctrl + e - edit the document, (*12)
In write
Ctrl + s - save document
Shift + Enter - new line
Tab - four spaces, (*13)
Text formatting
Ctrl + h - make this line a header, (*14)