yihui/knitr — Issue #98: User defined patterns = hooks for document processing
Author: renozao
Created: 2012-01-22 05:39:29+00:00
State: open

The user would need to provide a regular expression and a function to treat the matches. This is similar to knitr hooks, but working at the document level, instead of code chunks. I will copy/paste this in a separate issue.
As a start the patterns could be executed at two processing stages: at pre-processing for substitution of patterns by valid knitr text/commands, or post-processing for doing some stuff on the generated documents (e.g. \appendix concatenations, re-organisation of files (e.g. copy to web servers), building of indexes, etc...)

This would make knitr even more powerful and flexible as many new features (built-in or user-defined) could be easily added as pattern hooks.

Thanks