Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1: Create README.md #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# dr.js
Tiny documentation builder

This is a JavaScript tool for creating documentation for your JavaScript files. It’s written in nodejs and very easy to use.

##Usage:

node dr.js <custom>.json

Format of custom.json is as follows
```
{
"title": "MyProject",
"output": "path/to/final/doc.html",
"scripts": ["jquery.js"], // optional scripts to include into final doc
"files": [{
"url": "path/to/file.js",
"link": "https://github.com/optional/link/to/file.js"
}]
}
```
Script runs over given files in search for special format of comment

##Comments format:

Each comment section starts with the following line:

/*\

And ends with this one:

\*/

Each line in a comment block is starting with a symbol that represents type of the line.

* `*` means plain text with markdown support
* `|` means line of JavaScript code
* `-` means parameter description
* `>` means sub header
* `o` means object description
* `#` means HTML. Following text will be taken as is and put into resulting document without any changes
* `= <type> [description]` means return-type of function with given description

First line is always a name of a section. Dr.js will analyze the names and build the tree of objects and methods. The output will be alphabetised.

**Example:**

```
* Raphael.bezierBBox
[ method ]
**
* Utility method
**
* Return bounding box of a given cubic bezier curve
> Parameters
- p1x (number) x of the first point of the curve
- p1y (number) y of the first point of the curve
- c1x (number) x of the first anchor of the curve
- c1y (number) y of the first anchor of the curve
- c2x (number) x of the second anchor of the curve
- c2y (number) y of the second anchor of the curve
- p2x (number) x of the second point of the curve
- p2y (number) y of the second point of the curve
* or
- bez (array) array of six points for bezier curve
= (object) point information in format:
o {
o min: {
o x: (number) x coordinate of the left point
o y: (number) y coordinate of the top point
o }
o max: {
o x: (number) x coordinate of the right point
o y: (number) y coordinate of the bottom point
o }
o }
```

**Output:**

[<img src="https://www.googledrive.com/host/0B4MMNHlRfGSzRFFkZTNYNDYyVzQ">](Output)


##License
Apache 2.0. See [LICENSE](./LICENSE)

##Contribute
* [Fork](https://help.github.com/articles/fork-a-repo) the repo.
* Create a branch:

git checkout -b my_branch

* Add your changes.
* Commit your changes:

git commit -am "Added some awesome stuff"

* Push your branch:

git push origin my_branch

* Make a [pull request](https://help.github.com/articles/using-pull-requests)