Skip to content

Commit

Permalink
Add API docs. Add table of contents.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Jan 14, 2014
1 parent 77dc21c commit 6f46710
Show file tree
Hide file tree
Showing 38 changed files with 2,546 additions and 2,254 deletions.
10 changes: 1 addition & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@ module.exports = function(grunt){
description: '<%= hexo.description %>',
version: '<%= hexo.version %>',
options: {
paths: [
'tmp/hexo/lib/core',
'tmp/hexo/lib/error',
'tmp/hexo/lib/extend',
'tmp/hexo/lib/logger',
'tmp/hexo/lib/model',
'tmp/hexo/lib/post',
'tmp/hexo/lib/util'
],
paths: 'tmp/hexo/lib',
outdir: 'tmp/hexo-out'
}
},
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ $ hexo server

- [Hexo](http://zespia.tw/hexo/)

Installation: <http://zespia.tw/hexo/docs/>

``` bash
$ npm install hexo -g
```
- [YUIDoc](http://yui.github.io/yuidoc/)
``` bash
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo",
"version": "2.3.0",
"version": "2.4.5",
"private": true,
"dependencies": {},
"devDependencies": {
Expand All @@ -11,4 +11,4 @@
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "~0.4.1"
}
}
}
30 changes: 30 additions & 0 deletions scripts/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var helper = hexo.extend.helper;

var links = {
index: 'https://github.com/tommy351/hexo',
warehouse: 'https://github.com/tommy351/warehouse'
};

var rTmpDir = /^tmp\/(\w+)\//;

helper.register('github_link', function(data){
var name = data.file.match(rTmpDir)[1];

if (name === 'hexo') name = 'index';

var path = data.file.replace(rTmpDir, ''),
line = data.line,
version = this.site.yuidoc.findByName(name).project.version || 'master';

return '<a href="' + links[name] + '/blob/' + version + '/' + path + '#L' + line + '">' + path + ':' + line + '</a>';
});

helper.register('item_flags', function(data){
var result = '';

['static', 'chainable', 'async', 'final'].forEach(function(i){
if (data[i]) result += '<span class="api-item-flag ' + i + '">' + i + '</span>';
});

return result;
});
4 changes: 2 additions & 2 deletions scripts/note.js → scripts/tags.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var extend = hexo.extend,
var tag = hexo.extend.tag,
renderSync = hexo.render.renderSync;

extend.tag.register('note', function(args, content){
tag.register('note', function(args, content){
var className = args.shift(),
header = '';

Expand Down
Loading

0 comments on commit 6f46710

Please sign in to comment.