[Doc] JSON version of lua-api documentation
[Doc] JSON version of lua-api documentation
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.
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.
Re: [Doc] JSON version of lua-api documentation
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.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [Doc] JSON version of lua-api documentation
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [Doc] JSON version of lua-api documentation
Do you have an example of the exact format you'd like? E.g. some that is already well supported by editors.
ovo
Re: [Doc] JSON version of lua-api documentation
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.
Re: [Doc] JSON version of lua-api documentation
I think this makes a lot of sense and I could do it sometime, so I'll move this to the normal forum
ovo
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [Doc] JSON version of lua-api documentation
(Sorry for the late answer)
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.
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [Doc] JSON version of lua-api documentation
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)?
Can we have such a json output for prototype definitions as well (even though they are only in the wiki and mostly manually updated)?
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [Doc] JSON version of lua-api documentation
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [Doc] JSON version of lua-api documentation
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.
Re: [Doc] JSON version of lua-api documentation
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.
Re: [Doc] JSON version of lua-api documentation
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.