Skip to content

docs: show exported functions #12736

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 2 commits into from
Aug 20, 2018

Conversation

devversion
Copy link
Member

@devversion devversion commented Aug 19, 2018

  • Changes the Dgeni setup to properly display exported functions (e.g. from cdk/coercion, cdk/a11y, cdk/platform)

NOTE: A few descriptions for the coercion won't show up for now. See related fix for Dgeni-packages:
angular/dgeni-packages#270

* Changes the Dgeni setup to properly display exported functions (e.g. from cdk/coercion, cdk/a11y, cdk/platform)
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 19, 2018
@@ -32,6 +32,7 @@ export interface CanStick {
}

/**
* @docs-private
Copy link
Member

Choose a reason for hiding this comment

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

I think we put the @docs-private after the description everywhere else.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, thought about creating a rule that enforces this now. Do you think it would be worth having a rule that enforces this?

@@ -33,23 +36,24 @@ export function normalizeMethodParameters(method: NormalizedMethodMemberDoc) {
parameterName = parameterName.replace('?', '');
}

if (!method.params) {
method.params = [];
if (!doc.params) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: you can shorten this to doc.params = doc.params || [].

@@ -103,6 +107,8 @@ export class ComponentGrouper implements Processor {
group.additionalInterfaces.push(doc);
} else if (doc.docType === 'type-alias') {
group.additionalTypeAliases.push(doc);
} else if (doc.docType === 'function') {
Copy link
Member

Choose a reason for hiding this comment

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

This whole else if chain is getting pretty long. Consider using a switch on the doc.docType.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer keeping it like this. Since this is most likely the last docType and all the breaks don't make the code less or more readable IMO.

@@ -79,6 +79,20 @@ <h3 id="additional_interfaces" class="docs-header-link docs-api-h3">
{% endfor %}
{%- endif -%}

{%- if doc.additionalFunctions.length -%}
<h3 id="additional_functions" class="docs-header-link docs-api-h3">
Copy link
Member

Choose a reason for hiding this comment

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

Should this be separated with a dash, rather than an underscore?

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think so. I've just made it consistent with the other header links.

</h3>
{% for item in doc.additionalFunctions %}
{#
Since the function docs are having a similar structure as method docs, we use
Copy link
Member

Choose a reason for hiding this comment

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

are having -> have

@devversion
Copy link
Member Author

@crisbeto Done. Addressed most of your comments.

@jelbourn
Copy link
Member

Is there anything aside from functions in coercion and platform being exposed?

@devversion
Copy link
Member Author

devversion commented Aug 20, 2018

@jelbourn Yeah, the Platform class for example. The Dgeni issue should be resolved as soon as possible. In the meanwhile, since the coercion isn't added to the doc items yet, it shouldn't be blocked.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Aug 20, 2018
@jelbourn jelbourn merged commit 4879dc4 into angular:master Aug 20, 2018
@devversion devversion deleted the docs/show-exported-functions branch August 20, 2018 20:40
devversion added a commit to devversion/dgeni-packages that referenced this pull request Aug 27, 2018
Introduces a new option that allows developers to configure the `tsHost` to not concatenate multiple leading comments for a `TypeScript` node content.

The `tsHost` is a newly created service that delegates (for now) to the `tsParser` package for retrieving the content of a given node. The advantage of the `tsHost` is that people can inject the `tsHost` in Dgeni `.config()` and specify options or overwrite methods.

Related angular/components#12736.
devversion added a commit to devversion/dgeni-packages that referenced this pull request Aug 28, 2018
Introduces a new option that allows developers to configure the `tsHost` to not concatenate multiple leading comments for a `TypeScript` node content.

The `tsHost` is a newly created service that delegates (for now) to the `tsParser` package for retrieving the content of a given node. The advantage of the `tsHost` is that people can inject the `tsHost` in Dgeni `.config()` and specify options or overwrite methods.

Related angular/components#12736.
petebacondarwin pushed a commit to angular/dgeni-packages that referenced this pull request Aug 28, 2018
Introduces a new option that allows developers to configure the `tsHost` to not concatenate multiple leading comments for a `TypeScript` node content.

The `tsHost` is a newly created service that delegates (for now) to the `tsParser` package for retrieving the content of a given node. The advantage of the `tsHost` is that people can inject the `tsHost` in Dgeni `.config()` and specify options or overwrite methods.

Related angular/components#12736.
@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 9, 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.

5 participants