• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

thlorenz/wicked: Generates github wiki compatible API documentation from your pr ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

thlorenz/wicked

开源软件地址:

https://github.com/thlorenz/wicked

开源编程语言:

JavaScript 100.0%

开源软件介绍:

wicked build status

A tool that generates github wiki compatible API documentation from your project's jsdocs and adds them to your wiki.

wicked.wiki

That is wicked!

Installation

npm install -g wicked

Usage

Steps

  1. Create wiki by checking wiki in your project Features settings
  2. Initialize wiki by accessing the wiki (the book icon in the navbar) which links to http://github.com/yourname/yourproject/wiki
  3. Install wicked npm install -g wicked
  4. Go to the root of your github project on your machine
  5. Run wicked

Steps 4 - 5 can be repeated everytime you want to re-generate API docs for your project.

wicked does not overwrite other pages you created in your wiki so keep running wicked all you need.

More specifically wicked only removes old *.API.md files from your wiki and updates the links _Sidebar.md without affecting any other links in the sidebar.

See an example of API docs added by wicked in its own wiki.

Command Line Options

usage: wicked <wicked-options> -- <jsdoc-options>

  Generates wiki API docs for the gihub project in the current directory.

  Both options are optional, jsdoc-options get passed to [jsdoc](http://usejsdoc.org/about-commandline.html).

  Note: overriding the jsdoc destination (-d, --destination) is not possible since wicked will write files to a temp dir

OPTIONS:

  --noclean       don't remove the temp directory into which wiki is checked out when finished

  --nocommit      don't commit the updated wiki automatically nor remove the temp directory

  -t, --toc       causes wicked to generate a table of contents on top of each wiki page

  -l, --loglevel  level at which to log: silly|verbose|info|warn|error|silent -- default: info
  
  -h, --help      Print this help message.


EXAMPLES:
  
  Generate with default options:
    
    wicked

  Generate and include table of contents:
    
    wicked --toc

  Override [jsdocconf.json](http://usejsdoc.org/about-configuring-jsdoc.html):

    wicked -- --configure ./myconf.json

  Override loglevel and jsoc configuration and don't remove temp directory:

    wicked  --loglevel silly --noclean -- --configure ./myconf.json

Helpful links and techniques

Since wicked is using jsdoc under the hood, it is helpful to review its documentation. I highly recommend this page explaining how to specify @param types among other useful specs.

In order to avoid all functions being attached to the global namespace resulting in one API page per function, I namespaced functions in wicked with @namespace and @memberof working together. As an example the Internal namespace is defined here and used by all the lib functions like this one.

Feel free to study the commenting style used in wicked itself and compare with the wiki pages it produced.

In order to make your wicked API pages appear properly styled, please install the chrome extension or bookmarklet.

API

Public wicked API

Source:

<static> wicked(args, jsdocargs, cb)

Generates jsdoc wiki pages for project of current working directory and updates github wiki with them.

Note

It is assumed that this is run from the root of the project whose wiki should be generated. Additionally the currently checked out branch will be used when generating blob urls to link source examples.

However the github remote and branch can also be set via environment vars as explained in the documentation of jsdoc-githubify which is used by wicked under the hood.

Parameters:
Name Type Description
args Object

consumed by wicked

Properties
Name Type Argument Description
noclean Boolean <optional>

(false) if true, the temp directory into which wiki is checked out will not be removed when done

nocommit Boolean <optional>

(false) if true, the updated wiki will not be committed automatically

toc Boolean <optional>

(false) if true, a table of contents is added to each generated wiki

loglevel String <optional>

(info) level at which to log: silly|verbose|info|warn|error|silent

jsdocargs Array.<String>

consumed by jsdoc

cb function

called back when wicked finished generating the wiki page

Source:

generated with docme

License

MIT




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap