logseq / plugins

Documentation site of Logseq plugins
https://plugins-doc.logseq.com/
20 stars 2 forks source link

Api documentation as json or interactively? #11

Open inktrap opened 1 year ago

inktrap commented 1 year ago

I checked out the api documentation and couldn't find a way to get the modules and methods in a machine readable way. However typedoc states that you can generate json from the comments.

Could we add json somehow, maybe for something like

https://plugins-doc.logseq.com/logseq/baseInfo

it could just be:

https://plugins-doc.logseq.com/logseq/baseInfo.json

An alternative could be something like swagger, which is for OpenApi-documented RESTful apis only. But maybe there exists something comparable for typedoc?!

inktrap commented 1 year ago

Ah I found out.json

Maybe I'll just give some background why I opened this issue.

While looking at the docs/example page (default local link is http://127.0.0.1:12315/) I got the idea to write an api client which derives its capabilities automatically from the docs/out.json. Then you wouldn't have to read the docs but have autocompletion and could validate commands before they are sent. (Edit: just wondering: could this be done genericly if typedoc permits this?)

I know there are other projects doing this, and it seems like a good idea. I even did this once by parsing html, and while it worked (and showed some errors in the documentation/api (depending on your pov) btw), but that is a route I never want to take again.

Edit: I "remembered" the project I liked, it is a wrapper/lib for tmdb: tmdbsimple. It looks pretty generic and is a "One-to-one mapping between tmdbsimple methods and TMDb endpoints."