Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

[![NPM version](https://badge.fury.io/js/docular.svg)](http://badge.fury.io/js/docular)

#New Beta Version
# New Beta Version
Version 0.8.x is out. The API at this point should be considered stable.

#Docular
# Docular

Extensible Documentation Generation Based on AngularJS's Documentation Generation

#Grunt Plugin For Docular: "grunt-docular"
# Grunt Plugin For Docular: "grunt-docular"

Docular is best used as a dependency by the grunt-docular plugin.
The grunt-docular plugin exposes the api in a simple fashion and helps you include documentation tasks in your grunt-based build process.
Expand Down
8 changes: 4 additions & 4 deletions docs/configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Configuration
# Configuration

Docular has a small set of configuration options that you should be familiar with. When you configure docular, you
are actually configuring the base 'group'. Each 'group' accepts the same parameters, but some are only respected
Expand All @@ -8,7 +8,7 @@ Docular is also split up into plugins. The primary codebase is responsible for s

All plugin parameters are part of the group object, unless otherwise specified.

##Docular parameters
## Docular parameters

Required parameters are in **bold**.

Expand All @@ -32,7 +32,7 @@ Required parameters are in **bold**.
| showDocularDocs | ```false``` | Should Docular docs be included in the output? If so, they will be listed under a 'Docular' tab. |
| useHtml5Mode | ```false``` | Whether or not to use Angular's HTML5 mode. If you use this mode, you must have the proper hosting setup to serve html5 mode pages. Docular's grunt task comes with a simple server that will do this for you, but should not be considered production-ready.|

##docular-ng-plugin parameters.
## docular-ng-plugin parameters.

Required parameters are in **bold**.

Expand All @@ -45,7 +45,7 @@ Required parameters are in **bold**.
| examples.include.js | ```empty array``` | An array of javascript files that should be included in the examples. This is relative to the root of the docular application. For example, ```['./doc_files/start.js']```. This will cause the examples to load a file called ```start.js```.|
| examples.include.css | ```empty array``` | Basically the exact same thing as ```examples.include.js```, except is meant for CSS files |

##Notes on backwards compatibility with 0.6.x
## Notes on backwards compatibility with 0.6.x

* The section key is read in as a group key.
* The scripts and docs keys are read in and appended to the files key.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#Docular docs
# Docular docs
304 changes: 152 additions & 152 deletions docs/installation/index.md
Original file line number Diff line number Diff line change
@@ -1,153 +1,153 @@
#Installation
Installing docular is fairly straightforward. The most likely way you will use docular is through its
[grunt-docular](https://github.com/Vertafore/grunt-docular)
plugin. There are few prerequisites that you must manually take care of.
1. You need [Node.js](http://nodejs.org) installed.
2. You need [Grunt](http://www.gruntjs.com) installed.
3. You need to setup your package.json file.
4. You need to setup your Gruntfile.js file.
##Installing Node
For most systems, installing Node is straightforward. For Windows and Mac, there are prebuilt installers available
on the Node.js [download page](http://nodejs.org/download/). Most linux systems will install Node through their own
package system, though some do not bundle NPM (Node Package Manager) with the Node application. For instance, in Ubuntu
you need to run ```sudo apt-get install nodejs``` and then ```sudo apt-get install npm```.
##Installing Grunt
In order to run Grunt via the command line, as you'll have to do in order to run the grunt-docular task, you will need
to install the [grunt-cli](https://www.npmjs.org/package/grunt-cli) package. Since it's an executable, you need to
install it with NPM globally. This is done by running ```npm install -g grunt-cli```.
##Setting up your package.json file
Current docular versions:
* docular: [![NPM version](https://badge.fury.io/js/docular.svg)](http://badge.fury.io/js/docular)
* grunt-docular: [![NPM version](https://badge.fury.io/js/grunt-docular.svg)](http://badge.fury.io/js/grunt-docular)
If you aren't familiar with what a package.json file is, you should probably [read through the docs](https://www.npmjs.org/doc/files/package.json.html).
The shorter version is that you will want a file setup like this:
```js
{
"name": "YourProjectName",
"version": "0.0.1",
"devDependencies": {
}
}
```
The ```devDependencies``` key is the important one to note. Normally you'd add your dependencies in via the ```dependencies```
key. However, grunt-docular isn't something that your application requires to run. It is only necessary as a tool for
development, hence the ```devDependencies```.
Inside of ```devDependencies```, add ```"grunt": "~0.4.0"``` and ```"grunt-docular": "~TheVersionAbove"```. In case you
aren't familiar, the tilde tells NPM to install a version that is "reasonably close" to the specified version. This
will ensure you get bugfixes, but shouldn't cause you to switch to minor or major releases.
After you have those two items added to ```devDependencies```, run ```npm install```. This will spider through all of the
dependencies and install them.
##Setting up your Gruntfile.js
Specific configuration parameters can be found in the @{link configuration/index configuration docs}.
Setting up your Gruntfile.js to look like the following:
```js
module.exports = function (grunt) {
grunt.initConfig({
docular: {
//We'll fill in this in a minute
}
});
grunt.loadNpmTasks('grunt-docular');
}
```
Now that you've got that, we need to give Docular instructions on how to generate its files. First, let's tell it
where to put the generated files by setting the ```docular_webapp_target``` directory to ```docs```. Then, lets have
it show the angular docs by default by adding in the key ```showAngularDocs``` with the value of ```true```. Finally,
we want to give the site a title. Set the ```groupTitle``` key to the name of your site - for example "My Docs".
Now, run ```grunt docular```. You should see some text fly by as Angular gets downloaded, parsed, and then generated
into documentation. This is great, but you need to actually be able to see it.
There are a couple options here.
###Using grunt-docular's builtin server.
One of Docular's contributors added a small webserver to it called 'docularserver'. To make that work,
add the follwoing to your initConfig object:
```js
docularserver: {
targetDir: 'docs',
port: 8888
}
```
Then run ```grunt docularserver```. Voila - your documentation has been served.
###Using a third party server
You could serve these files up with something like Apache.. or you can try serving them with another Grunt task.
One of the grunt file servers out there is called 'devserver'. To install, you add ```"devserver": "*"``` to your
```devDependencies```, run ```npm install``` again, and add the following to your initConfig object:
```js
devserver: {
docs: {
options: {
base: './docs',
port: 8888
}
}
}
```
This will allow you to run ```grunt devserver:docs```, which will serve up all the files on the machine's IP address
and specified port. For example, [http://localhost:8888](http://localhost:8888).
##Documentation generation for your code
In the ```docular``` section of the config, add a ```groups``` array. Inside of that array, we need a minimum of:
* groupTitle - the title of this section of documentation... such as "Site Controls"
* groupId - the ID that is to be used to keep groups organized and make it easier to find code that relates to one another.
For example, 'siteControls'.
* files - a list of files that need to be parsed. The best way of providing this is by using ```grunt.file.expand```,
which accepts a series of file filters.
For example:
```js
module.exports = function (grunt) {
grunt.initConfig({
docular: {
groupTitle: 'My documentation site',
groups: [
{
groupTitle: 'Site Controls',
groupId: 'siteControls',
files: grunt.file.expand(['public/javascript/**/*.js'])
}
]
}
});
grunt.loadNpmTasks('grunt-docular');
}
```
# Installation

Installing docular is fairly straightforward. The most likely way you will use docular is through its
[grunt-docular](https://github.com/Vertafore/grunt-docular)
plugin. There are few prerequisites that you must manually take care of.

1. You need [Node.js](http://nodejs.org) installed.
2. You need [Grunt](http://www.gruntjs.com) installed.
3. You need to setup your package.json file.
4. You need to setup your Gruntfile.js file.

## Installing Node

For most systems, installing Node is straightforward. For Windows and Mac, there are prebuilt installers available
on the Node.js [download page](http://nodejs.org/download/). Most linux systems will install Node through their own
package system, though some do not bundle NPM (Node Package Manager) with the Node application. For instance, in Ubuntu
you need to run ```sudo apt-get install nodejs``` and then ```sudo apt-get install npm```.

## Installing Grunt

In order to run Grunt via the command line, as you'll have to do in order to run the grunt-docular task, you will need
to install the [grunt-cli](https://www.npmjs.org/package/grunt-cli) package. Since it's an executable, you need to
install it with NPM globally. This is done by running ```npm install -g grunt-cli```.

## Setting up your package.json file

Current docular versions:
* docular: [![NPM version](https://badge.fury.io/js/docular.svg)](http://badge.fury.io/js/docular)
* grunt-docular: [![NPM version](https://badge.fury.io/js/grunt-docular.svg)](http://badge.fury.io/js/grunt-docular)

If you aren't familiar with what a package.json file is, you should probably [read through the docs](https://www.npmjs.org/doc/files/package.json.html).
The shorter version is that you will want a file setup like this:

```js
{
"name": "YourProjectName",
"version": "0.0.1",
"devDependencies": {

}
}
```

The ```devDependencies``` key is the important one to note. Normally you'd add your dependencies in via the ```dependencies```
key. However, grunt-docular isn't something that your application requires to run. It is only necessary as a tool for
development, hence the ```devDependencies```.

Inside of ```devDependencies```, add ```"grunt": "~0.4.0"``` and ```"grunt-docular": "~TheVersionAbove"```. In case you
aren't familiar, the tilde tells NPM to install a version that is "reasonably close" to the specified version. This
will ensure you get bugfixes, but shouldn't cause you to switch to minor or major releases.

After you have those two items added to ```devDependencies```, run ```npm install```. This will spider through all of the
dependencies and install them.

## Setting up your Gruntfile.js

Specific configuration parameters can be found in the @{link configuration/index configuration docs}.

Setting up your Gruntfile.js to look like the following:

```js

module.exports = function (grunt) {
grunt.initConfig({
docular: {
//We'll fill in this in a minute
}
});

grunt.loadNpmTasks('grunt-docular');

}

```

Now that you've got that, we need to give Docular instructions on how to generate its files. First, let's tell it
where to put the generated files by setting the ```docular_webapp_target``` directory to ```docs```. Then, lets have
it show the angular docs by default by adding in the key ```showAngularDocs``` with the value of ```true```. Finally,
we want to give the site a title. Set the ```groupTitle``` key to the name of your site - for example "My Docs".

Now, run ```grunt docular```. You should see some text fly by as Angular gets downloaded, parsed, and then generated
into documentation. This is great, but you need to actually be able to see it.

There are a couple options here.

### Using grunt-docular's builtin server.
One of Docular's contributors added a small webserver to it called 'docularserver'. To make that work,
add the follwoing to your initConfig object:

```js
docularserver: {
targetDir: 'docs',
port: 8888
}
```

Then run ```grunt docularserver```. Voila - your documentation has been served.

### Using a third party server

You could serve these files up with something like Apache.. or you can try serving them with another Grunt task.

One of the grunt file servers out there is called 'devserver'. To install, you add ```"devserver": "*"``` to your
```devDependencies```, run ```npm install``` again, and add the following to your initConfig object:

```js
devserver: {
docs: {
options: {
base: './docs',
port: 8888
}
}
}
```
This will allow you to run ```grunt devserver:docs```, which will serve up all the files on the machine's IP address
and specified port. For example, [http://localhost:8888](http://localhost:8888).

## Documentation generation for your code

In the ```docular``` section of the config, add a ```groups``` array. Inside of that array, we need a minimum of:

* groupTitle - the title of this section of documentation... such as "Site Controls"
* groupId - the ID that is to be used to keep groups organized and make it easier to find code that relates to one another.
For example, 'siteControls'.
* files - a list of files that need to be parsed. The best way of providing this is by using ```grunt.file.expand```,
which accepts a series of file filters.

For example:

```js

module.exports = function (grunt) {
grunt.initConfig({
docular: {
groupTitle: 'My documentation site',
groups: [
{
groupTitle: 'Site Controls',
groupId: 'siteControls',
files: grunt.file.expand(['public/javascript/**/*.js'])
}
]
}
});

grunt.loadNpmTasks('grunt-docular');

}

```

Run ```grunt docular``` again, and you should see your documentation pop up on the site.
Loading