Skip to content

Commit

Permalink
Generates documentation in md format for wiki.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarcon committed Sep 22, 2015
1 parent a2764c8 commit b19ec43
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Expand Up @@ -109,11 +109,11 @@ module.exports = function(grunt) {
doxdox: {
jhere: {
input: 'src/modules/core.js',
output: 'out/docs/index.html',
output: 'out/docs/docs.md',
config: {
title: 'jHERE',
description: 'Maps made easy',
layout: 'docs/template.hbs'
layout: 'docs/markdown-template.hbs'
}
}
}
Expand Down
65 changes: 65 additions & 0 deletions docs/markdown-template.hbs
@@ -0,0 +1,65 @@
{{#if pkg.homepage}}
# [{{title}}]({{pkg.homepage}}) {{#if pkg.version}}*{{pkg.version}}*{{/if}}
{{else}}
# {{title}} {{#if pkg.version}}*{{pkg.version}}*{{/if}}
{{/if}}

{{#if description}}
>{{description}}
{{/if}}

{{#each files}}{{#each methods}}

## {{name}}({{params}}) {{#if isPrivate}} *private method*{{/if}}

{{{description}}}

{{{body}}}

{{#if tags.param}}

### Parameters

{{#each tags.param}}
- **{{name}}** {{#each types}}`{{.}}` {{/each}} {{#if isOptional}}*Optional*{{/if}} {{{description}}}
{{/each}}

{{/if}}

{{#if tags.property}}

### Properties

{{#each tags.property}}
- **{{name}}** {{#each types}}`{{.}}` {{/each}} {{#if isOptional}}*Optional*{{/if}} {{{description}}}
{{/each}}

{{/if}}

{{#if tags.example}}

### Examples

{{#each tags.example}}
```javascript
{{{.}}}
```
{{/each}}

{{/if}}

### Returns

{{#if tags.return}}

{{#each tags.return}}
- {{#each types}}`{{.}}` {{/each}} {{#if isOptional}}*Optional*{{/if}} {{{description}}}
{{/each}}

{{else}}

- `Void`

{{/if}}

{{/each}}{{/each}}
6 changes: 3 additions & 3 deletions src/modules/core.js
Expand Up @@ -66,7 +66,7 @@ JH._makemap = function(){

/**
* Sets the center of the map
*
*
* @example
* //Sets the new center with animation
* map.center({lat: 52.1, lng: 13.23}, true)
Expand Down Expand Up @@ -105,8 +105,8 @@ JH.zoom = function(newZoomLevel, animate){
};

/**
* @param {string}
* @param {string}
* @param {string} type
* @param {string} layer
* @return {Object} the instance of jHERE for chainability
*/
JH.type = function(type, layer){
Expand Down

0 comments on commit b19ec43

Please sign in to comment.