Skip to content

Commit

Permalink
documentation and version bumb
Browse files Browse the repository at this point in the history
  • Loading branch information
hacksparrow committed Jan 18, 2016
1 parent f70ad75 commit b4a5725
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 13 deletions.
107 changes: 96 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ Strong-docs uses [Github Flavored Markdown](http://github.github.com/github-flav
To create a section you only need to provide a markdown header eg. `#` or `###`. The following example creates several sections.

# My Section

This is a paragraph.

## Sub Section

This is a paragraph within a sub section.

The first section `# My Section` will have a depth of 1 and the second's depth will be 2. See (section depth)[#section-depth] for more info.

#### Links / Anchors
Expand Down Expand Up @@ -133,7 +133,7 @@ Strong-docs supports linking to images absolutely (using regular markdown):

![Alt text](http://foo.com/path/to/img.jpg)
![Alt text](http://foo.com/path/to/img.jpg "Optional title")

Or you can bundled your images with your site using the [assets setting](#assets).

{
Expand Down Expand Up @@ -173,8 +173,8 @@ exports.escape = function(html){
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
};
```
```

See the [JSDoc](http://usejsdoc.org/) site for more examples.

##### Ignoring Annotations
Expand All @@ -191,7 +191,7 @@ To ignore an annotation change the comment block from `/**` to `/*!`.
// ...
```

You can also use the `@private` attribute to prevent your annotation from being rendered in your doc site.
You can also use the `@private` attribute to prevent your annotation from being rendered in your doc site.

```js
/**
Expand Down Expand Up @@ -227,10 +227,10 @@ The following is a list of configuration properties for strong-docs. You may spe
- **content** - default: 'content' - specify your [documentation source files](#documentation-source-files)
- **codeSectionDepth** - default `4` - specify the depth of [JavaScript sections](#section-depth)
- **assets** - path to your assets directory

### Content

Documentation will be rendered in the order it is listed in the content array. Below is an example content array with markdown, JavaScript, and an injected section.
Documentation will be rendered in the order it is listed in the content array. Below is an example content array with markdown, JavaScript, and an injected section.

[
"docs/overview.md",
Expand Down Expand Up @@ -261,7 +261,7 @@ Link to these files from your docs like this:

![Alt text](assets/img.jpg)
[My File](assets/pkg.zip)

## JSDoc Annotations

### Supported annnotations
Expand Down Expand Up @@ -332,3 +332,88 @@ Link to these files from your docs like this:
* typedef
* variation
* version

### StrongLoop annnotations

#### promise

Syntax: `@promise [{Types}] [resolve object]`

`Types` and `resolve object` must be specified for a promise-only function.

```
/**
* Function to test a standalone promise.
*
* @param {Array} An array parameter.
* @promise {Array} Resolves an Array.
*
*/
function promiseStandalone(arg) {
}
```

`Types` and `resolve object` are optional if the function also accepts a callback.
The promise details are derived from the callback.

```
/**
* Function to test promise from a callback.
*
* @param {Array} An array parameter.
*
* @callback {Function} callback This is the callback.
* @param {Error} err Error object.
* @param {Object} instance Model instance.
*
* @promise
*
*/
function promiseCallback(arg, callback) {
}
```

Specifying `Types` and `resolve object` will overwrite the defaults derived from
the callback.

```
/**
* Function to test custom promise details.
*
* @param {Array} An array parameter.
*
* @callback {Function} callback This is the callback.
* @param {Error} err Error object.
* @param {Object} instance Model instance.
*
* @promise {String} Custom resolve object of type String.
*
*/
function promiseCustom(arg, callback) {
}
```

A warning message will be printed on the console and the documentation page,
if the promise cannot be meaningfully resolve with respect to the callback
implementation.

``
/**
* Function to test unresolvable promise from a callback.
*
* @param {Array} An array parameter.
*
* @callback {Function} callback This is the callback.
* @param {Error} err Error object.
* @param {Object} instanceA first Model instance.
* @param {Object} instanceB second Model instance.
* @promise
*
*/
function promiseUnresolvable(arg, callback) {

}
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "strong-docs",
"description": "Sleek, intuitive, and powerful documentation site generator",
"version": "1.0.0",
"version": "1.1.0",
"repository": {
"type": "git",
"url": "git://github.com/strongloop/strong-docs.git"
Expand All @@ -16,7 +16,7 @@
"opener": "~1.3.0",
"express": "~3.4.0",
"js-yaml": "~2.1.0",
"dox": "iolo/dox",
"dox": "0.8.0",
"ejs": "~0.8.4",
"strong-task-emitter": "~0.0.5",
"markdown": "~0.5.0",
Expand Down

0 comments on commit b4a5725

Please sign in to comment.