Skip to content

refactor(compiler-cli): add the ability to treat object literals as enums in docs#54487

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:literal-as-enum-docs
Closed

refactor(compiler-cli): add the ability to treat object literals as enums in docs#54487
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:literal-as-enum-docs

Conversation

@crisbeto
Copy link
Member

We have a couple of cases now (#53753 and #54414) where we're forced to redefine enums as object literals. These literals aren't rendered in the best way in the docs so these changes introduce a new object-literal-as-enum tag that we can use to mark them so they're treated for documentation purposes.

…nums in docs

We have a couple of cases now (angular#53753 and angular#54414) where we're forced to redefine enums as object literals. These literals aren't rendered in the best way in the docs so these changes introduce a new `object-literal-as-enum` tag that we can use to mark them so they're treated for documentation purposes.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: compiler Issues related to `ngc`, Angular's template compiler labels Feb 17, 2024
@crisbeto crisbeto requested a review from jelbourn February 17, 2024 11:19
@ngbot ngbot bot modified the milestone: Backlog Feb 17, 2024
import {extractJsDocDescription, extractJsDocTags, extractRawJsDoc} from './jsdoc_extractor';

/** Name of the tag indicating that an object literal should be shown as an enum in docs. */
const LITERAL_AS_ENUM_TAG = 'object-literal-as-enum';
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 was considering whether to make this a bit more generic, e.g. @docs-type enum, but I think that'll needlessly complicate the docs since we'd have to account for it in all AST node types.

Copy link
Contributor

@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

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 21, 2024
@alxhub
Copy link
Member

alxhub commented Feb 21, 2024

This PR was merged into the repository by commit 1d14e52.

alxhub pushed a commit that referenced this pull request Feb 21, 2024
…nums in docs (#54487)

We have a couple of cases now (#53753 and #54414) where we're forced to redefine enums as object literals. These literals aren't rendered in the best way in the docs so these changes introduce a new `object-literal-as-enum` tag that we can use to mark them so they're treated for documentation purposes.

PR Close #54487
@alxhub alxhub closed this in 1d14e52 Feb 21, 2024
@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 Mar 23, 2024
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 area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants