PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

[Documentation Enhancement] An online counterpart to the PNC:R Manual

HipHopHuman opened this issue ยท 8 comments

commented

I was just answering a question in this reddit thread about the minigun and because I haven't played in a while (lots of surgeries in my life right now) I had to do it completely by memory, so I'm sure I posted some wrong info (I did warn of this in my comment though)

Which got me thinking - Botania has an online version of the Lexica which has been super helpful in checking in-game documentation without actually having to be in the game, especially in situations where I'm helping answer questions on Reddit and need to double-check something or when I'm in the midst of building something complex, have a sudden idea, but am not at home to confirm results.

Any chance we could get this for PNC as well? If Botania can output an HTML version of the Lexica, it should be possible to do with PNC as well - just have it as part of the build/release process, host it on GH Pages or even just a .MD file in the repo would be ok

commented

If I knew how Botania did it, then sure. But I'm not sure if the script Vazkii uses is public or not, and I don't have the time to write a custom parser for all the Patchouli JSON in the manual...

commented

Turns out it's just a PHP script that reads the JSON from the (raw) master branch on Github. https://github.com/VazkiiMods/Botania/blob/master/web/module/lexicon.php

For Botania that means file hosting, but a similar thing can be done with a static site generator written in any language that can read JSON

commented

Vazkii doesn't develop Botania anymore - williewillus does. I can ask him. Will get back

commented

Yeah, that's not really going to work here. Firstly, I don't have a web hosting solution like they do, and secondly the text for Botania's lexicon is entirely in an external translation file rather than the manual JSON files, something I didn't even know was possible (because it's not documented as far as I can find). And their PHP script depends on that, so it isn't going to work here.

Easiest option would be a script which takes the existing manual data (from https://github.com/TeamPneumatic/pnc-repressurized/tree/1.16.4/src/main/resources/data/pneumaticcraft/patchouli_books/book) and converts it to Markdown, and uploads that to the project's Wiki (https://github.com/TeamPneumatic/pnc-repressurized/wiki) - that could even be part of the gradle build system for the project.

As I mentioned, I don't have the time to develop that at the moment. I'm not averse to someone contributing code for that though :)

commented

Github Pages + a static site generator - no web hosting is needed. The wiki idea also works. Both could be part of a build system. I could look into it once I'm done with my surgery (last operation is on the 24th)

commented

I've been sort of looking at this issue inbetween surgeries and it looks somewhat approachable, but I'm starting to reconsider having it as a base feature of PNC. It seems like something that would have far more value as a generic build tool for mod developers. I'm looking at possibly compiling a binary using Rust that could generate a markdown version of Patchouli JSON, that a dev could just run in the root of their repository folder, but since I'm not a mod developer I'm not aware if every mod follows the same folder structure/format for their Patchouli books. What'dya think?

commented

That's probably a good idea. Structure should be pretty standard: for modders, books go in src/main/resources/data/<mod-name>/patchouli_books/<book-name> - overall book structure is documented here: https://github.com/VazkiiMods/Patchouli/wiki/Getting-Started

Best bet would be to try to determine a sensible default for the location, but allow overriding the book folder via command line args, I think.

commented

So I've started exploring more into this and found out the translation thing is actually documented, but it's not extensive documentation by any means. There's basically a bullet point in the book.json entry that tells you about what the i18n field does (this is what enables the translation).

So, I've kind of figured out a decent strategy to this, but there's a bit of a blocker. Apparently there are plans to move away from the JSON format toward a templating engine called Apache Freemarker, which is a long-term change projected for 1.18, though not gauranteed. (imo I think going with a more standardized markup format would be better, for e.g. mustache/handlebars which has parsers in almost every mainstream language)

So I'm not sure if I should just gung-ho for the JSON syntax as it is atm, or wait until this is available and tackle both at the same time. I'll have to think more on it.