Typedoc: Generate documentation from JSON output

Created on 16 Jan 2020  路  5Comments  路  Source: TypeStrong/typedoc

JSON file could also be used as the input for Typedoc

Typedoc can output a JSON file containing all the reflection data instead of creating the HTML (or other format) documentation. It would good if this JSON file could also be used as the input for Typedoc and the HTML (or other format) documentation generated from that JSON.

Problem

I work with a documentation portal, and I do not have access to the TypeScript code itself, just the exported reflection data (JSON). I'd like to process this into documentation and manage the templates/theming within my side of things.

Suggested Solution

Allow Typedoc JSON format refelection data to be used as input for the Typedoc tool.

enhancement

Most helpful comment

This would be a neat bit of functionality to support. I think we should eventually be able to do this... it's a ways off though. Some information in the reflections isn't reflected in the JSON output. (Mainly cross references, I think all the type information is present)

All 5 comments

This would be a neat bit of functionality to support. I think we should eventually be able to do this... it's a ways off though. Some information in the reflections isn't reflected in the JSON output. (Mainly cross references, I think all the type information is present)

Some information in the reflections isn't reflected in the JSON output.

Can you expound on this @Gerrit0? I was planning on using the JSON output to build a simple markdown doc for some internal Typescript libraries we use.

I think with 0.20 we're a lot closer to being able to do this in TypeDoc itself. Missing items I can think of initially:

  • files / directories on ProjectReflection - I want to remove these anyways. We build them up but don't really use it for anything, and AFAIK no plugin does either.
  • url, anchor, hasOwnDocument, cssClasses on Reflection - these are all inappropriately placed anyways, they shouldn't live on the reflections.

... and that's all I can think of right now, which means this is actually a lot closer to being possible than I thought it was. It might be one of the goals of 0.22 since 0.21 is going to clean up both of these.

This shouldn't stop you from using the JSON output today. This request is for TypeDoc being able to be re-run on JSON produced from a prior run. It's certainly possible to generate docs with a different tool from the json already.

Thanks for the clarification!

This would be a killer feature.

Was this page helpful?
0 / 5 - 0 ratings