Giter Club home page Giter Club logo

typedoc-plugin-not-exported's Introduction

typedoc-plugin-not-exported

npm package version number Actions Status License

This TypeDoc plugin can force inclusion of specific symbols (variables) that are not exported, by making them fake exports.

Usage

(Assuming you have already installed TypeDoc (npm i -D typedoc) of version equal to or greater than v0.20.16 (released on 2021-01-17, this is the minimum required by this plugin. If you need to update the version, change TypeDoc's version number in package.json and rerun npm i / yarn))

Install the plugin with npm:

npm i -D typedoc-plugin-not-exported

Or with yarn:

yarn add -D typedoc-plugin-not-exported

In your code, tag the symbols (i.e. variables / types / interfaces / classes / object properties / class members etc.) that are not exported but you still want to include in the generated documentation.

The default tag is @notExported.

Example 1:

/**
 * My class
 * @notExported
 */
class MyClass {
  convert(str: string): string {
    return str
  }
}
export const me = new MyClass()

Example 2:

/**
 * @notExported
 */
type twoNumbers = [number, number]
/**
 * @notExported
 */
type threeNumbers = [number, number, number]

export type twoOrThreeNumbers = twoNumbers | threeNumbers
export function sum(ns: twoOrThreeNumbers): number {
  return ns.reduce((a, b) => a + b)
}

Then use the command as usual:

typedoc src/index.ts

Or, if you are using @internalDoNotUse tag instead of @notExported, run:

typedoc --includeTag internalDoNotUse src/index.ts

Links, Tips & Others

Originally from here.

CC0.

TypeDoc converts comments in TypeScript source code into rendered HTML documentation. See Guides, API & repo.

TypeDoc loads all plugins by default, if you want to specify plugins to load, use --plugin flag.

Those non-exported symbols (variables) you want to include in the doc, are not public and the @public tag shouldn't be applied. TypeDoc's @internal tag and typedoc-plugin-internal-external's @internal and @external are not made to solve the problem in question.

Nevertheless, if you want to include a symbol (variable) in the documentation, you should usually export it.

Keywords: typedoc plugin force include non exported unexported variable symbol member fake export option flag tag mode file exclude inclusion internal external

typedoc-plugin-not-exported's People

Contributors

gerrit0 avatar tomchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

typedoc-plugin-not-exported's Issues

Group by file

Hi, I am using this plugin for the dev documentation of this repo: https://github.com/euberdeveloper/byteify

As you can see here (https://byteify-dev.euber.dev), all the "Not Exported" are visible in the root. The purpose of the dev documentation is to show, file by ile, what is contained to maintainers. Hence, I would like all these not exported to be documented inside the files and not in the root of the menu. Is it possible?

Update plugin for typedoc 0.21.5

Thanks for the useful plugin, but please update it for the latest version of typedoc. With this version it outputs:

> npx typedoc --version
Warning: Application.application is deprecated. Plugins are now passed the application
instance when loaded.
    at exports.load (<my project>\node_modules\typedoc-plugin-not-exported\dist\main.js:12:28)
Info: Loaded plugin <my project>\node_modules\typedoc-plugin-not-exported

TypeDoc 0.21.5
Using TypeScript 4.3.5 from <my project>\node_modules\typescript\lib

Info: Windows 10, node 16.6.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.