There are really three kinds of converters in TypeDoc
- File
- Modules
- Library
Each of these may share individual node converters, but they are fundamentally different. File mode creates a globals map. Modules mode creates a map representing the structure of the package. Library mode creates a map describing the project from one or more entry points.
Furthermore, giving each mode its own converter makes it possible for modes which don't care about which nodes are actually used to create a definition to avoid including those implementation details in their documentation. For instance, a module which is re-exported with export * as ns from './f'
in library mode should just be another namespace in the documentation, while modules mode should include it as a module, and create a reference.
Each of these converters should be able to share a common models library, where the model will be picked according to each converters needs. Library mode should not be required to create a "globals" object that it attaches its output to.
Changing this setup will make it possible for parts of TypeDoc to be used by other tools, without needing to drag along all of TypeDoc's baggage for handling HTML rendering, pulling in doc comments from the filesystem, or any other of the many custom features TypeDoc has added.
TypeDoc should really be a fairly light wrapper around a few components.
- Options
- Models
- Converter (pick the relevant one)
- Serializers
- JSON
- HTML
- (plugin provided)
Once models are well defined, I'd really like to be able to deserialize from JSON to the models (I've said this isn't happening before, but I want it to). Then TypeDoc could be run on a JSON file created with an earlier run.