| OLD | NEW |
| 1 # CMS # | 1 # CMS # |
| 2 | 2 |
| 3 We use this CMS for [adblockplus.org](https://github.com/adblockplus/web.adblock
plus.org/) | 3 We use this CMS for [adblockplus.org](https://github.com/adblockplus/web.adblock
plus.org/) |
| 4 and related websites. It converts a directory with content data into static | 4 and related websites. It converts a directory with content data into static |
| 5 files. You are free to use it for other projects but please keep in mind that we | 5 files. You are free to use it for other projects but please keep in mind that we |
| 6 make no stability guarantees whatsoever and might change functionality any time. | 6 make no stability guarantees whatsoever and might change functionality any time. |
| 7 | 7 |
| 8 ## How to use ## | 8 ## How to use ## |
| 9 | 9 |
| 10 ### Running the test server ### | 10 ### Running the test server ### |
| 11 | 11 |
| 12 The test server will convert your content directory on the fly, your changes | 12 The test server will convert your content directory on the fly, your changes |
| 13 will become visible immediately. To run it you need: | 13 will become visible immediately. To run it you need: |
| 14 | 14 |
| 15 * Python 2.7 | 15 * Python 2.7 |
| 16 * [Flask](http://flask.pocoo.org/), [Jinja2](http://jinja.pocoo.org/) and | 16 * [Jinja2](http://jinja.pocoo.org/) and |
| 17 [Markdown](https://pypi.python.org/pypi/Markdown) modules (can be installed by | 17 [Markdown](https://pypi.python.org/pypi/Markdown) modules (can be installed by |
| 18 running `easy_install Flask Jinja2 Markdown` from the command line) | 18 running `easy_install Jinja2 Markdown` from the command line) |
| 19 * A current copy of the | 19 * A current copy of the |
| 20 [cms repository](https://github.com/adblockplus/cms/) (can be | 20 [cms repository](https://github.com/adblockplus/cms/) (can be |
| 21 [downloaded as ZIP file](https://github.com/adblockplus/cms/archive/master.zip
) | 21 [downloaded as ZIP file](https://github.com/adblockplus/cms/archive/master.zip
) |
| 22 or cloned via `git clone https://github.com/adblockplus/cms.git`) | 22 or cloned via `git clone https://github.com/adblockplus/cms.git`) |
| 23 | 23 |
| 24 Optionally, the [Werkzeug](http://werkzeug.pocoo.org/) module can be installed |
| 25 as well, this will provide some developer features. |
| 26 |
| 24 Run the `runserver.py` script from your content directory, e.g.: | 27 Run the `runserver.py` script from your content directory, e.g.: |
| 25 | 28 |
| 26 python ../cms/runserver.py | 29 python ../cms/runserver.py |
| 27 | 30 |
| 28 Alternatively, the content directory could also be specified as command line | 31 Alternatively, the content directory could also be specified as command line |
| 29 parameter of `runserver.py`. This will start a local web server on port 5000, | 32 parameter of `runserver.py`. This will start a local web server on port 5000, |
| 30 e.g. the page the page `pages/example.md` will be accessible under | 33 e.g. the page the page `pages/example.md` will be accessible under |
| 31 `http://localhost:5000/en/example`. | 34 `http://localhost:5000/en/example`. |
| 32 | 35 |
| 33 Note that the test server is inefficient and shouldn't be run in production. | 36 Note that the test server is inefficient and shouldn't be run in production. |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 filter is invoked. For more information on Jinja2 filters see | 246 filter is invoked. For more information on Jinja2 filters see |
| 244 [official documentation](http://jinja.pocoo.org/docs/dev/api/#writing-filters). | 247 [official documentation](http://jinja.pocoo.org/docs/dev/api/#writing-filters). |
| 245 | 248 |
| 246 ### Custom functions and variables ### | 249 ### Custom functions and variables ### |
| 247 | 250 |
| 248 The `globals` directory can define custom Jinja2 globals which will be available | 251 The `globals` directory can define custom Jinja2 globals which will be available |
| 249 in all Jinja2 templates. Typically, this is used for custom functions. The file | 252 in all Jinja2 templates. Typically, this is used for custom functions. The file |
| 250 name should match the name of the function or variable to be defined, and export | 253 name should match the name of the function or variable to be defined, and export |
| 251 a variable with that name. E.g. `globals/myfunction.py` can define a function | 254 a variable with that name. E.g. `globals/myfunction.py` can define a function |
| 252 called `myfunction` that will become available to all Jinja2 templates. | 255 called `myfunction` that will become available to all Jinja2 templates. |
| OLD | NEW |