# atomdoc-md
Markdown generator for [atomdoc](https://github.com/atom/atomdoc).
Uses [donna]() and [tello]().

![](https://img.shields.io/travis/venkatperi/atomdoc-md.svg) [![npm](https://img.shields.io/npm/v/atomdoc-md.svg?maxAge=2592000)]()

See samples [here](https://github.com/venkatperi/atomdoc-md-samples).

#Installation
Install with [npm](https://www.npmjs.com/package/atomdoc-md)
```
npm install -g atomdoc-md

```

#Examples
## Generate docs
```
atomdoc-md generate <path to module>
```


#Usage
## Command Line

```
atomdoc-md generate <module>

Options:
  --doc, -o    docs directory  [default: "doc"]
  --level, -l  log level  [choices: "debug", "verbose", "info", "warn", "error"] [default: "info"]
  --template   template name  [default: "api"]
  --meta       write donna (donna.json) and tello (tello.json) metadata to doc dir
  --name, -n   generated file name  [default: "api.md"]
```

## From Node

```coffeescript
AtomdocMD = require 'atomdoc-md'

generator = new AtomdocMD( options );
generator.generateMarkdown()
```

## Generate `README.md`
```
# From the project's root

atomdoc-md generate -o . -n README.md .
```

## Importing Files
The default template `api` will include files `intro.md` and `appendix.md` into the output.
The files must be located in the `--doc` docs directory.



# <a name='classes'>API</a>

Class |  Summary
------| ------------
<code>[MarkdownGenerator](#class-MarkdownGenerator)</code> | Generates markdown from atomdoc/tello's metadata


### <a name="class-MarkdownGenerator">MarkdownGenerator</a><b><sub><sup><code>CLASS </code></sup></sub></b><a href="#classes"><img src="https://rawgit.com/venkatperi/atomdoc-md/master/assets/octicons/arrow-up.svg" alt="Back to Class List" height= "18px"></a>

<p>Generates markdown from atomdoc/tello&#39;s metadata</p>


<table width="100%">
  <tr>
    <td colspan="4"><h4>Methods</h4></td>
  </tr>
  
  <tr>
    <td><code>:: <b>constructor(</b> opt <b>)</b></code></td>
    <td width="8%" align="center"><sub>public</sub></td>
    <td width="8%" align="center"><sub>instance</sub></td>
    <td width="8%" align="center"><sub><a href="#class-MarkdownGenerator">MarkdownGenerator</a></sub></td>
  </tr>
  <tr>
    <td colspan="4">
      <ul>
  <li><code>opt</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> Options<ul>
  <li><code>opt.api</code> is an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> with <code>tello</code> api metadata.</li>
  <li><code>opt.path</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> path to file with <code>tello</code> api info</li>
  <li><code>opt.docdir</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> dir to write the output to. Also looks for files to import (e.g. <code>intro.md</code>).</li>
  <li><code>opt.template</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> name of the template to use</li>
  <li><code>opt.templatePath</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> alternatively, path to template dir</li>
  <li><code>opt.modulePath</code> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> path to the module (for package.json) </li>
  </ul>
  </li>
  </ul>
  
      <p>Create a new markdown generator</p>
  
      
    </td>
  </tr>
  
  <tr>
    <td><code>:: <b>generateMarkdown(</b>  <b>)</b></code></td>
    <td width="8%" align="center"><sub>public</sub></td>
    <td width="8%" align="center"><sub>instance</sub></td>
    <td width="8%" align="center"><sub><a href="#class-MarkdownGenerator">MarkdownGenerator</a></sub></td>
  </tr>
  <tr>
    <td colspan="4">
      
      <p>Writes markdown to the output file.</p>
  
      <p>  <em>Returns</em></p>
  <ul>
  <li>Returns a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> which resolves with the generated
  <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> when done.</li>
  </ul>
  
    </td>
  </tr>
  
</table>



# License
See [LICENSE](LICENSE).

<br>
<sub>Markdown generated by [atomdoc-md](https://github.com/venkatperi/atomdoc-md).</sub>
