-
Notifications
You must be signed in to change notification settings - Fork 712
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
TypeDoc 0.27 Beta #2763
Comments
I was hoping to get this out with the TS release, but want to give a few days to update plugins, as the past couple weeks have kept me entirely too busy, so I didn't get the rest of 0.27 finished until just a few minutes ago... sorry about that! The downside of hobby projects.. Planning on Monday/Tuesday for this release now. 0.27.0-beta.1
|
Nice work! I tried the beta version and everything seemed to be working smoothly. I suppose you're aware of it, but since I didn't see it mentioned explicitly: Typedoc is now distributed as ESM, not CommonJS anymore, resulting in some plugins such as typedoc-plugin-merge-modules that still use CommonJS not working anymore. They just need to be converted to ESM as well and everything works again. |
Thanks for that note! I'm not sure how I missed that in the list of breaking changes, it absolutely should be called out. |
Didn't think there was going to be another beta release before the full one, but there were a couple issues which got in the way when updating a plugin. v0.27.0-beta.2
|
0.27 release is out! |
Hey @Gerrit0 , There's some junk/syntax error on the plugins page |
Fixed with 6868398, thanks! |
TypeDoc 0.27 is now in beta! 🎉
Please try it out and report any issues in new issues:
npm install --save-dev typedoc@beta
The full release will be made on 2024-11-21 (TS 5.7 release date, may be pushed if TS pushes)
This release mainly focuses on improved flexibility for type conversion and several improvements to the default theme, but also makes some changes to output.
Conversion Flexibility
TypeDoc uses the compiler to retrieve the types of documented members, and converts them into a simplified structure for rendering. Historically, not much flexibility has been exposed to control this behavior. v0.24 added support for
@interface
to tell TypeDoc to treat a type alias as if it was an interface, and@namespace
to convert variables as namespaces. v0.27 extends this support with some additional tags:@expand
- tells TypeDoc to also render details about the properties of this type when rendering references to this type.@inline
- tells TypeDoc to replace references to this type with a copy of the referenced type.@useDeclaredType
- tells TypeDoc to use TypeScript'sgetDeclaredType
method to get types for conversion. Using this on a mapped type will cause the evaluated type to be rendered. Note: This can sometimes produce worse documentation, the most common error case is that it will render as a self-reference.Default Theme Changes
This release includes quite a few quality of live improvements to the default theme:
Reworked Modules Page
Modules/namespace pages have been re-worked to be more generally useful. The
@summary
tag can now be used to define a "short summary" for a reflection, which will be rendered on the modules page, or theuseFirstParagraphOfCommentAsSummary
option can be set to automatically use the first paragraph of a reflection's comment as the summary. Re-exports (likeCommentStyle
below) will be rendered with an arrow pointing to the canonical export.Expanded References
If
@expand
is used on a type alias or interface, references to it will be expanded. In the screenshot below the@expand
tag was placed onInlineTagDisplayPart
andRelativeLinkDisplayPart
. This screenshot also shows how TypeDoc can render comments for each branch of a union at the root level of a type alias.Code
Smarter Code Rendering
When TypeDoc renders types, it used to apply some very basic rules about when to wrap a type to multiple lines, namely deciding to wrap object types and top level unions on every line, and placing all other types on the same line. This mostly worked, but could also cause very messy rendering. TypeDoc now uses an algorithm similar to prettier, which can be controlled with the
typePrintWidth
option to determine when types should be wrapped.Along with this change, TypeDoc will now be smarter when deciding whether or not to recurse into types to render additional details about them. This is most obvious when viewing documentation for functions which accept or return functions or objects with functions. TypeDoc will still render the full details if it detects that there is additional details provided via documentation comments (either directly or via
@expand
) within the type.Alerts
GitHub supports alerts to call out important information. TypeDoc now supports the same format in comments and markdown documents and will render them in a similar way.
Outputs
TypeDoc supports both HTML and JSON outputs, but if a plugin (e.g. typedoc-plugin-markdown) wanted to add an additional output type, there wasn't an obvious place to hook into the API to expose it to users. TypeDoc now supports the idea of a generic output for a project, which also makes it possible to render TypeDoc's output multiple times with different settings.
The
options
key is optional, and may include any TypeDoc option, though users should be aware that options which are used during conversion will be effectively ignored if set underoutputs
.Change Log
Breaking Changes
result in a different file name structure, The document's name appears as ____ #2714.
have changed. They can be partially restored to the previous format by
setting
--sluggerConfiguration.lowercase false
. This change was made tomore closely match the default behavior of GitHub's markdown rendering and
VSCode's autocomplete when creating a relative link to an external markdown
file.
hideParameterTypesInTitle
option, this was originally added asa workaround for many signatures overflowing the available horizontal space
in rendered pages. TypeDoc now has logic to wrap types/signatures smartly,
so this option is no longer necessary.
kindSortOrder
to put references last.sort
order to usealphabetical-ignoring-documents
instead of
alphabetical
.suppressCommentWarningsInDeclarationFiles
totrue
(e.g.
X
, notnew X
)@group
,@category
,@groupDescription
and@categoryDescription
will no longer be removed from the reflections they are present on. They are
skipped during rendering with the
notRenderedTags
option.Features
package.json
exports if theyare not provided manually, Support for package
exports
map #1937.#anchor
links toreference a heading within them.
@param
comments with nested object types, Nested object parameter descriptions are not included in the output #2555.@param
comments which reference a typealias/interface. Important properties on the referenced type can now be
highlighted with
@param options.foo
, which will result in the additionalnote being included under the documentation for that parameter, Support for documenting params with named types #2147. Note:
This feature is limited to references. It is not supported on other types of
types.
outputs
option which is an array of outputs. This can be usedto render the documentation multiple times with different rendering options
or output types, Decouple
Renderer
class from HTML output #2597.@expand
tag which can be placed on type aliases andinterfaces. When a type with
@expand
is referenced and TypeDoc has a placeto include additional details about the type, the properties of the type
will be included in the page where
@expand
is found. Note that use of thistag can significantly increase the size of your generated documentation if
it is applied to commonly used types as it will result in inlining the
comments for those types everywhere they are referenced, Expand union types #2303.
@inline
tag which can be placed on type aliases andinterfaces. When a type with
@inline
is referenced, TypeDoc will resolvethe referenced type and convert the type as if it was included directly
within the referencing type. Note that use of this tag can significantly
increase the size of your generated documentation if it is applied to
commonly used types as it will result in inlining the comments for those
types everywhere they are referenced, Expand union types #2303.
@useDeclaredType
tag for type aliases which can sometimesimprove their documentation, Way to expand complex type aliases (Awaited, ReturnType, typeof etc.) #2654..
@mergeModuleWith
tag which can be used to tell TypeDoc toplace a module/namespace's children under a different module/namespace and
remove the real parent, Support for merging modules together with
@module
#2281.notRenderedTags
option. This option is similar to theexcludeTags
option, but while
excludeTags
will result in the tag being completelyremoved from the documentation,
notRenderedTags
only prevents it frombeing included when rendering.
groupReferencesByType
option.navigation.excludeReferences
optionuseFirstParagraphOfCommentAsSummary
option to configure how TypeDochandles comments for module members without the
@summary
tag.favicon
option to specify a.ico
or.svg
favicon to reference.together and will expand/collapse together, [Discussion] Default Modern Theme + complete / linkable built-in TS lib docs. #2335.
app.outputs
object for defining new output strategies.Bug Fixes
overloads if present, Use the comment for the first signature if a later signature does not have a comment #2718.
@enum
if the type was declared before the variable,@enum
incorrectly handles type declared before value #2719.default
property #2524.cases. This primarily affected destructured parameters.
yaml
to the highlight languages supported by default.txt
as an alias oftext
to indicate a code blockshould not be highlighted.
@ignore
or@hidden
but still referenced byother types will no longer produce warnings about not being exported.
module when resolving
@link
tags.JavaScript is disabled.
rather than when converting. This prevents issues where boosts used by just
one package were incorrectly reported as unused when running with
entryPointStrategy set to packages.
The text was updated successfully, but these errors were encountered: