Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatic access to deno doc --json #4531

Closed
lucacasonato opened this issue Mar 30, 2020 · 7 comments
Closed

Programmatic access to deno doc --json #4531

lucacasonato opened this issue Mar 30, 2020 · 7 comments
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)

Comments

@lucacasonato
Copy link
Member

Something like this would be nice:

const documentationNodes = Deno.doc("https://deno.land/std/http/server.ts");

It should probably have the same permission model as the compiler API.

@ry ry added the feat new feature (which has been agreed to/accepted) label Mar 30, 2020
@parkerdgabel
Copy link
Contributor

Is anybody working on this? If not I'll do it.

@lucacasonato
Copy link
Member Author

I already have a working branch, just need to do some cleanup and PR it.

@bartlomieju bartlomieju added the cli related to cli/ dir label May 21, 2020
@irustm
Copy link

irustm commented Dec 11, 2020

@lucacasonato thanks!
any news on this issue? Is there anything I can do to help?

@wperron
Copy link
Contributor

wperron commented Feb 20, 2021

@lucacasonato as I understand it, deno doc is basically emitting a .d.ts annotated with JSdoc correct? following that logic, I think it'd make sense to add this under Deno.emit as a compilerOption rather than introduce another function to the namespace, wdyt?

@bartlomieju
Copy link
Member

@lucacasonato as I understand it, deno doc is basically emitting a .d.ts annotated with JSdoc correct? following that logic, I think it'd make sense to add this under Deno.emit as a compilerOption rather than introduce another function to the namespace, wdyt?

No, deno doc emits a string with custom formatting, while deno doc --json emits custom JSON format.

I'm not a fan of adding Deno.doc especially that it will lead to requests to add programatic access to other CLI tools. Maybe Deno.cli that would harbor other subcommands...

@crowlKats
Copy link
Member

This can extremely easily be achieved by importing deno_doc from /x; the complexities mentioned in #10731 (comment) in my opinion outweigh the little benefit from having this built-in compared to importing.

@crowlKats
Copy link
Member

Closing as this issue predates the possibility to use deno_doc from /x, and as per #10731 (comment) it should be the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

No branches or pull requests

7 participants