fix: render constructors as new ClassName(params) format#11
fix: render constructors as new ClassName(params) format#11davanesh wants to merge 5 commits intowebpack:mainfrom
new ClassName(params) format#11Conversation
|
@davanesh Can you rebase? |
6c923d3 to
e72176d
Compare
|
Done! Rebased and force pushed. |
avivkeller
left a comment
There was a problem hiding this comment.
I have a few changes that I think will be nice, but this is some great great work and I can't wait to see more!
plugins/theme/index.mjs
Outdated
| //DEBUG | ||
| // console.log("KIND:", model.kind, "NAME:", model.name, "CONSTRUCTOR KIND:", ReflectionKind.Constructor); |
There was a problem hiding this comment.
Let's remove this debug comment
plugins/theme/index.mjs
Outdated
| declarationTitle: (model) => { | ||
| return this.helpers.typedListItem({ | ||
| name: model.name, | ||
| type: model.type, | ||
| comment: model.comment, | ||
| }); | ||
| }, |
There was a problem hiding this comment.
| declarationTitle: (model) => { | |
| return this.helpers.typedListItem({ | |
| name: model.name, | |
| type: model.type, | |
| comment: model.comment, | |
| }); | |
| }, | |
| declarationTitle: this.helpers.typedListItem, |
plugins/theme/index.mjs
Outdated
| memberContainer: (model, options) => { | ||
| const md = []; | ||
| if (!this.router.hasOwnDocument(model) && | ||
| ![ReflectionKind.Constructor].includes(model.kind)) { | ||
| md.push( | ||
| "#".repeat(options.headingLevel) + " " + | ||
| this.partials.memberTitle(model) | ||
| ); | ||
| } | ||
| md.push(this.partials.member(model, { | ||
| headingLevel: options.headingLevel + 1, // ← methods get #### | ||
| nested: options.nested, | ||
| })); | ||
| return md.filter(Boolean).join("\n\n"); | ||
| }, |
There was a problem hiding this comment.
I think overriding the constructor in memberTitle is better than outright skipping it? WDYT?
There was a problem hiding this comment.
Oh that's a much cleaner approach! On it 🔥
e72176d to
2f0b9c9
Compare
|
(Rebased for CI/CD). Note that you'll need to run |
2f0b9c9 to
e2b9d89
Compare
alexander-akait
left a comment
There was a problem hiding this comment.
@avivkeller We currently only support @deprecated, if we want to add them we need to add them to our schema generator, @experimental is not a problem, @beta and @legacy - not sure we need it, because @deprecated already handle such things
|
On it! |
|
Done, reverted blockquote changes and moved constructor logic into a buildConstructorTitle helper 😊 |
Closes #2
What this does
Overrides the
constructorpartial to render constructors in the Node.js doc format instead of the default TypeDoc output.Before:
Constructors
Constructor
options{ContainerPluginOptions}After:
new ContainerPlugin(options)options{ContainerPluginOptions}Changes
constructorpartial to format asnew ClassName(params)new Stats([options])### Constructors / Methods / Propertiesgroup headings***horizontal rule separators between membersmemberContainerto correctly pass heading levels down the chain