doc_components icon indicating copy to clipboard operation
doc_components copied to clipboard

Enable using doc_components as a library or standalone tool

Open NfNitLoop opened this issue 2 years ago • 3 comments

Use Case

I'm writing a library that I want to publish to deno.land because Deno's great, and I get free API doc web pages there. But, I'm not super familiar with JSDoc, or Deno's extensions(?) to that format, so I'd love to be able to preview what my docs will look like on deno.land during development.

Currently, the closest I can do locally is deno doc myMod.ts to see what docs get generated, but that doesn't show me how some web-only things will work:

  • How do my code blocks get formatted?
  • How/Whether my {@link terms} work
  • Did I use (Deno's) JSDoc sytnax properly?

If I want to see the docs rendered, I've got to publish a build to deno.land/x/, see my bugs, patch, and repeat.

Problem(s)

I was hoping to make a quick tool that would use doc_components and let me see its output locally.

However, since doc_components uses import maps, I must mirror those import maps in my tool. And there seems to currently be a bug in deno install that makes import maps not work for installed codebases, which means I won't be able to publish my tool and have others easily use it.

Request

My main goal is to be able to generate docs locally that look like they'll look on deno.land. So the straightforward options are:

  • The Deno (Docs?) team implements such a tool. (yay, easy for me!) :)
  • Update this library to let other folks reuse it to write such a tool.
  • Fix the bug with deno installing import maps.

NfNitLoop avatar Mar 15 '23 19:03 NfNitLoop

Ooh, I forgot a fourth option!

  • Hire me and tell me to fix it! (My resume is already in your application queue somewhere. 😅)

NfNitLoop avatar Mar 15 '23 19:03 NfNitLoop

We want to revive https://github.com/denoland/docland to enable doc generation for various other websites, as it is currently outdated. To achieve this, doc_components will need refactors that would allow rendering with the json output from the deno doc subcommand; this would then enable a path to having a simple tool that would do what you are aiming to do. This however is a backburner item and as such wont happen anytime soon.

crowlKats avatar Mar 16 '23 23:03 crowlKats

aha, thanks. I assume that's https://github.com/denoland/deno_doc/issues/111 ?

NfNitLoop avatar Mar 17 '23 23:03 NfNitLoop