npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mg-docs

v1.0.12

Published

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

Downloads

9

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

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>