Skip to content

Add optional section dependent on the presence or absence of a mod - #109

Open
XFactHD wants to merge 1 commit into
AppliedEnergistics:mainfrom
XFactHD:optional_section
Open

Add optional section dependent on the presence or absence of a mod#109
XFactHD wants to merge 1 commit into
AppliedEnergistics:mainfrom
XFactHD:optional_section

Conversation

@XFactHD

@XFactHD XFactHD commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds an OptionalSection block tag which allows the contained content to be conditionally rendered depending on the presence or absence of another mod. This is for example useful in cases where a guide describes optional mod compat and wants to hide the relevant paragraph(s) in the absence of the mod and/or hide a description of a fallback mechanism in the presence of the mod.
If preferred I can switch the inversion of the condition from a ! prefix to an additional boolean attribute.

@shartte

shartte commented Aug 16, 2026

Copy link
Copy Markdown
Member

What I am currently pondering about is how to handle this in the site export, and whether we should introduce some sort of expression language, hm. 🤔

@XFactHD

XFactHD commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

My instinct for the site export would be to include these sections unconditionally.

@shartte

shartte commented Aug 18, 2026

Copy link
Copy Markdown
Member

Hm, I was thinking they should probably only be included if the mods were present when the site export actually ran. I have to double check the mechanics of this... But if the mods were not present, the content referenced by those sections might also not be present and not be part of the export. 🤔

Yeah I gotta double check that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants