1.0.12 • Published 4 years ago

mg-docs v1.0.12

Weekly downloads
15
License
ISC
Repository
github
Last release
4 years ago

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:

ParameterRequiredDescriptionExample
includeTagsfalsean array of tags to include, if empty all snippets will be included["dev", "admin"]
excludeTagsfalsean array of tags to exclude["dev", "admin"]
showTagsfalseboolean for displaying tags
jsFilesfalsean array of file paths pointing to js files to be included["./jsfile.js", "./jsfile2.js"]
cssFilesfalsean array of file paths pointing to css files to be included["./cssfile.css"]
jqueryFilefalsefile path to the jquery file, if blank it will use jquerys CDN
pageConfig.header.titlefalsetitle for the page
pageConfig.header.headingfalseheading text for the page
pageConfig.header.introTextfalseheading 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

Tags

Tagrequireddescription
<mg-docs>trueThis is the wrapper tag required to be picked up by the process
<mg-title>falsedefines the title for a <mg-docs>
<mg-body>falsedefines the body text for a <mg-docs>
<mg-tag>falsedefines tags for a <mg-docs> to be filtered upon on the page
<mg-id>falsedefines the id for a <mg-docs> for linking purposes
<mg-order>falsedefines an index for the <mg-docs>'s to be ordered against
<mg-section>falsedefines a section of text for a <mg-docs>
<mg-sectiontitle>falsedefines the title for a <mg-section>
<mg-sectionbody>falsedefines the body text for a <mg-section>
1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago