Parsing in reverse is code generation.
Think of a compiler as a translator: first, it parses usually to an intermediate data structure (often a tree), then it walks that intermediate data structure generating code for another language, sometimes as a textual output. Essentially code generation is the reverse of parsing.
The output language of a compiler is usually more primitive (i.e. byte code, assembly, or machine code), but can just as easily be another high-level language.
See, for example, google closure compiler (JavaScript input, JavaScript output). Or TypeScript, which takes TypeScript input to JavaScript output.
So, you should try to encode your content as a tree and employ code generation techniques. Or encode as text and use translation techniques (parse the text input, generate text output).
Translation can be done for a lot of reasons. For example, in the early days, different SQL implementations actually had different operator precedence! So, compiler technology translation was employed to take SQL written for one vendor and translate to SQL fully parenthesized to use with another.