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

jade-doc

v1.10.0

Published

Jade documentation generator.

Downloads

43

Readme

Jade-doc

Jade-doc is a Jade documentation generator. It takes Jade files as input, looks for comments flagged with @jadedoc and puts its contents in an output JSON file.

This package does not provide a styled interface for the documentation itself. Use jade-doc-html or jade-doc-markdown for human readable docs. Optionally use jade-doc-faucet for prettier terminal reporting.

Usage

Use the keyword @jadedoc to flag unbuffered block comments inside your jade files. Comments should be written in properly formatted YAML format.

//- @jadedoc
  name: my jadedoc
  description: this is a description for my jade doc
  beep: boop
  foo: faa

HTML Output

The immediate next Jade code block after the comment will be compiled to HTML output.

//- @jadedoc
  name: some-node

div.this-is-output-for-jade-doc
div.this-isnt

Mixins

Optionally provide mixin arguments, attributes and example calls. If no examples are given, mixins will not be executed, so no output will be generated.

Arguments and attributes follow the jsdoc param syntax.

//- @jadedoc
  name: my mixin
  description: this is my mixin documentation
  arguments: 
    - {string} arg1 - this is the description of arg1
    - {number} arg2 - this is the description of arg2
  attributes: 
    - {string} attr1 - this is the description of attr1
    - {number} attr2 - this is the description of attr2
  examples:
    - +myMixin('foo', 1)
    - +myMixin('faa', 2, attr1='foo', attr2='faa')

mixin myMixin(arg1, arg2)
  div this is a mixin #{arg1} #{arg2} #{attr1} #{attr2}

Should you need multiline examples, use YAML's folded style, like:

  //- @jadedoc
    examples:
      - >
        +myMixin({
          foo: 'foo
        }

Locals

Jade locals can be also be passed.

//- @jadedoc
  name: tag
  locals:
    foo: foo

div #{foo}

Reserved words

  • arguments for mixin arguments.
  • attributes for (mixin) attributes.
  • locals for template locals.
  • examples for example mixin calls

How to use

npm install jade-doc

var jadeDoc = require('jade-doc');

jadeDoc({
  input: '**/*.jade',
  output: 'anything.json'
});

Command line

Optionally use it through the command line.

jade-doc input.jade
jade-doc input.jade --output output.json
jade-doc "**/*.jade" --output output.json

Output file

Output will look something like this.

[
  {
    "meta": {
      "name": "foo",
      "description": "foo description"
    },
    "file": "file.jade",
    "source": "// foo",
    "output": "<!-- foo-->"
  }
]