Skip to content

Added tags for props to serialization (including ParserOption to enable)#328

Merged
pvasek merged 3 commits intostyleguidist:masterfrom
carmnk:master
Mar 10, 2021
Merged

Added tags for props to serialization (including ParserOption to enable)#328
pvasek merged 3 commits intostyleguidist:masterfrom
carmnk:master

Conversation

@carmnk
Copy link
Copy Markdown
Contributor

@carmnk carmnk commented Mar 1, 2021

@pvasek sorry for the delay.
I've updated the PR to 1.21.0, added the union test for the PR and added test functionality to check prop tags in testUtils.ts.
I've also made an additional change in src/parser.ts:

Only if the added ParserOption shouldIncludePropTagMap is true, instead of jsDocComment.fullComment (default), jsDocComment.description is used as prop description. This will return the plain property description without any tags while tags are served separately. Default behavior (shouldIncludePropTagMap is false or undefined) is unchanged.

I think that would also be an option for default behavior (if so the additional ParserOption would be obsolete). Currently property tags are included in the description as string:
`
/** prop2 description

==> output default/currently:
result[0].props.prop2.description => "prop2 description\n@internal some internal prop\n@kind category 1"

==> output (shouldIncludePropTagMap===true ):
result[0].props.prop2.description => "prop2 description"
result[0].props.prop2.tags => {internal: "some internal prop", .... }
`

I hope the PR is acceptable now, otherwise please let me know.

@pvasek pvasek merged commit 6c85151 into styleguidist:master Mar 10, 2021
@pvasek
Copy link
Copy Markdown
Collaborator

pvasek commented Apr 4, 2021

@carmnk thanks a lot! Published on npm as v1.22.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants