xzdoc
Version:
Generate your documentation.
244 lines (219 loc) • 9.9 kB
HTML
<html>
<head>
<meta charset="utf-8" />
<title>xzdoc Documentation</title>
<meta name="keywords" content="documentation,dox" />
<meta name="description" content="Generate your documentation." />
<script src="assets/prettify.js"></script>
<script src="assets/jquery-1.8.2.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" type="text/css" href="assets/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="assets/base.css" />
</head>
<body>
<nav class="navbar navbar-inverse navbar-static-top top-navbar" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./index.html">xzdoc</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="./api.html">API Docs</a>
</li>
<li>
<a href="./Changelog.html">Changelog</a>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</nav>
<header class="jumbotron subhead">
<div class="container">
<h1>xzdoc <small>Version: 0.0.4 By @Yggdrasill-7C9</small></h1>
<p class="lead">
Generate your documentation.
</p>
</div>
</header>
<div class="container content">
<div class="row">
<div class="col-md-3">
<ul class="nav nav-list bs-docs-sidenav affix">
<li class="level_2">
<a href="#index_来源" title="来源">
<i class="icon-chevron-right"></i>来源
</a>
</li>
<li class="level_2">
<a href="#index_Installation" title="Installation">
<i class="icon-chevron-right"></i>Installation
</a>
</li>
<li class="level_2">
<a href="#index_Usage" title="Usage">
<i class="icon-chevron-right"></i>Usage
</a>
</li>
<li class="level_2">
<a href="#index_查看文档效果" title="查看文档效果">
<i class="icon-chevron-right"></i>查看文档效果
</a>
</li>
<li class="level_2">
<a href="#index_Github与CommonJS规范" title="Github与CommonJS规范">
<i class="icon-chevron-right"></i>Github与CommonJS规范
</a>
</li>
<li class="level_2">
<a href="#index_贡献者" title="贡献者">
<i class="icon-chevron-right"></i>贡献者
</a>
</li>
<li class="level_2">
<a href="#index_License (MIT)" title="License (MIT)">
<i class="icon-chevron-right"></i>License (MIT)
</a>
</li>
<li class="level_2">
<a href="#index_捐赠" title="捐赠">
<i class="icon-chevron-right"></i>捐赠
</a>
</li>
</ul>
</div>
<div class="col-md-9">
<section>
<h1 id="xzdoc-build-status">xzdoc 不再为文档而发愁 <a href="http://travis-ci.org/Yggdrasill-7C9/xzdoc"><img src="https://secure.travis-ci.org/Yggdrasill-7C9/xzdoc.png?branch=master" alt="Build Status"></a></h1>
<h2 id="-">来源</h2>
<p>过去通常要自己维护API文档,这会是一件比较蛋疼的事情。所幸我们有<a href="https://github.com/visionmedia/dox">dox</a>,dox可以帮我们解析注解。但是dox不能帮我们任意生成文档。于是就有了xzdoc,xzdoc基于dox的注解对象,加入模板。在遵循Github和CommonJS的约定后,xzdoc可以帮你的模块包快速生成文档。</p>
<h2 id="installation">Installation</h2>
<p>安装xzdoc为全局工具:</p>
<pre><code>$ npm install xzdoc -g</code></pre><h2 id="usage">Usage</h2>
<p>此处将以xzdoc项目自身作为例子:</p>
<pre><code>// 签出xzdoc项目
$ git clone git://github.com/Yggdrasill-7C9/xzdoc.git ~/git/xzdoc
// 去到项目目录
$ cd xzdoc
$ xzdoc build
// 在docs目录下将会得到文档
$ open ~/git/xzdoc/doc/index.html
// 或者 -o folder,可以将文档生成到指定的目录下
$ xzdoc build -o ~/output</code></pre><h3 id="-">选择模版</h3>
<pre><code>// 带上-s参数后,可以选择xzdoc提供的几种模板
$ xzdoc build -s wordpress</code></pre><h3 id="-">自定义模版</h3>
<p>如果xzdoc提供的几个模板不能满足你的需求</p>
<pre><code>// 查看xzdoc目前已有的模板
$ xzdoc theme list
// 在当前项目目录导出主题模板
$ xzdoc theme export
// 将会在当前目录下生成{xzdoc-templates/主题名}的目录
// 带上-s参数后,可以选择xzdoc提供的几种模板
$ xzdoc theme export -s pomelo
// 通过xzdoc build创建文档的时,优先读取该目录
// 导出主题模板后,自行修改,即可实现自定义模板的目的</code></pre><h2 id="-">查看文档效果</h2>
<p>通过将生成的文档放到gh-pages分支中,可以通过链接<a href="http://Yggdrasill-7C9.github.com/xzdoc">http://Yggdrasill-7C9.github.com/xzdoc</a>直接查看效果。</p>
<p>目前提供三种模板</p>
<h3 id="-">默认风格</h3>
<p><img src="https://raw.github.com/Yggdrasill-7C9/xzdoc/master/doc/default_style.png" alt="defautl 默认风格"></p>
<h3 id="wordpress-">wordpress风格</h3>
<p><img src="https://raw.github.com/Yggdrasill-7C9/xzdoc/master/doc/wordpress_style.png" alt="wordpress"></p>
<h3 id="pomelo-">pomelo风格</h3>
<h2 id="github-commonjs-">Github与CommonJS规范</h2>
<ul>
<li>每个github项目下应该有一个README.md文件</li>
<li>CommonJS规范建议文档存在在<code>doc</code>目录下</li>
<li>CommonJS规范建议代码存在在<code>lib</code>目录下</li>
</ul>
<p>xzdoc将会扫描项目下的README.md和doc目录下的md文件,通过markdown渲染,生成页面。扫描lib目录下的文件,通过dox解析内容,生成API文档页面。</p>
<h2 id="-">贡献者</h2>
<p>以下数据由<code>git-summary</code>于2012-10-27生成:</p>
<pre><code> project : xzdoc
repo age : 11 months
active : 21 days
commits : 89
files : 94
authors :
71 Yggdrasill-7C9 79.8%
10 youxiachai 11.2%
5 Lei Zongmin 5.6%
3 aleafs 3.4%
</code></pre><h2 id="license-mit-">License (MIT)</h2>
<p>MIT许可,请自由享用。</p>
<pre><code>Copyright (c) 2012 Yggdrasill-7C9
http://weibo.com/shyvo
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</code></pre><h2 id="-">捐赠</h2>
<p>如果您觉得本模块对您有帮助,欢迎请作者一杯咖啡</p>
<p><a href="https://me.alipay.com/Yggdrasill-7C9"><img src="https://img.alipay.com/sys/personalprod/style/mc/btn-index.png" alt="捐赠xzdoc"></a></p>
</section>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>此文档通过xzdoc生成。主题借鉴Bootstrap API文档风格,注解基于<a href="https://github.com/visionmedia/dox">Dox</a>。欢迎关注xzdoc作者<a href="http://weibo.com/shyvo" target="_blank">@朴灵</a></p>
<ul class="footer-links">
<li><a href="https://github.com/visionmedia/dox">Dox主页</a></li>
<li><a href="http://html5ify.com/xzdoc">xzdoc主页</a></li>
<li><a href="https://github.com/Yggdrasill-7C9/xzdoc">xzdoc源码</a></li>
<li><a href="https://github.com/Yggdrasill-7C9/xzdoc/issues?state=open">提交bug</a></li>
</ul>
</div>
</footer>
<script>
$(function() {
$('pre').addClass('prettyprint');
$('td pre').removeClass('prettyprint');
prettyPrint();
var $window = $(window);
var sidenav = $('.bs-docs-sidenav');
if (sidenav.height() < window.innerHeight) {
sidenav.affix({
offset: {
top: function () {
return $window.width() <= 980 ? 290 : 210
},
bottom: 200
}
});
} else {
sidenav.removeClass('affix');
}
$(".content").find('h1, h2, h3, h4, h5, h6').each(function () {
var node = $(this);
// 总是设置id
node.attr("id", node.data('id') || "index_" + node.text());
});
$('.bs-docs-sidenav .accordion-marker').on('click', function(event) {
var current = $(event.currentTarget);
current.find('.glyphicon').toggleClass('glyphicon-chevron-right glyphicon-chevron-down');
});
});
</script>
</body>
</html>