# mg-docs

> Simple documentation generator written in Node that allows you to write documentation on a page by page basis.

Latest version **1.0.12** (published 2019-12-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install mg-docs
pnpm add mg-docs
yarn add mg-docs
bun add mg-docs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2019-12-10 |
| First published | 2019-08-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 137.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | MacLaurin Group |
| Maintainers | a1anw2 |

## Links

- npm: https://www.npmjs.com/package/mg-docs
- Repository: https://github.com/MacLaurinGroup/mg-docs
- Homepage: https://github.com/MacLaurinGroup/mg-docs#readme
- Issues: https://github.com/MacLaurinGroup/mg-docs/issues
- npm.io page: https://npm.io/package/mg-docs

## Recent versions

- 1.0.12 (latest) — 2019-12-10
- 1.0.11 — 2019-12-10
- 1.0.10 — 2019-11-27
- 1.0.9 — 2019-11-26
- 1.0.8 — 2019-11-26
- 1.0.7 — 2019-08-30
- 1.0.6 — 2019-08-30
- 1.0.5 — 2019-08-30
- 1.0.4 — 2019-08-30
- 1.0.3 — 2019-08-30
- 1.0.2 — 2019-08-30
- 1.0.1 — 2019-08-30
- 1.0.0 — 2019-08-30

## README

# mg-docs
A simple node package that runs through html files and produces a documentation file.

## Installation
In the root folder of your project with your `package.json` run:
```
npm install mg-docs --save-dev
```

## Configuration
There is a sample `config.json` file in `src` folder which has parameters you can set up to customize the end documentation page.

Params that should be in the `config.json` are as follows:

Parameter | Required | Description | Example
------------ | --------- | ------ | ------
`includeTags` | false | an array of tags to include, if empty all snippets will be included | `["dev", "admin"]`
`excludeTags` | false | an array of tags to exclude | `["dev", "admin"]`
`showTags` | false | boolean for displaying tags | 
`jsFiles` | false | an array of file paths pointing to js files to be included | `["./jsfile.js", "./jsfile2.js"]`
`cssFiles` | false | an array of file paths pointing to css files to be included | `["./cssfile.css"]`
`jqueryFile` | false | file path to the jquery file, if blank it will use jquerys CDN | 
`pageConfig.header.title` | false | title for the page |
`pageConfig.header.heading` | false | heading text for the page | 
`pageConfig.header.introText` | false | heading paragraph for the page |

## To build

In order to build the html file with the documentation you will need to configure the `config.json` shown above. You will also need to specify the input directory, output file and the config file by running:

```
node ./node_modules/mg-docs/index.js --config-file your/new/path.json --input-dir ./input/ --output-file ./output.html
```


## Documentation
An example of a documentation snippet in an html file:
```
<mg-docs>
  <mg-tag>Admin</mg-tag>
  <mg-order>12</mg-order>
  <mg-id>124</mg-id>

  <mg-title>mgdocs</mg-title>
  <mg-body>
    snippet body

    <mg-section>
      <mg-sectiontitle>mgdocs subsection</mg-sectiontitle>
      <mg-sectionbody>
        this is a subsection body
      </mg-sectionbody>
    </mg-section>

    <mg-section>
      <mg-sectiontitle>Subsection B</mg-sectiontitle>
      <mg-sectionbody>
        this is a subsection body
      </mg-sectionbody>
    </mg-section>
  </mg-body>
</mg-docs>
```

will produce:
![mg-docs demo](/images/mg-docs-demo.JPG)


## Tags

Tag | required | description
------|------|-----
`<mg-docs>` | true | This is the wrapper tag required to be picked up by the process
`<mg-title>` | false | defines the title for a `<mg-docs>`
`<mg-body>` | false | defines the body text for a `<mg-docs>`
`<mg-tag>` | false | defines tags for a `<mg-docs>` to be filtered upon on the page
`<mg-id>` | false | defines the id for a `<mg-docs>` for linking purposes
`<mg-order>` | false | defines an index for the `<mg-docs>`'s to be ordered against
`<mg-section>` | false | defines a section of text for a `<mg-docs>`
`<mg-sectiontitle>` | false | defines the title for a `<mg-section>`
`<mg-sectionbody>` | false | defines the body text for a `<mg-section>`

---
_Source: https://npm.io/package/mg-docs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
