Description
TypeDoc 0.26 is now in beta! 🎉
Please try it out and report any issues here or in new issues:
npm install --save-dev typedoc@beta
The full release will be made on 2024-06-21.
This release includes support for TypeScript 5.5 in addition to two large features
External Markdown Pages
It has been a highly requested feature for TypeDoc to support including additional markdown pages beyond just the project's readme. In fact the original issue requesting them, #247, is the oldest issue still open. There have been a few external plugins over the years which added this, then broke with TypeDoc updates, but it's now coming to TypeDoc proper!
This feature falls into two parts:
- Project level documents
- Reflection level documents
Project level documents can be added with the --projectDocuments
option. These documents will be added as children of the root reflection object, so are a good fit for guides on how to use the library and other top level pages that should be included in your docs.
Reflection level documents can be added as children to declarations with the @document
tag. These are intended for referencing lower level documents which are relevant when viewing documentation for that item. Note: "top level" declarations is a somewhat tricky term. The initial implementation of this feature only supports
The markdown pages added may include YAML formatted frontmatter. TypeDoc will check the frontmatter for title
, group
, and category
properties. The title
property will set the name of the document used, while group
and category
are treated like the @group
and @category
tags on a normal reflection.
Note: This frontmatter must begin and end with ---
on lines by itself. TypeDoc's frontmatter extraction uses this to determine when the block ends.
Example:
/**
* @document relative/path/to/document.md
*/
namespace Foo {}
---
title: Document name
group: Guides
---
This guide will show...
Localization Support
TypeDoc has always been an English project, without any real support for other languages. This version sets up the infrastructure to support changing rendered text and TypeDoc's log messages to other languages. See internationalization.md for details. Translation PRs are welcome!
Important Breaking Changes
- Dropped support for Node 16
- Moved from marked to markdown-it for parsing markdown. TypeDoc has been on an old version of Marked for a while now to avoid breaking changes they made which turned parsing from a synchronous approach to potentially async. Supporting async code in TypeDoc's renderer is currently infeasible. Markdown-it also supports plugins which extend markdown and can be used within TypeDoc to add custom rendering of syntax within comments.
- Updated Shiki from 0.14 to 1.x, this should mostly be a transparent update which adds additional languages and themes.
- All function-likes may now have comments directly attached to them. This is a change from previous versions of TypeDoc where functions comments were always moved down to the signature level. This mostly worked, but caused problems with type aliases, so was partially changed in 0.25.13. This change was extended to apply not only to type aliases, but also other function-likes declared with variables and callable properties. As a part of this change, comments on the implementation signature of overloaded functions will now be added to the function reflection, and will not be inherited by signatures of that function,
const
interpreted as function typed via aninterface
declaration, yield unexpected comment summaries #2521. --media
,--includes
, and--stripYamlFrontmatter
options have been removed.
Remaining Work
See the full changelog for additional details.
- Handle
@document
on classes, interfaces, enums, functions, variablesHandle relative image and markdown links within documents and commentsSupport settinghtml: false
in markdown-it configurationAdd option to always create a module, even for a single entry point site.Figure out how to handle relative image links in packages modeUpdate documentationAdd option to specify what highlight languages are loaded. Shiki 1.x takes ~250ms longer to load than 0.14 due to loading more languages, the majority of which won't be used by a TS project.
Activity
Gerrit0 commentedon May 5, 2024
0.26.0-beta.1
@document
on more reflection typespackageOptions
, AddpackageOptions
config value for packages mode #2523customFooterHtml
, Suggestion: Custom footer string #2559html
option (will probably default this totrue
so that TypeDoc can color links in readme files which point to a specific type of reflection, currently defaulted to false)hostedBaseUrl
alwaysCreateEntryPointModule
option to control how TypeDoc behaves when only one entry point is provided... and now I probably disappear for 2 weeks and don't do anything, except maybe fix bugs people find ;)
bndkt commentedon May 6, 2024
@Gerrit0 I'm excited to try packageOptions in Beta 2, but it seems the npm publish failed.
Gerrit0 commentedon May 6, 2024
Sorry about that! Should be up now.
I suspect I might need to revert the block tag validation change, or at least rework it, as I forgot about how special inheritDoc is
Gerrit0 commentedon Jun 1, 2024
0.26.0-beta.2
[text](link)
and
style links and automatically copy referenced files to amedia
directory under the docs folder.excludePrivate
to true@hideconstructor
, Support@hideconstructor
JSDoc tag to hide constructors from classes. #2577highlightLanguages
option to limit what Shiki languages are loaded (reduces rendering time by ~150ms)Remaining Work
<a href>
and<img src>
dzek69 commentedon Jun 2, 2024
Hey, the new project documents feature is shaping up great! Can't wait to finally bump my versions and be able to use the new TypeScript features as well!
I just tried it out and I have some ideas for improvements. Or questions maybe.
I don't really understand the
@group
tag,@category
I get, but I still don't see the connection between project documents and these tags.I tried various values in the frontmatter section, but regardless of what I do I see all my documents listed alphabetically above the
index
entry on the menu and no sections on theindex
page:I suppose I use them wrong, but nevertheless - I'd be nice to be able to organize the pages into subtrees, maybe with some new property like
directory
?Also I'd be great if I could somehow keep the order I defined the files in the array? Cause
Getting started
should come beforeAdvanced usage
, but currently it's the opposite and I can't do anything about it.Gerrit0 commentedon Jun 6, 2024
For documents added with the
projectDocuments
option, they aren't useful, where they come in handy is when adding documents associated with some reflection. For example, I used@document
in this interface's comment to reference a file:Lack of sections on the index page looks wrong, I'll have to take a closer look this weekend.
You can do this today by using a
/
in the document name in the frontmatter. (Note: Only makes a folder in the UI if there is one named for the "folder", or if there are at least two within the "folder")You're after the
--sortEntryPoints
option, swap that to false and TypeDoc will use the order you listed in the options.dzek69 commentedon Jun 6, 2024
Thanks, it looks like I can achieve what I wanted already 👍🏻
One bug, in case you missed it, the document folders and the breadcrumbs does not play well together:

Gerrit0 commentedon Jun 7, 2024
This is because those folders aren't real folders, the "top document" isn't actually a parent. It's just a happy accident of the tree implementation that it allows this to work. The "right" solution would be support for sub-documents, which is probably what I'll go for before merging this feature
Gerrit0 commentedon Jun 9, 2024
0.26.0-beta.3
<img>
and<a>
tags in comments/documentschildren
as an array/object within their frontmatter to add child documents.--useHostedBaseUrlForAbsoluteLinks
option to use the--hostedBaseUrl
option to produce absolute links to pages on a site, Use absolute URL's for the assets #940.Note: This feature is only available on type aliases directly containing unions.
This results in significantly smaller documentation pages in many cases where that section would just repeat what has already been presented in the rendered type.
comment.beforeTags
andcomment.afterTags
hooks for plugin use.Combined with
CommentTag.skipRendering
this can be used to provide custom tag handling at render time.DefaultThemeRenderContext.hook
must now be passedcontext
if required by the hook.JSONOutput.SignatureReflection.typeParameter
has been renamed totypeParameters
to match the JS API.Remaining Work
Besides updating the website docs, the remaining work is just nice to haves, and can wait if necessary
@link
tags on union elements13 remaining items