MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

A config option to enable substitutions in code and code blocks

Open neongreen-sc opened this issue 1 year ago • 0 comments

Describe the feature you'd like to request

Right now, using substitutions in inline code / code blocks is rather cumbersome.

For inline code, you have to write smth like:

Instance {{ '`' + prod_instance + '`' }} is very important.

For code blocks, there's no good solution other than https://github.com/adamtheturtle/sphinx-substitution-extensions.

Describe the solution you'd like

For substitution-heavy documents, a config option like "enable_substitutions_in_code" would be very helpful. Authors can always configure substitution delimeters so that they don't clash with normal code.

Describe alternatives you've considered

  • Use block/inline attrs to enable substitutions (could work for arbitrary roles then, not just code or code blocks)

neongreen-sc avatar Oct 27 '24 12:10 neongreen-sc