Post

Thank you!! Lots of fun directions we can take this, and I'm sure I missed some edge cases. Real heavy lifting here and shoutout goes to the @deno.land folks for providing the underlying tooling. All I did was a little glue code really.

0 reposts4 likes

great to see deno_doc being used! how are you using it exactly? are you using the actual html renderer and modifying the output, `generateHtmlAsJSON`, or raw doc nodes?

pretty naively in this first pass! i'm basically: 1. fetching type urls from esh.sh with an `x-typescript-types` header 2. run it `@deno/doc` slightly patched to get WASM to work on a vercel function 3. take the `DenoDocNode[]` structured AST result 4. flatten, transform, merge, render to HTML

skipping over the details a bit, and there are still some rough edges (especially for complex packages with sprawling entrypoint graphs) but works surprisingly well!

I didn't see `generateHTMLasJSON` but that might be easier than what I'm doing if it does what it sounds like. though we're preprocessing the shiki highlighting server side here too, so maybe the raw doc nodes are more flexible for this use case