posativ/acrylamid — pull request #230 by ckoepp (2014-12-07 13:27:56+00:00)
Title: Added Replace Filter

I wrote a small filter to replace fixed place-holders with user-defined strings. The filter is configured using the ``REPLACE_RULES`` variable in conf.py.

Personally, I use it so simply transform smilies into a [Font Awesome](http://fortawesome.github.io/Font-Awesome/) icon. It's just way nicer to split design and content by just using ``:-)`` in the actual text-files which is than transformed in something more beautiful like a smiley image.

To keep it simple I used a dict as configuration. The key is the place-holder used in the content files and the value describes the string which is than visible in the output:

```python
REPLACE_RULES = {
':-)' : '',
'$last_compilation$' : datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
'~foo~' : 'bar',
}

(...)
FILTERS += ['replace']
```

I hope there are more people which find this useful...