SPH_SETTINGS
SPH_SETTINGSSCT has a few global preferences which can be configured in your settings.py. To avoid name clashes and make it easier to find those settings SCT uses only one dictionary - called SPH_SETTINGS.
You can configure them in your settings.py:
SPH_SETTINGS = {
'markdown_number_headings': True,
}
1. Inline documented settings
A few settings are not included on this site - either because i forgot to add them, they are very obscure and never used, etc.
But most of them are documented inline:
If you have further questions feel free to ask in the board.
2. Community
2.1. Settings for avatars
- community_avatar_default - Specifies the location of the default avatar.
- community_avatar_default_width - width of the default avatar
- community_avatar_default_height - height of the default avatar
- community_avatar_max_width - the max width of an avatar uploaded by a user
- community_avatar_max_height - the max height of an avatar uploaded by a user
- community_avatar_max_size - the max file size of an avatar uploaded by a user in bytes
3. Markdown (Wiki Renderings)
3.1. markdown_number_headings - True/False
Allows you to activate or disable automatic numbering of all headings (default: True)
3.2. markdown_top_heading_level - Integer
Allows you to define with which level the header numbering should start. by default h1 is used. if you set this to 2 it starts with an h2 html tag.
4. Wiki
4.1. wikilink_regexp - String
Configures the regular expression used for finding wikilinks. The default can be found in the subversion repository: http://yourhell.com/svn/root/django/communitytools/trunk/sphenecoll/sphene/sphwiki/wikilink_utils.py (WIKILINK_RE)
5. Board
5.1. board_markup_enabled
List of enabled markup languages for forum posts.
Default:
SPH_SETTINGS['board_markup_enabled'] = ( 'bbcode', )
Available options:
- bbcode
- markdown
The default is still just 'bbcode' because there are several problems with the markdown rendering. (Like: quoting other posts - it is impossible to quote a bbcode post in a markdown post..)
5.2. board_custom_markup
This option works together with board_markup_enabled and can be used to add custom functions which can be used as markup.
For example let's assume we want to create a simple markup function which only wraps the output into a html "pre" tag.
We start by creating a class somewhere in the python path. In my example it's in sphene/custom_renderers.py (For your renderers it makes sense to put them into your own project / application paths)
from sphene.sphboard.renderers import BaseRenderer
class SimpleMarkup(BaseRenderer):
label = 'Very Simple Markup'
reference = '<a href="/link/to/some/documentation.html">Very Simple Markup</a>'
def render(self, text):
return "<pre>%s</pre>" % body
Now define this markup in your settings.py:
SPH_SETTINGS['board_custom_markup'] = { 'simplemarkup': 'sphene.custom_renderers.SimpleMarkup', }
(The dictionary consists of 1.) the method name including the whole module name and 2.) a label which is displayed to the user.)
To allow users to use this markup we have to enable it, just like any other markup using board_markup_enabled:
SPH_SETTINGS['board_markup_enabled'] = ( 'bbcode', 'simplemarkup', )
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 your custom markup method if you don't want to give your users a choice.
5.3. Heat
See Board/Heat for configuration of how the heat of threads are calculated.
6. Miscellaneous
6.1. wiki_rss_url
Is used by the default wiki showSnip template to create a link to a rss feed.
This should be set to /feeds/wiki/ - which by default lists the latest changes of all wiki snips in the current community group.
Last Modified: 2018-07-24 04:35:56 by Herbert Poul - [ Snip Changes ] [ Wiki History ]
0 Comments
No comments yet.
Please login to create a new thread.