Skip to content

feat: use typedoc to generate a json file documentation dump of all components #1887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 17, 2016
Merged

feat: use typedoc to generate a json file documentation dump of all components #1887

merged 5 commits into from
Nov 17, 2016

Conversation

ericjim
Copy link
Member

@ericjim ericjim commented Nov 16, 2016

@jelbourn

I've modified button.ts as an example on how to hide underscored methods and to hide its constructor.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 16, 2016

## Example Usage

### Hiding methods in a class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than hiding the methods with @hidden, I'd rather just ignore them when we're processing the json for the docs site. The vast majority of methods and properties won't be public, so using @hidden would add a lot of noise to the source.

## Generating docs for one component

```
npm run docs ./src/lib/button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make a gulp task for this.

@@ -0,0 +1,21 @@
{
"mode": "modules",
"out": "./docs/autogen",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should output to dist/api

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a preference name for the json file? I call it output.json though api.json might be more fitting.

"excludeExternals": "true",
"includeDeclarations": "true",
"target": "ES6",
"exclude": "**/+(index.ts|*.spec.ts|*.scss|*.html)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't necessarily want to exclude index.ts because we do define some constructs there.
(though maybe we shouldn't)

"out": "./docs/autogen",
"json": "./docs/autogen/output.json",
"theme": "default",
"ignoreCompilerErrors": "true",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ignoreCompilerErrors?

Copy link
Member Author

@ericjim ericjim Nov 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it, it was useful for testing individual components which didn't have typings in the same folder (src/lib/button). However, if I run npm run docs ./src/lib no errors will be produced since the tsconfig and typings files are found. We should still be able to specify that flag on an individual basis --ignoreCompilerErrors.

@jelbourn
Copy link
Member

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Nov 17, 2016
@kara kara merged commit 4433fc9 into angular:master Nov 17, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants