[Doc] JSON version of lua-api documentation

cyfrov
Inserter
Inserter
Posts: 25
Joined: Thu May 03, 2018 7:09 pm
Contact:

[Doc] JSON version of lua-api documentation

Post by cyfrov »

Any chance that the devs can provide JSON structured variants of the lua API doc?
i.e. the current api documentation is at:
https://lua-api.factorio.com/${VERSION}/${OBJECT}.html
let's have a machine friendly version at:
https://lua-api.factorio.com/${VERSION}/${OBJECT}.json

Main advantage is that it would make it much easier to feed the latest API into a your favorite editor extension.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14264
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by Rseding91 »

The current docs system directly generates html so there's no simple "output it as JSON instead". If one of the other devs want to write that logic they can but until then this isn't going to happen.
If you want to get ahold of me I'm almost always on Discord.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by eradicator »

Has anything changed on that topic or has anyone written an html parser for this?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
Sanqui
Factorio Staff
Factorio Staff
Posts: 326
Joined: Mon May 07, 2018 7:22 pm
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by Sanqui »

Do you have an example of the exact format you'd like? E.g. some that is already well supported by editors.
ovo
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by Bilka »

Sanqui wrote: Tue Oct 22, 2019 2:42 pm Do you have an example of the exact format you'd like? E.g. some that is already well supported by editors.
This perhaps: https://github.com/simonvizzini/vscode- ... aster/data
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
Sanqui
Factorio Staff
Factorio Staff
Posts: 326
Joined: Mon May 07, 2018 7:22 pm
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by Sanqui »

I think this makes a lot of sense and I could do it sometime, so I'll move this to the normal forum
ovo
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by eradicator »

(Sorry for the late answer)
Sanqui wrote: Tue Oct 22, 2019 2:42 pm Do you have an example of the exact format you'd like? E.g. some that is already well supported by editors.
No i don't have any particular format requirement beyond "easily parsable". I thought about including it in an extension of my "/sudo" mod for which i'd have to reparse it anyway. As the engine supports lua and json easily, either of both would be mighty fine. I use Notepad++ as an editor but it uses xml for auto-completition hints, so i'd rather generate that xml myself from a simpler format.
Sanqui wrote: Tue Oct 22, 2019 2:54 pm I think this makes a lot of sense and I could do it sometime, so I'll move this to the normal forum
Awesome! That VScode json format linked by @Bilka looks reasonably easy to parse. And VScode is pretty popular too.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
asdff45
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by asdff45 »

That is great! Unfortunately not retroactive, but awesome fo the future.
Can we have such a json output for prototype definitions as well (even though they are only in the wiki and mostly manually updated)?
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by eradicator »

asdff45 wrote: Fri Aug 20, 2021 4:25 pm Can we have such a json output for prototype definitions as well (even though they are only in the wiki and mostly manually updated)?
I would still love this even if it's a link on the wiki page "download json" and can't be packaged with normal releases (update cycles etc).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 249
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by Therenas »

asdff45 wrote: Fri Aug 20, 2021 4:25 pm That is great! Unfortunately not retroactive, but awesome fo the future.
Can we have such a json output for prototype definitions as well (even though they are only in the wiki and mostly manually updated)?
I'd have liked to make it work retroactively, but unfortunately getting this to work well required extensive adjustments of large parts of the documentation, which the old releases won't have, so their docs would be much less functional.

Regarding your second point, who knows what the future brings.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14264
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by Rseding91 »

Side thing; what reason would anyone have for wanting old versions of the Lua API in machine readable format?
If you want to get ahold of me I'm almost always on Discord.
asdff45
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun Aug 07, 2016 1:23 pm
Contact:

Re: [Doc] JSON version of lua-api documentation

Post by asdff45 »

I had that available for my intellij plugin, but i can just drop support for those old verions. I don't think people are still developing for them.
Post Reply

Return to “Implemented mod requests”