SPH_SETTINGS
SPH_SETTINGSBack to Snip <-- Previous Change | Next Change -->
| Diff Summary | |||||
|---|---|---|---|---|---|
| Title | |||||
| Date | 2007-06-16 21:05:47 | 2007-07-31 21:40:06 | |||
| Editor | Herbert Poul | Herbert Poul | |||
| Tags | |||||
| 2007-06-16 21:05:47 by Herbert Poul | 2007-07-31 21:40:06 by Herbert Poul | ||||
|---|---|---|---|---|---|
| 46 | - bbcode | 46 | - bbcode | ||
| 47 | - markdown | 47 | - markdown | ||
| 48 | 48 | ||||
| 49 | The default is still just 'bbcode' because there a | 49 | The default is still just 'bbcode' because there a | ||
| > | re several problems with the markdown rendering. ( | > | re several problems with the markdown rendering. ( | ||
| > | Like: quoting other posts - it is impossible to qu | > | Like: quoting other posts - it is impossible to qu | ||
| > | ote a bbcode post in a markdown post..) | > | ote a bbcode post in a markdown post..) | ||
| 50 | 50 | ||||
| t | t | 51 | ## board_custom_markup | ||
| 52 | |||||
| 53 | This option works together with board_markup_enabl | ||||
| > | ed and can be used to add | ||||
| 54 | custom functions which can be used as markup. | ||||
| 55 | |||||
| 56 | For example let's assume we want to create a simpl | ||||
| > | e markup function which only wraps the output into | ||||
| > | a <pre> </pre> tag. | ||||
| 57 | |||||
| 58 | We start by creating a function somewhere in the p | ||||
| > | ython path. In my example it's in sphene/custom_ma | ||||
| > | rkup.py | ||||
| 59 | |||||
| 60 | def simplemarkup(body): | ||||
| 61 | return "<pre>%s</pre>" % body | ||||
| 62 | |||||
| 63 | Now define this markup in your settings.py: | ||||
| 64 | |||||
| 65 | SPH_SETTINGS['board_custom_markup'] = { 'sphen | ||||
| > | e.custom_markup.simplemarkup': 'Very simple markup | ||||
| > | ', } | ||||
| 66 | |||||
| 67 | (The dictionary consists of 1.) the method name in | ||||
| > | cluding the whole module name and 2.) a label whic | ||||
| > | h is displayed to the user.) | ||||
| 68 | |||||
| 69 | To allow users to use this markup we have to enabl | ||||
| > | e it, just like any other markup using board_marku | ||||
| > | p_enabled: | ||||
| 70 | |||||
| 71 | SPH_SETTINGS['board_markup_enabled'] = ( 'bbco | ||||
| > | de', 'sphene.custom_markup.simplemarkup', ) | ||||
| 72 | |||||
| 73 | This will leave 'bbcode' as the default selection, | ||||
| > | but users can also select the 'Very simple markup | ||||
| > | '-markup. - You can of course also define only you | ||||
| > | r custom markup method if you don't want to give y | ||||
| > | our users a choice. | ||||
| 74 | |||||
| 51 | # Miscellaneous | 75 | # Miscellaneous | ||
| 52 | 76 | ||||
| 53 | ## wiki_rss_url | 77 | ## wiki_rss_url | ||
| 54 | 78 | ||||
| 55 | Is used by the default wiki showSnip template to c | 79 | Is used by the default wiki showSnip template to c | ||
| > | reate a link to a rss feed. | > | reate a link to a rss feed. | ||
Powered by Sphene Community Tools
