Socket
Socket
Sign inDemoInstall

typedoc

Package Overview
Dependencies
5
Maintainers
0
Versions
305
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    typedoc

Create api documentation for TypeScript projects.


Version published
Weekly downloads
1.2M
increased by3.2%
Maintainers
0
Created
Weekly downloads
 

Package description

What is typedoc?

TypeDoc is a documentation generator for TypeScript projects. It reads your TypeScript source code and its comments and produces an HTML documentation website. It is capable of creating readable and user-friendly documentation for TypeScript projects, which can be very helpful for both maintaining internal code and for sharing code with external users.

What are typedoc's main functionalities?

Generating Documentation

This command generates documentation for the TypeScript source files located in the 'src' directory and outputs the result to the 'docs' directory.

typedoc --out docs src

Customizing the Theme

This command generates documentation with a minimal theme, which is one of the built-in themes provided by TypeDoc.

typedoc --out docs src --theme minimal

Excluding Private Members

This command generates documentation while excluding private members from the output, making the documentation cleaner if private members are not intended to be part of the public API.

typedoc --out docs src --excludePrivate

Including Declaration Files

This command includes type declaration files (d.ts files) in the documentation generation process, which can be useful for documenting the types that are part of the project's external API.

typedoc --out docs src --includeDeclarations

Other packages similar to typedoc

Changelog

Source

v0.26.0 (2024-06-22)

Breaking Changes

  • Drop support for Node 16.
  • Moved from marked to markdown-it for parsing as marked has moved to an async model which supporting would significantly complicate TypeDoc's rendering code. This means that any projects setting markedOptions needs to be updated to use markdownItOptions. Unlike marked@4, markdown-it pushes lots of functionality to plugins. To use plugins, a JavaScript config file must be used with the markdownItLoader option.
  • Updated Shiki from 0.14 to 1.x. This should mostly be a transparent update which adds another 23 supported languages and 13 supported themes. As Shiki adds additional languages, the time it takes to load the highlighter increases linearly. To avoid rendering taking longer than necessary, TypeDoc now only loads a few common languages. Additional languages can be loaded by setting the --highlightLanguages option.
  • Changed default of --excludePrivate to true.
  • Renamed --sitemapBaseUrl to --hostedBaseUrl to reflect that it can be used for more than just the sitemap.
  • Removed deprecated navigation.fullTree option.
  • Removed --media option, TypeDoc will now detect image links within your comments and markdown documents and automatically copy them to the site.
  • Removed --includes option, use the @document tag instead.
  • Removed --stripYamlFrontmatter option, TypeDoc will always do this now.
  • Renamed the --htmlLang option to --lang.
  • Removed the --gaId option for Google Analytics integration and corresponding analytics theme member, #2600.
  • 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, #2521.
  • API: TypeDoc now uses a typed event emitter to provide improved type safety, this found a bug where Converter.EVENT_CREATE_DECLARATION was emitted for ProjectReflection in some circumstances.
  • API: MapOptionDeclaration.mapError has been removed.
  • API: Deprecated BindOption decorator has been removed.
  • API: DeclarationReflection.indexSignature has been renamed to DeclarationReflection.indexSignatures. Note: This also affects JSON serialization. TypeDoc will support JSON output from 0.25 through at least 0.26.
  • API: JSONOutput.SignatureReflection.typeParameter has been renamed to typeParameters to match the JS API.
  • API: DefaultThemeRenderContext.iconsCache has been removed as it is no longer needed.
  • API: DefaultThemeRenderContext.hook must now be passed context if required by the hook.

Features

  • Added support for TypeScript 5.5.
  • Added new --projectDocuments option to specify additional Markdown documents to be included in the generated site #247, #1870, #2288, #2565.
  • TypeDoc now has the architecture in place to support localization. No languages besides English are currently shipped in the package, but it is now possible to add support for additional languages, #2475.
  • Added support for a packageOptions object which specifies options that should be applied to each entry point when running with --entryPointStrategy packages, #2523.
  • --hostedBaseUrl will now be used to generate a <link rel="canonical"> element in the project root page, #2550.
  • Added support for documenting individual elements of a union type, #2585. Note: This feature is only available on type aliases directly containing unions.
  • TypeDoc will now log the number of errors/warnings errors encountered, if any, after a run, #2581.
  • New option, --customFooterHtml to add custom HTML to the generated page footer, #2559.
  • TypeDoc will now copy modifier tags to children if specified in the --cascadedModifierTags option, #2056.
  • TypeDoc will now warn if mutually exclusive modifier tags are specified for a comment (e.g. both @alpha and @beta), #2056.
  • Groups and categories can now be collapsed in the page body, #2330.
  • Added support for JSDoc @hideconstructor tag. This tag should only be used to work around TypeScript#58653, prefer the more general @hidden/@ignore tag to hide members normally, #2577.
  • Added --useHostedBaseUrlForAbsoluteLinks option to use the --hostedBaseUrl option to produce absolute links to pages on a site, #940.
  • Tag headers now generate permalinks in the default theme, #2308.
  • TypeDoc now attempts to use the "most likely name" for a symbol if the symbol is not present in the documentation, #2574.
  • Fixed an issue where the "On This Page" section would include markdown if the page contained headings which contained markdown.
  • TypeDoc will now warn if a block tag is used which is not defined by the --blockTags option.
  • Added three new sort strategies documents-first, documents-last, and alphabetical-ignoring-documents to order markdown documents.
  • Added new --alwaysCreateEntryPointModule option. When set, TypeDoc will always create a Module for entry points, even if only one is provided. If --projectDocuments is used to add documents, this option defaults to true, otherwise, defaults to false.
  • Added new --highlightLanguages option to control what Shiki language packages are loaded.
  • TypeDoc will now render union elements on new lines if there are more than 3 items in the union.
  • TypeDoc will now only render the "Type Declaration" section if it will provide additional information not already presented in the page. 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.
  • Added comment.beforeTags and comment.afterTags hooks for plugin use. Combined with CommentTag.skipRendering this can be used to provide custom tag handling at render time.

Bug Fixes

  • TypeDoc now supports objects with multiple index signatures, #2470.
  • Header anchor links in rendered markdown are now more consistent with headers generated by TypeDoc, #2546.
  • Types rendered in the Returns header are now properly colored, #2546.
  • Links added with the navigationLinks option are now moved into the pull out navigation on mobile displays, #2548.
  • @license and @import comments will be ignored at the top of files, #2552.
  • Fixed issue in documentation validation where constructor signatures where improperly considered not documented, #2553.
  • Keyboard focus is now visible on dropdowns and checkboxes in the default theme, #2556.
  • The color theme label in the default theme now has an accessible name, #2557.
  • Fixed issue where search results could not be navigated while Windows Narrator was on, #2563.
  • charset is now correctly cased in <meta> tag generated by the default theme, #2568.
  • Fixed very slow conversion on Windows where Msys git was used by typedoc to discover repository links, #2586.
  • Validation will now be run in watch mode, #2584.
  • Fixed an issue where custom themes which added dependencies in the <head> element could result in broken icons, #2589.
  • @default and @defaultValue blocks are now recognized as regular blocks if they include inline tags, #2601.
  • Navigation folders sharing a name will no longer be saved with a shared key to localStorage.
  • The --hideParameterTypesInTitle option no longer applies when rendering function types.
  • Broken @link tags in readme files will now cause a warning when link validation is enabled.
  • Fixed externalSymbolLinkMappings option's support for meanings in declaration references.
  • Buttons to copy code now have the type=button attribute set to avoid being treated as submit buttons.
  • --hostedBaseUrl will now implicitly add a trailing slash to the generated URL.

Thanks!

  • @Aryakoste
  • @bladerunner2020
  • @Dinnerbone
  • @HarelM
  • @kraenhansen
  • @Nil2000
  • @steve02081504
  • @tristanzander

Unreleased

Readme

Source

TypeDoc

Documentation generator for TypeScript projects.

CI NPM Version

Documentation

For more detailed documentation, the changelog, and TypeDoc documentation rendered with TypeDoc, see https://typedoc.org.

Installation

TypeDoc runs on Node.js and is available as a NPM package.

npm install typedoc --save-dev

Usage

To generate documentation TypeDoc needs to know your project entry point and TypeScript compiler options. It will automatically try to find your tsconfig.json file, so you can just specify the entry point of your library:

typedoc src/index.ts

If you have multiple entry points, specify each of them.

typedoc package1/index.ts package2/index.ts

If you specify a directory, TypeDoc will use the entryPointStrategy option to determine how to resolve it. By default, TypeDoc will search for a file called index under the directory.

Monorepos / Workspaces

If your codebase is comprised of one or more npm packages, you can build documentation for each of them individually and merge the results together into a single site by setting entryPointStrategy to packages. In this mode TypeDoc requires configuration to be present in each directory to specify the entry points. For an example setup, see https://github.com/Gerrit0/typedoc-packages-example

Arguments

For a complete list of the command line arguments run typedoc --help or visit our website.

  • --out <path/to/documentation/>
    Specifies the location the documentation should be written to. Defaults to ./docs
  • --json <path/to/output.json>
    Specifies the location and file name a json file describing the project is written to. When specified no documentation will be generated unless --out is also specified.
  • --options
    Specify a json option file that should be loaded. If not specified TypeDoc will look for 'typedoc.json' in the current directory.
  • --tsconfig <path/to/tsconfig.json>
    Specify a typescript config file that should be loaded. If not specified TypeDoc will look for 'tsconfig.json' in the current directory.
  • --exclude <pattern>
    Exclude files by the given pattern when a path is provided as source. Supports standard minimatch patterns.
Theming
  • --theme <default|plugin defined theme>
    Specify the theme that should be used.
  • --name <Documentation title>
    Set the name of the project that will be used in the header of the template.
  • --readme <path/to/readme|none>
    Path to the readme file that should be displayed on the index page. Pass none to disable the index page and start the documentation on the globals page.
Miscellaneous
  • --version
    Display the version number of TypeDoc.
  • --help
    Display all TypeDoc options.

Contributing

This project is maintained by a community of developers. Contributions are welcome and appreciated. You can find TypeDoc on GitHub; feel free to open an issue or create a pull request: https://github.com/TypeStrong/typedoc

For more information, read the contribution guide.

Keywords

FAQs

Last updated on 22 Jun 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc