承接 awema-pl/module-docs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

awema-pl/module-docs

Composer 安装命令:

composer require awema-pl/module-docs

包简介

Package for wiki output

README 文档

README

Coverage report Build status Composer Ready Downloads Last version

Awema packages documentation reader

Installation

Via Composer

$ composer require awema-pl/module-docs

The package will automatically register itself.

You can publish the views with:

php artisan vendor:publish --provider="AwemaPL\Docs\DocsServiceProvider" --tag="views"

You can publish the config file with:

php artisan vendor:publish --provider="AwemaPL\Docs\DocsServiceProvider" --tag="config"

Adding docs routes

Add to routes\web.php

Docs::routes();

Examples of use

use Docs;

Docs::all($withDocs = true);

Docs::get(['package1' => ['1.0', '2.6'], 'package2' => '1.3', 'package3'], 'package4', $withDocs = true);

Docs::package('package1', $withDocs = true);

Docs::versions('package1', $withDocs = true);

Docs::version('package1', '1.0', $withDocs = true);

Docs::files('package1', '1.0', $withDocs = true);

Docs::file('package1', '1.0', 'file.md');

Docs::fileContent('package1', '1.0', 'file.md');

Docs::list();

Docs::list('package1');

Docs::list('package1', '1.0');

Docs::list('package1', '1.0', 'file.md');

Methods

all()

Docs::all($withDocs = true);

Output:

[
  [
    "name" => "package1",
    "versions" => [
      [ 
        "name" => "1.0",
        "files" => [
          [
            "name" => "index.md",
            "content" => "# Title"
          ],
          [
            "name" => "doc1.md",
            "content" => "Doc 1 content"
          ]
        ]
      ],
      ...
      [ 
        "name" => "2.6",
        "files" => [ ... ]
      ]
    ]
  ],
  ...  
  [
    "name" => "package4",
    "versions" => [ ... ]
  ]
]

Input param $withDocs is bollean, optional and is true by default.

if $withDocs == false file content will be null

get()

Docs::get(['package1' => ['1.0', '2.6'], 'package2' => '1.3', 'package3'], 'package4', $withDocs = true);

Last bool param $withDocs is optional and is true by default

Method output is the same as for all(), but will contain only specified in args packages and versions.

If packages are not listed result will contain all packages.

If versions for specified package is not listed result will contain all versions for that package

package()

Docs::package('package1', $withDocs = true);

Output:

[
  "name" => "package1",
  "versions" => [
    [ 
      "name" => "1.0",
      "files" => [
        [
          "name" => "index.md",
          "content" => "# Title"
        ],
        [
          "name" => "doc1.md",
          "content" => "Doc 1 content"
        ]
      ]
    ],
    ...
    [ 
      "name" => "2.6",
      "files" => [ ... ]
    ]
  ]
]

If package is not in the docs, result will be null.

Last bool param $withDocs is optional and is true by default.

If $withDocs == false file content will be null.

versions()

Docs::versions('package1', $withDocs = true);

Output:

[
  [ 
    "name" => "1.0",
    "files" => [
      [
        "name" => "index.md",
        "content" => "# Title"
      ],
      [
        "name" => "doc1.md",
        "content" => "Doc 1 content"
      ]
    ]
  ],
  ...
  [ 
    "name" => "2.6",
    "files" => [ ... ]
  ]
]

If package is not in the docs, result will be null.

Last bool param $withDocs is optional and is true by default.

If $withDocs == false file content will be null.

version()

Docs::version('package1', '1.0', $withDocs = true);

Output:

[ 
  "name" => "1.0",
  "files" => [
    [
      "name" => "index.md",
      "content" => "# Title"
    ],
    [
      "name" => "doc1.md",
      "content" => "Doc 1 content"
    ]
  ]
]

If package or version is not in the docs, result will be null.

Last bool param $withDocs is optional and is true by default.

If $withDocs == false file content will be null.

files()

Docs::files('package1', '1.0', $withDocs = true);

Output:

[
  [
    "name" => "index.md",
    "content" => "# Title"
  ],
  [
    "name" => "doc1.md",
    "content" => "Doc 1 content"
  ]
]

If package or version is not in the docs, result will be null.

Last bool param $withDocs is optional and is true by default.

If $withDocs == false file content will be null.

file()

Docs::file('package1', '1.0', 'file.md');

Output:

[
  "name" => "index.md",
  "content" => "# Title"
]

If package or version or file is not in the docs, result will be null.

fileContent()

Docs::fileContent('package1', '1.0', 'file.md');

Result is file content string or null if file does not exists

list()

Docs::list();

Output is array of packages names

[
  "package1",
  "package2",
  ...
  "package6"
]

Docs::list('package1');

Output is array of package versions names

[
  "0.1",
  "0.2",
  ...
  "2.18"
]

If package is not in the docs, result will be null.

Docs::list('package1', '1.0');

Output is array of package version files names

[
  "index.md",
  "doc1.md",
  ...
  "doc4.md"
]

If package or version is not in the docs, result will be null.

Docs::list('package1', '1.0', 'file.md');

Result is file content string or null if file does not exists

Testing

You can run the tests with:

composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固