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

grunt-apidox

v3.1.1

Published

Grunt task to generate node.js module API markdown using apidox

Downloads

307

Readme

grunt-apidox    ci Coverage Status NPM version

Grunt plugin to generate Node.js API markdown using apidox.

Example:

grunt.initConfig(
{
    apidox: {
        input: 'index.js',
        output: 'README.md'
    }
});

grunt.loadNpmTasks('grunt-apidox');
grunt.registerTask('docs', 'apidox');

Installation

npm install grunt-apidox

Configuration

Use the apidox property in your Grunt config. You can supply the following options:

  • input (required, string): Source filename to generate documentation for. You can use Grunt globbing patterns to specify more than one file.

  • output (optional, string): Name of the file to write the markdown into. Defaults to the same as the input filename but with the extension changed to .md.

  • outdir (optional, string): Subdirectory to write output file into.

  • inputTitle (optional, string |false): By default, apidox includes a line in the markdown saying it was generated from the input file. Set inputTitle to false to prevent this, or set it to a string to change the text.

  • fullSourceDescription (optional, boolean): By default, apidox includes only the first paragraph of the first comment in the output. Set fullSourceDescription to true to include all of the first comment in the output.

  • sections (optional, object): Use this to divide the table of contents into sections. Each key in sections is the name of the first function in a section. The value is the markdown to insert before the link to the function in the table of contents.

    Use a key with the empty string to insert markdown after the table of contents.

  • extraHeadingLevels (optional, integer): By default, apidox generates level 1 headings for each API entry. Set extraHeadingLevels if you want to change this. For example, to generate level 3 headings, set extraHeadingLevels to 2.

More Examples

Write to a subdirectory:

apidox: {
    input: 'index.js',
    output: 'README.md',
    outdir: 'docs'
}

Set the text of the source link in the markdown to bar:

apidox: {
    input: 'index.js',
    output: 'README.md',
    inputTitle: 'bar'
}

Don't show source link:

apidox: {
    input: 'index.js',
    output: 'README.md',
    inputTitle: false
}

Write to index.md:

apidox: 'index.js'

Use a wildcard to process multiple source files and generate a separate markdown file for each one:

apidox: {
    input: '*.js',
    outdir: 'docs'
}

Use a wildcard to process multiple source files and generate a single markdown file:

apidox: {
    input: '*.js',
    output: 'README.md'
}

Split the table of contents into two sections, foo and bar:

apidox: {
    input: 'index.js',
    sections: {
        someFunction: '##foo',
        someOtherFunction: '##bar'
    }
}

Licence

MIT

Tests

grunt test

Lint

grunt lint

Code Coverage

grunt coverage

c8 results are available here.

Coveralls page is here.

Source: tasks/apidox.js

—generated by apidox