PHP>> adx>> 返回
项目作者: nuald

项目描述 :
Produces the code's auto-generated documentation in HTML, PDF or XML.
高级语言: Go
项目地址: git://github.com/nuald/adx.git
创建时间: 2018-04-19T05:02:44Z
项目社区:https://github.com/nuald/adx

开源协议:The Unlicense

下载


adx

Produces the code’s auto-generated documentation in HTML, PDF or XML.

Requirements

The tool utilizes Doxygen and JsDoc3 command line utilities, please be sure
to install those first, e.g. for macOS:

  1. $ brew install doxygen node
  2. $ npm i jsdoc -g

Please note the tool uses xsltproc utility, so be sure that it’s available
in PATH.

Installation

  1. go get -u github.com/nuald/adx

Usage

Please use the tool’s flags to generate the corresponding output:

  1. Usage: adx [-conf=(yaml-file)] -lang=(lang) [-jsconf=(jsdoc-conf)] [-src=(src-dir)]+ [-xml=(xml-file)]+ -title=(title) -out=(out.[html|pdf|xml])
  2. Produces the code's auto-generated documentation in HTML, PDF or XML.
  3. Flags:
  4. -conf string
  5. the configuration file for the custom languages
  6. -jsconf string
  7. the JSDoc configuration file
  8. -lang string
  9. the source code programming language (js, java)
  10. -out string
  11. the output file (the format is based on its extension)
  12. -src value
  13. the source code dir(s)
  14. -title string
  15. the document title
  16. -xml value
  17. the input XML file(s)

Development Notes

make is utilized to perform various tasks related to development.

Unit-testing:

  1. $ make tests

Local installation:

  1. $ make install

Custom Languages Support

Custom languages are parsed based on the configuration files. The code should be documented
in a special way as it’s parsed to generate the documentation based on the rules
from the configuration.

Code sample:

  1. /**
  2. * Class: Foo
  3. * Foo demo class
  4. *
  5. * @property prop The sample property.
  6. * @constructor Build an Foo class instance.
  7. */
  8. class Foo(private val prop: String) {
  9. /**
  10. * Method: method1
  11. * The sample method.
  12. *
  13. * @param arg The sample argument.
  14. * @return The sample return.
  15. */
  16. fun method1(arg: String): Int {
  17. }
  18. }

Class:, Method: (Static Method:, Constructor:) and Property: (Static Property:) markers
are used to determine the block context. Classes may have the optional
@constructor tag to identify that the constructor is implicitly defined
with the @property list as its arguments.

The configuration file has the following YAML format (see fixtures/config.yaml as an example):

  1. <language_name>:
  2. extensions: [list of extensions]
  3. docstrings:
  4. type: [block|line]
  5. format: /** */
  6. parameter: '@param (?P<name>\w+)\s?(?P<description>.*)'
  7. return: '@return\s?(?P<description>.*)'

Please note that parameter and return are regular expressions that should have
the name (not for return) and description capture groups.