Skip to content

Instantly share code, notes, and snippets.

@m000
Created October 30, 2012 10:38
Show Gist options
  • Save m000/3979519 to your computer and use it in GitHub Desktop.
Save m000/3979519 to your computer and use it in GitHub Desktop.
Customizations for wymeditor to be used with django-cms.
# django-cms settings for the WYMEditor.
# See: http://docs.django-cms.org/en/latest/getting_started/configuration.html#editor-configuration
#
# We like WYMEditor because it is semantics-oriented and produces
# nice xhtml code which can then be uniformely formatted using css.
#
# Another option is TinyMCE. It requires the django-tinymce app and
# the CMS_USE_TINYMCE setting.
# We avoid TinyMCE because by default gives more formatting options
# than we think it should. This way semantic-editing is broken and
# applying a uniform look using css becomes more difficult.
WYM_TOOLS = ",\n".join([
"{'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}",
"{'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}",
"{'name': 'Superscript', 'title': 'Superscript', 'css': 'wym_tools_superscript'}",
"{'name': 'Subscript', 'title': 'Subscript', 'css': 'wym_tools_subscript'}",
"{'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'}",
"{'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'}",
"{'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}",
"{'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}",
"{'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}",
"{'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}",
"{'name': 'Paste', 'title': 'Paste_From_Word', 'css': 'wym_tools_paste'}",
"{'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}",
"{'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'}",
"{'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}",
#"{'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'}",
"{'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table'}",
"{'name': 'Preview', 'title': 'Preview', 'css': 'wym_tools_preview'}",
])
WYM_CONTAINERS = ",\n".join([
"{'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}",
"{'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}",
"{'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}",
"{'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}",
"{'name': 'H4', 'title': 'Heading_4', 'css': 'wym_containers_h4'}",
"{'name': 'H5', 'title': 'Heading_5', 'css': 'wym_containers_h5'}",
"{'name': 'H6', 'title': 'Heading_6', 'css': 'wym_containers_h6'}",
"{'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}",
"{'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'}",
"{'name': 'TH', 'title': 'Table_Header', 'css': 'wym_containers_th'}",
])
WYM_CLASSES = ",\n".join([
"{'name': 'date', 'title': 'PARA: Date', 'expr': 'p'}",
"{'name': 'hidden-note', 'title': 'PARA: Hidden note', 'expr': 'p[@class!=\"important\"]'}",
"{'name': 'timetable', 'title': 'TABLE: Timetable', 'expr': 'table'}",
#"{'name': 'author', 'title': 'TABLE: Timetable/Author', 'expr': 'table.timetable td'}",
#"{'name': 'title', 'title': 'TABLE: Timetable/Title', 'expr': 'table.timetable td'}",
])
WYM_STYLES = ",\n".join([
"{'name': '.hidden-note', 'css': 'color: #999; border: 2px solid #ccc;'}",
"{'name': '.date', 'css': 'background-color: #ff9; border: 2px solid #ee9;'}",
])
#Prepare url for wymeditor.css
#from django.conf import settings
#WYM_STYLESHEET = '"%s%s"' % (settings.STATIC_URL, 'css/wymeditor.css')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment