承接 gears/doc 相关项目开发

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

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

gears/doc

最新稳定版本:v0.1.2

Composer 安装命令:

composer require gears/doc

包简介

API Documentation Generator using Markdown

README 文档

README

Build Status Latest Stable Version Total Downloads License

API Documentation Generator using Markdown

Think Natural Docs but using 100% markdown.

This project is designed to document any language that supports the doc block comments syntax. This is what a doc block looks like:

/**
 * I am a doc block
 */

How to Install

Installation via composer is easy:

composer require gears/doc:* --dev

Or you may wish to install the command globally on your system:

composer global require gears/doc:*

Running the Command gearsdoc

Once installed you just need to run the command like so:

/location/to/gearsdoc \
    --input="/the/path/to/your/source/code" \
    --output="/the/path/to/where/you/want/the/generated/docs/to/go"

There are many more options, either just use the --help option while at the terminal. Or have a look at: Method: configure

Writing Doc Blocks for gearsdoc

At a basic level to write a doc block that gearsdoc can parse and understand all you need to do is use the Markdown syntax, inside the doc block.

Gotchas

Make sure your doc blocks are spaced correctly, for example the following is a bad doc block:

/**
 *foo
 */

Where as this is one is correct:

/**
 * foo
 */

Apart from that there are no other hard requirements.

However to make effective good looking documenation with gearsdoc there are some things you need know:

Titles:

The first <h1> element in a doc block is considered the title for that doc block. Obviously if the doc block does not contain a <h1> element then we don't set the title attribute.

Here is a doc block that has a title:

/**
 * I AM THE DOC BLOCK TITLE
 * ========================
 * this is just normal text
 */

And here is what it looks like:

I AM THE DOC BLOCK TITLE

this is just normal text

Contexts:

A context is simply a CSS class that we apply to each bootstrap panel that gets generated. The context is determined by the title thus if there is no title there is no context.

Out of the box gearsdoc will set some contexts for you. If you wish to add your own contexts see: Property: blockContexts.

Here is a doc block with the Class context:

/**
 * Class: Baz
 * ==========
 */

And the resulting bootstrap panel:

Class: Baz

Signatures:

The very next line after a doc block is what we call the signature. It is usally the code that defines a class, function, method or property. But it can be anything at all. If the line is blank then that doc block will not have a sigature associated with it.

Here is a doc block with signature:

/**
 * I AM THE DOC BLOCK TITLE
 * ========================
 * this is just normal text
 */
$foo = 'bar';

And here is what it looks like:

I AM THE DOC BLOCK TITLE

$foo = 'bar';

this is just normal text

Internal Links:

I am really very happy with this feature. Being able to link to various parts of code in your doc blocks is invaluable. For example being able to link to the exact line of code that consumes a class property... priceless :)

There are basically 3 types of internal links:

  • A link that references a doc block title.
  • A link that references a doc block signature.
  • A link that references a particular line of code.

Lets have some examples:

/**
 * [Method: Foo](#)
 * [private function Foo()](#)
 * [$this->foo = 'bar';](#)
 */

The pound (#) denotes the file that we will find the reference in. If the reference is in the same file as the link then just leave the pound as is.

NOTE: There are a few working example in this page, see if you can find them.

Developed by Brad Jones - brad@bjc.id.au

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固