291 Commits

Author SHA1 Message Date
Erik Arvidsson
e11c1ab3b5 Change document-exported to traverse the code (#533)
* Change document-exported to traverse the code

Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.

Fixes #515

* Move parseToAst to its own module

* Skip non export declarations for speed
2016-09-09 11:07:26 -04:00
Erik Arvidsson
a5ac4a798c Add a --sort-order option (#535)
Valid values for the `--sort-order` flag are `"source"` (default) and
`"alpha"`. When set to `"alpa"` the order of the entries in the docs
are sorted alphabetically.

Fixes #534
2016-09-08 18:26:02 -04:00
Erik Arvidsson
85ff818714 Fix issue with watch and shallow (#532)
When doing `--shallow --watch` we called `generator` (which
synchronously called `updateWatcher`/`addNewFiles`) but the watcher has
not been created yet. Instead create the watcher first before
`generator` is called.

Fixes #531
2016-09-08 18:14:13 -04:00
Erik Arvidsson
895775df7b Cleanup literal types (#522)
This updates Doctrine to 1.3 to pick up its support for literal types
(doctrine still does not support boolean literals types).

Towards #373
2016-09-04 16:43:28 -04:00
ikokostya
28d51fcaf8 Fix github link generation for Node.js 6 (#524)
In Node.js 6 additional assertions was added in path module:
https://github.com/nodejs/node/pull/5348
2016-09-04 16:41:06 -04:00
Tom MacWright
0a97e0eccc Continue to close the gap with flow (#520)
* Adds test support for flow difference
* New support for FunctionTypeAnnotation
* New support for ObjectTypeAnnotation
* New support for MixedTypeAnnotation
2016-09-01 16:32:47 -04:00
Erik Arvidsson
d2b93aee94 Add support for null and void types (#519)
This adds support for `void` and `null` in type annotations:

```js
function f(): void {}
function g(): null {
  return null;
}
```

Towards #512
2016-09-01 15:18:42 -04:00
Erik Arvidsson
6b981e0780 Add the type property to typedef comments (#517)
* Add the type property to typedef comments

When using Flow type aliases we didn't add the `type` property
to the JSDoc comment for the inferred `typedef`.

Fixes #516

* Rename files and update test expectations
2016-09-01 10:12:30 -04:00
Erik Arvidsson
b469bb7079 Fix the name of infer membership for non named export default (#508)
When inferring the membership of a class that is an unnamed default
export we hit a null pointer exception.

```js
export default class {
  /** */
  member() {}
}
```

Inferring the name for the class above fails

Fixes #506
2016-08-25 11:09:49 -04:00
Erik Arvidsson
dc846b4219 Handle flow tuple syntax (#511)
This fixes issues with Flow tuples `[T, V]` and
Flow array types `T[]`.

Fixes #510
2016-08-25 11:08:32 -04:00
Erik Arvidsson
2e9376cf46 Fix issue where exported declarations did not set the kind (#503)
* Fix issue where exported declarations did not set the kind

For cases like:

```js
/** */ export class C {}
/** */ export function f {}
/** */ export const k = 42;
```

the kind did not get set properly.

Towards #484

* Infer kind for export default too

Towards #484
2016-08-24 11:03:06 -04:00
Erik Arvidsson
f53e1e72b7 Use provided name for export default (#505)
If a binding name is provided we should use that in the documentation.

For example:

```js
// test.js
/** */
export default function find() {}
```

Should use the name `find` and not `test`.

Fixes #504
2016-08-24 11:01:31 -04:00
Tom MacWright
49347c82e7 Arv document exported (#502)
* Add a flag to document all exported bindings

This adds a boolean flag called `document-exported` (defaults to false)
that effectively adds an empty comment to all exported bindings that do
not already have a JSDoc comment. It also does the same for the
members of exported classes and objects.

```js
export class C {
  method() {}
}
```

Both `C` and `C#method` are now part of the generated documentation.

Related to #424

* Fix lint error

* Rebase and use options pragma in test file

* Create extractor type as a generalized comment/export getter

* Document exported extractor
2016-08-24 10:58:15 -04:00
Tom MacWright
06412eaad8 Turbo v1 (#497) 2016-08-19 12:22:54 -04:00
Tom MacWright
f0af5b86ae Add generator comment to Markdown output (#496) 2016-08-19 10:08:06 -04:00
Anand Thakker
51fa35c2bf Infer name for string-literal property keys (#487) 2016-08-18 16:59:56 -04:00
Tom MacWright
bec5d7b4b8 Refs #451. Any -> any (#491) 2016-08-18 08:01:12 -04:00
Tom MacWright
b506893cb0 Run lint in our own tests. Fixes #240 (#480) 2016-07-19 15:43:42 -04:00
Tom MacWright
9e47ec103b Lint all type-containing tags. Fixes #380 (#477) 2016-07-16 20:26:45 -04:00
Tom MacWright
f00c7bd153 Robertleeplummerjr master (#476)
* Expose imports between templates

Exposes `renderSectionList`, and `renderSection` & `renderNote` for consistency. Fixes #462

* Fixes #440

Resolve typo

* Resolve variable name conflict

* Change formatters to master
2016-07-16 20:10:15 -04:00
Tom MacWright
b83bc2eff6 Merge branch 'master' of https://github.com/documentationjs/documentation 2016-07-16 19:52:44 -04:00
Tom MacWright
b89afcf9e3 Improve linkerstack internal documentation 2016-07-16 19:52:00 -04:00
Tom MacWright
c7726bbb19 Report bad TOC entries. Fixes #442 (#475) 2016-07-16 19:40:17 -04:00
Tom MacWright
211a26027c Allow the user to specify port. (#474)
Fixes #464
2016-07-14 13:51:43 -04:00
Anand Thakker
b4fe8edf92 Fixes TOC entries missing description in serve (#470)
* Fixes TOC entries missing description in `serve`

* Remove console statements
2016-07-11 15:03:41 -04:00
Anand Thakker
5b78f57e1f Fix short signatures for inferred params (#471) 2016-07-11 15:02:36 -04:00
Tom MacWright
cc2e5e20d3 Pass paths to binary 2016-07-06 13:30:09 -04:00
Tom MacWright
937ac48154 Forgiving links to 404s 2016-07-06 12:43:36 -04:00
Tom MacWright
6cbf4bd1d8 Improve internal documentation, add examples 2016-06-17 16:29:57 -04:00
Tom MacWright
8287ab0539 Fix names of methods for generated documentation 2016-06-17 16:18:07 -04:00
Tom MacWright
7696e965ca Reorganize server code into lib/serve 2016-06-17 16:07:49 -04:00
Tom MacWright
3f08c19533 Move documentation-theme-utils into core
Also:

* Fixes many issues in the default theme
* Moves the default theme from default-theme to default_theme
* Creates a new, robust linker infrastructure that will support
  bare links
* Replaces slugg with github-slugger
* Outputs unknown types as Any. Fixes #451
2016-06-08 12:40:05 -04:00
Tom MacWright
9bda56842f Merge pull request #453 from arv/class-property
Infer class properties
2016-06-07 20:49:09 -04:00
Erik Arvidsson
e13e5d7db3 Infer class properties
Flow/TypeScript has a special syntax for class properties. These
should be grouped under the class that they belong to.
2016-06-07 17:20:55 -07:00
Erik Arvidsson
8c14481260 Treat flow nullable types as nullable
Previously they were treated as optional params which is not the
same thing.
2016-06-07 15:10:39 -07:00
Julien Vanier
6ae89c675d No context for narrative sections
When using `--config configuration.yml` with narrative sections, `documentation build` crashes with `TypeError: Cannot read property 'github' of undefined` (regardless if `--github` is passed or not). Verify that the `comment.context` object exists before reading its properties.
2016-06-06 16:45:57 -04:00
Tom MacWright
caa1637880 Fix ability to require() JSON and other files without extension.
Fixes #402
2016-06-03 13:47:42 -04:00
Tom MacWright
dead5bb9f7 Finish internal documentation 2016-06-02 15:00:12 -04:00
Tom MacWright
aadb8addc6 Even more documentation 2016-06-02 14:53:58 -04:00
Tom MacWright
09a4faa672 Cover lib/parse 2016-06-02 14:32:04 -04:00
Tom MacWright
02df59c9a3 Try to make flatteners private 2016-06-02 13:39:06 -04:00
Tom MacWright
04355a8b91 More internal documentation 2016-06-02 13:35:27 -04:00
Tom MacWright
21371e71da Inline method 2016-06-02 13:28:57 -04:00
Tom MacWright
7f032d6c6a Improve internal documentation 2016-06-02 13:22:06 -04:00
Tom MacWright
e25919b0d4 Improve internal documentation 2016-06-02 12:40:06 -04:00
Kristóf Poduszló
81ff705d6c Fixed GitHub link generation on Windows (resolves #318) 2016-06-02 11:46:06 +02:00
Tom MacWright
bf0f100368 Merge pull request #441 from arv/infer-private
Add support for inferring private based on the name
2016-06-01 19:08:49 -04:00
Tom MacWright
e67409e296 More docs 2016-06-01 17:41:02 -04:00
Erik Arvidsson
629ea6f3a8 Add support for inferring private based on the name
This adds a command line flag called `--infer-private` which is a
string (defaults to `^_`) which is used as a regexp for inferring
if a name is private or not.

For example:

```js
/** C */
class C {
  /** I'm public */
  m() {}
  /** I'm private */
  _p() {}
}
```

Fixes #436
2016-06-01 14:40:08 -07:00
Tom MacWright
d1e5baf578 more documentation improvements 2016-06-01 17:30:33 -04:00