🔥 amazing PR just merged from @wlls.dev using @deno.land's docs package to generate docs for any package on the npm registry ....
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.
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
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
0 reposts1 like
if interested what it actually does, you can take a look at github.com/denoland/den..., all rust code in this directory is what is used for processing the docnodes to make them into the output of generateHTMLasJSON