I have a strange use case that I'd like to find a solution for, if only a hack solution until I find something better
I'm using Sphinx for class curriculum for a training course I teach and the answers are currently next to the exercises in ifconfig:: show_answers blocks
I used to generate PDFs with the answers specifically. I'd like to instead show the answers in an answers page in the Sphinx website.
Initially I thought maybe I could set a show_answers variable in the rst file before doing my ".. include::" lines to include the exercise files.
it seems that rST probably doesn't allow setting variables and then checking them in an "if" statement
my next idea was to do some logic in a custom page.html file to manipulate the config variable based on the page name... still not sure if that one is possible
so: conditional logic for one file included in two places... is there any way to do this in Sphinx?
fading: was trying to make my own directive that would add tags or change config on-the-fly. I ended up making a hack solution via a directive that checks whether the document has a particular URL and conditionally shows/hides children accordingly (similar to ifconfig)
works for now. I'd be interested in refactoring to a tag-based solution later if that's the recommended method
[02sphinx] 07RobRuana 03678f606 - Fix #2227: [Napoleon] Fixes issue in which bulleted lists in parameter descriptions could cause the sphinx builder to fail