定制 unionofrad/li3_docs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

unionofrad/li3_docs

Composer 安装命令:

composer require unionofrad/li3_docs

包简介

An API and wiki-like documentation generator.

README 文档

README

Once installed in your existing application, however, it generates documentation from your app's docblocks in real-time, which is all accessible from http://yourapp.tld/docs/. Not only that, but it will generate documentation for your plugins, too. Including itself; so it is self-replicating in a way. In this vein, it becomes part of a series of plugins required in order to obtain various documentation volumes of interest.

Such as:

So the documentation plugin is a tool for creating automatically browse-able documentation of your application's codebase. In addition to simple descriptions and tables of contents,

Note: li3_docs is a plugin, NOT an app. Furthermore, by itself it is a VIEWER ONLY and contains no actual documentation other than its own.

Installation

  1. To install run composer require unionofrad/li3_docs.
  2. The plugin needs a configured default connection.
  3. 2 tables need to be created using schema.sql file.

Documentation structure

For generating documentation, li3_docs relies on PHP documentation blocks, or docblocks. These docblocks can appear above classes, methods, properties, etc., and contain three things: a short description, a longer description (often including usage examples), and docblock tags, which are denoted by an @ symbol, followed by a keyword. A typical docblock might look something like this:

	/**
	 * Contains an instance of the `Request` object with all the details of the HTTP request that
	 * was dispatched to the controller object. Any parameters captured in routing, such as
	 * controller or action name are accessible as properties of this object, i.e.
	 * `$this->request->controller` or `$this->request->action`.
	 *
	 * @see lithium\action\Request
	 * @var object
	 */
	public $request = null;

This docblock documents a class property, and contains a short description and two docblock tags. The tags to be used in a docblock vary by what is being documented. A property docblock should contain a @var tag that describes what type of value the property holds, while methods have a series of @param tags and a @return tag.

There are also general tags which can be added to any docblock. These include the @see tag, which allows you to link to another class, method or property, and the @link tag, which allows you to link to an arbitrary URL.

Markdown syntax

Docblock descriptions are written in Markdown format, with a few conventions. Namely, any code references or identifiers should be enclosed in backticks. This includes namespaces, classes, variable names, and keywords like true, false and null. Extended code examples should be written enclosed in three sets of backticks, i.e.: ‍ // Code goes here ```.

Indexing

The plugin supports both manual-like repositories holding markdown formatted files, as well as source-code repositories, which may additionally have so called namespace documents (a README.md files nested inside directories).

The following registers 2 indexes, one for our manual, one for the frameowork API.

use li3_docs\models\Indexes;

Indexes::register([
	'type' => 'book',
	'title' => 'li₃: The Definitive Guide',
	'name' => 'manual',
	'version' => '1.x',
	'path' => '/tmp/manual_1',
]);

Indexes::register([
	'type' => 'api',
	'title' => 'Framework API',
	'name' => 'lithium',
	'version' => '1.0.x',
	'path' => '/tmp/lithium_10',
	'namespace' => 'lithium'
]);

Once registered the index can be regenerated by running the following command.

li3 docs index

Searching

The plugin supports symbol-based search i.e. via ElasticSearch. Search for classes, methods and properties. To get all symbols available in all libraries registered with li3 execute the following method.

use li3_docs\models\Symbols;

foreach (Symbols::harvest($index) as $symbol) {
	ElasticSearch::addToIndex($symbol->data());
}

unionofrad/li3_docs 适用场景与选型建议

unionofrad/li3_docs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 97.17k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2012 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「documentation」 「api」 「docs」 「wiki」 「lithium」 「li3」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 unionofrad/li3_docs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 unionofrad/li3_docs 我们能提供哪些服务?
定制开发 / 二次开发

基于 unionofrad/li3_docs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 6
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-clause
  • 更新时间: 2012-12-12