Vexatos / RTFM

A Markdown-Based Custom Manual
Other
3 stars 2 forks source link

Example tab always present without user intervention #7

Closed thiakil closed 6 years ago

thiakil commented 6 years ago

I know the example tab is intended to help users of the mod (e.g. modpack makers) understand the config file.

My issue is that when using this mod as a dependency to add my mod's guide book, the example tab will always be there unless the user edits their config file to be something like:

manual {

    exampletab {
    }

}

So off the top of my head this leaves a couple of options

I prefer the first option because I would like to use it in at least a couple mods (that don't depend on each other).

What say ye?

Vexatos commented 6 years ago

The example tab is there when there are no other tabs added in the config file. While adding tabs through the API is possible, why wouldn't you use the config instead? If you add a different tab in the config, the example tab won't be regenerated.

Multiple books, also for other mods to use and add as guide books, are not really an intended thing yet (see issue #5); that would come with the possibility for other mods to add tabs along with entirely new books. Right now, the mod is intended for mod pack devs to add information to the book using the config file, and not for mod developers.

Furthermore, you shouldn't directly shade things into your mod, at least not without renaming the package. That would (and already did) cause compatibility issues with this mod.

thiakil commented 6 years ago

why wouldn't you use the config instead?

Because I am not a mod pack maker. I am adding a tab via api, and providing the contents inside my jar.

Multiple books

I mentioned nothing of the sort. I add a tab via api.

Right now, the mod is intended for mod pack devs to add information to the book using the config file, and not for mod developers.

I am aware, hence the acknowledgement in the first sentence. You do provide api methods to do the same however.

Furthermore, you shouldn't directly shade things into your mod, at least not without renaming the package

To that I point you to this:

"To Shade a library is to take the contents files of said library, put them in your own jar, and change their package." - https://forgegradle.readthedocs.io/en/latest/user-guide/shading/

Also, I'm well aware what the consequences of doing it badly are, thanks.

Vexatos commented 6 years ago

The API methods to do it were virtually copy-pasted from the manual code of TIS-3D which is a java port of the manual code in OpenComputers, that's why it is a thing. Other mods adding tabs isn't the intention of this mod, but it might come in the future, along with #5.

Also, I'm well aware what the consequences of doing it badly are, thanks.

Other mods have already been using the RTFM manual code for their own books, without changing the packages. I was just making sure.

thiakil commented 6 years ago

but it might come in the future

So the fact that it's already possible is a "don't do that" kinda thing?!

Vexatos commented 6 years ago

More of a "oh right that is a thing, yea it's not really intended just yet".

thiakil commented 6 years ago

Ok, so what's your preferred course of action? I'm happy to work on making it possible & PR, or can leave it to you.

Or if you'd really prefer I can bundle the code under a different package to shove in my jar(s) with modifications as appropriate? (for the record I'm not fond of the idea, but putting it out there to cover bases, you've mentioned others have already done this)