Giter Site home page Giter Site logo

documentationjs / documentation Goto Github PK

View Code? Open in Web Editor NEW
5.8K 5.8K 482.0 7.39 MB

:book: documentation for modern JavaScript

Home Page: http://documentation.js.org/

License: Other

JavaScript 95.88% CSS 4.01% Vue 0.09% Shell 0.02%
babel documentation documentation-tool javascript jsdoc

documentation's People

Contributors

anandthakker avatar andrewdelprete avatar anthony-redfox avatar arv avatar batje avatar beaugunderson avatar birkskyum avatar coliff avatar danez avatar davedoesdev avatar dependabot[bot] avatar devongovett avatar dignifiedquire avatar fgnass avatar greenkeeper[bot] avatar hugomrdias avatar ikokostya avatar irgendwr avatar jaydenseric avatar jfirebaugh avatar lavrton avatar mbullington avatar mmomtchev avatar monkbroc avatar montogeek avatar mourner avatar nharris-star2star avatar rhendric avatar tmcw avatar transitive-bullshit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

documentation's Issues

more opinionated pivot operation

The output that pivot generates is still cumbersome to work with. It would be better to be opinionated about what tags are expected to be singular, and use a non-array value for them. Also, a lot of unnecessary structure should be collapsed.

E.g. instead of:

{
  tags: {
    name: [{title: "name", name: "Foo"}]
  }
}

It should just be:

{
  name: "Foo"
}

Look to the output of jsdoc -X for guidance.

Infer parameters

It's possible to infer parameters names from code. I'm not sure if this is a useful feature, though, since it opens a door to developer laziness.

documentation bin should support simple relative paths

Trying to run documentation on documentation's own index.js:

$ documentation index.js

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Cannot find module 'index.js' from '/Users/john/Development/documentation'
    at /usr/local/lib/node_modules/documentation/node_modules/module-deps/node_modules/resolve/lib/async.js:46:17
    at process (/usr/local/lib/node_modules/documentation/node_modules/module-deps/node_modules/resolve/lib/async.js:173:43)
    at ondir (/usr/local/lib/node_modules/documentation/node_modules/module-deps/node_modules/resolve/lib/async.js:188:17)
    at load (/usr/local/lib/node_modules/documentation/node_modules/module-deps/node_modules/resolve/lib/async.js:69:43)
    at onex (/usr/local/lib/node_modules/documentation/node_modules/module-deps/node_modules/resolve/lib/async.js:92:31)
    at /usr/local/lib/node_modules/documentation/node_modules/module-deps/node_modules/resolve/lib/async.js:22:47
    at Object.oncomplete (fs.js:107:15)

documentation ./index.js produces more interesting results. But unlike require, relative paths not prefixed with ./ should be supported here.

Show or link code with docs

This is sometimes useful: should we extract and embed code alongside the actual doc output, or provide links to GitHub or?

With the merged context branch we now have loc data and code snippets in docs. We can link to github in a transformer given a base path.

Fix lends

Right now lends is missing stuff like the addTo method on the Popup control of Mapbox GL.

Search

I don't think we should try to implement serverless search, but rather have templates by default have swiftype markup and a toggle-able swiftype option.

implement name inference as stream transform

If possible, this would be a great way to separate concerns. We'd have the main parser attach an AST subtree to each comment, and could have separate stream transforms to do not only name inference but other context-sensitive things like memberof inference.

--lint

  • "function named exports: do you want to name this function?"
  • String where string was expected, object where Object was expected
  • Unsupported tag detected: this shouldn't happen until we support way more tags
  • Normalization detected

HTML Output

We should support pretty / beautiful HTML output as the default HTML output.

Template engine

  • Could go whole-hog with something like consolidate.js, but I feel like supporting something simple like ejs or underscore templates would work.

Move docset generator out of core

While sqlite3 has the beezneez of native module packaging, it's still a native module and still makes documentationjs installation more uncertain than it should be.

Markdown output

This would be something similar to doxme: README-friendly GFM output.

  • Add configurable template option on bin level
  • Helper function that formats type descriptions into Markdown
  • Figure out when and where to run pivot

Documentation

This project should be heavily documented, inside and out. Every single function should be documented.

skipSingleStar

Need this behavior, but does it need to be an option? Can it be the default?

transform to type hierarchy

Documentation for OO libraries is typically organized like:

# Module
## Class
### Static methods
### Instance methods
### Events

There should be a transform that can group comments into a hierarchy like that, so that it's easy to flow them into a template.

Links for types from other modules

If I @returns {boolean} I get a nice link to the documentation for booleans.

However, if I @returns {BigInteger} I don't get a link because documentation doesn't know what it is (though it might be able to infer it by seeing that there's a BigInteger variable that's required from a node module and use the homepage from its package.json for the URL)...

Browserify transform mode

Transform

/**
 * this does foo
 * @returns {number} foo
 */
module.exports = function() { return 42; };

Into

module.exports = function() { return 42; };
Object.defineProperty(module.exports, '__documentation__', {
    enumerable: false,
    value: {
        // parsed comment
        tags: []
        description: 'this does foo'
    }
});

And then traverse object hierarchy of module.exports to correctly name everything.

May be a terrible idea. /cc @jfirebaugh

Tag Support Master Ticket

✔︎: full support
➖: partial support
✘: no support

Complete

Tag Core Markdown HTML Issues
@alias ✔︎ ✔︎ ✔︎
@async
@augments ✔︎ ✔︎ ✔︎
@deprecated ✔︎︎ ✔︎︎︎︎ ✔︎︎︎︎
@description ✔︎︎ ✔︎ ✔︎
@copyright ✔︎︎ ✔︎ ✔︎
@example ✔︎︎︎︎ ✔︎︎︎︎ ✔︎︎︎︎
@author ✔︎ ✔︎ ✔︎
@function ✔︎︎︎︎ ✔︎ ✔︎
@global ✔︎︎︎︎ ✔︎ ✔︎
@ignore ✔︎︎︎︎ ✔︎ ✔︎
@instance ✔︎︎︎︎ ✔︎ ✔︎
@lends ✔︎︎︎︎ ✔︎︎ ✔︎︎ lends is an inference hint
@license ✔︎︎︎︎ ✔︎ ✔︎
@name ✔︎︎︎︎ ✔︎ ✔︎
@param ✔︎︎︎︎ ✔︎ ✔︎
@throws ✔︎︎︎︎ ✔︎ ✔︎
@member ✔︎︎︎︎ ✔︎ ✔︎
@version ✔︎ ✔︎ ✔︎
@returns ✔︎︎︎︎ ✔︎ ✔︎
@since ✔︎ ✔︎ ✔︎
@static ✔︎︎︎︎ ✔︎ ✔︎
@property ✔︎︎︎︎ ✔︎ ✔︎

Unfinished

Tag Core Markdown HTML Issues
@abstract ✔︎
@access ✔︎
@borrows ✘︎
@inner ✔︎︎︎︎ ✔︎ ✔︎
@callback ✔︎︎
@class ✔︎︎
@classdesc ✔︎︎ #109
@constant ✔︎︎
@constructs ✘︎︎
@default ✘︎︎
@enum ✘︎︎
@event #96
@exports ✘︎︎
@external ✔︎︎︎︎
@file ✔︎︎︎︎
@fires ✘︎︎︎︎
@implements ✘︎︎︎︎
@inheritdoc ✘︎︎︎︎
@interface ✔︎︎︎︎
@kind ✔︎︎︎︎
@listens ✘︎︎︎︎
@memberof ✔︎ ✔︎ #189
@mixes ✘︎︎︎︎
@mixin ✔︎︎︎︎
@module ✔︎︎︎︎
@namespace ✔︎︎︎︎
@override ✔︎︎︎︎
@private ✔︎
@protected ✔︎
@public ✔︎
@readonly ✔︎
@requires ✘︎︎︎︎
@see ✔︎
@summary ✔︎ #341
@this ✘︎︎︎︎
@todo ✔︎
@tutorial ✘︎︎︎︎
@type ✔︎
@typedef ✔︎ #372
@variation ✔︎

ES6 support

Currently blocked by lack of parser support: http://esprima.org/doc/es6.html

Running list of things to support:

  • Switch to espree

  • JSDocs in destructuring assignment:

    { /** docs */ a, /** docs */ b } = { ... }
    

Infer kinds from AST

/**
 * @param {number} a foo
 */
function bar() {
}

Should infer a kind: function tag out of the fact that it's attached to a function

Transformers

We should support babel and coffeescript to cast the net as wide as possible.

  • browserify transforms

Code coverage

Should be able to maintain 100% code coverage for this module fairly easily.

JSON configuration file

Akin to .jshintrc or such, we could support declarative configuration - or we could support a more like docfile.js convention and recommend everyone use the JS API

Infer function names from code

For instance

/**
 * This function returns the number one.
 * @return {Number} numberone
 */
function returnOne() {
  // this returns 1
  return 1;
}

Should infer a @name returnOne tag.

  • What other names should we infer?
  • What about function expressions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.