Parsing order, caching, and formats
Order of Parsing
- Look out for [?php[ /uncached code/ ]?] occurances, and strip them out for now.
- Designated format(s), e.g. Markdown, are applied to the content.
[include[contentId]] is looked for.
Note: This means that exact sequences must make it through the specified format! It may be necessary to escape some characters! (This will not be a problem in markdown or plain HTML or bbCode.) (TODO: Verify & test)
If any content was included, it is loaded recursively, so its own content is constructed from its own format(s). That is, for all included content, go back to step 1.
- The PHP stripped from the [?php[ /uncached code/ ]?] occurrances, is placed back into the content.
- If the caching system believes the result should be cached, it is now saved to cache.
- If there were uncached blocks, the whole file is now “included” (the PHP is executed). The final result is returned (to the user, or to the content into which the sub-content was included.)
- Any post-processing, like SmartyPants, or ensuring no long lines?
- Earlier: Would enable caching, but wouldn’t get to process PHP output
- Later: An extra burden on top of caching
- Both: Sometimes might (if implemented so that it’s known when reading cache) only cache once. Def twice or more sometimes. Everything gets smartyPants’d. Unless running it twice introduces errors.
- Done!
