New features in mezzanine-pagedown v0.5

100 views
Skip to first unread message

Ahmad Khayyat

unread,
Jun 26, 2013, 11:44:30 PM6/26/13
to mezzani...@googlegroups.com

There is a new version (0.5) of mezzanine-pagedown (PyPI) with a few fresh features:

  • Optional server-side previews in the editor, to have accurate previews that are identical (HTML) to the final page.
    The default is client-side previews using pagedown's js previewer.

  • Convenient support for Python-Markdown extensions, bundled or custom.
    Enabling Markdown Extra is as easy as RICHTEXT_FILTER = 'mezzanine_pagedown.filters.extra'.
    For custom combinations of extensions:

      RICHTEXT_FILTER = 'mezzanine_pagedown.filters.custom'
      PAGEDOWN_MARKDOWN_EXTENSIONS = ('extra','toc')

    With server-side previews, these extensions are enabled in the editor preview.

  • Sanitizing the content after rendering the HTML, while respecting mezzanine's RICHTEXT_ALLOWED_* settings.

I would appreciate any feedback and bug reports from users.

tazogil

unread,
May 25, 2014, 10:47:48 AM5/25/14
to mezzani...@googlegroups.com
Hello Ahmad,

I try to use extra markdown without success. None of the 'extra' extensions are enabled, here are my settings :

RICHTEXT_WIDGET_CLASS = 'mezzanine_pagedown.widgets.PageDownWidget'
RICHTEXT_FILTERS = ('mezzanine_pagedown.filters.extra',)
RICHTEXT_FILTER_LEVEL = 3

"mezzanine_pagedown" is in INSTALLED_APPS

Markdown (2.4)
Mezzanine (3.0.9)
mezzanine-pagedown (0.6)

Could you please help me? thanks by advance.

Ahmad Khayyat

unread,
May 25, 2014, 12:16:40 PM5/25/14
to mezzani...@googlegroups.com
To enable extra in previews, you need to enable server-side preview (by adding the setting and the urls entry). See 6 in the README:

6. (Optional): Server-side previews:

  • In settings.py, enable server-side live previews in the editor:

    PAGEDOWN_SERVER_SIDE_PREVIEW = True
    

    By default (False), previews are generated client-side using PageDown's previewer.

  • In urls.py, enable the preview URL:

    import mezzanine_pagedown.urls
    

    Then add the following line to urlpatterns:

    ("^pagedown/", include(mezzanine_pagedown.urls)),
    

    In this case, the preview URL is /pagedown/preview/. You can replace"^pagedown/" with your own path.



--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/D5r68ibiEpo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tazogil

unread,
May 25, 2014, 4:21:46 PM5/25/14
to mezzani...@googlegroups.com
Thank you for your help !

 it works fine : following yoour instructions, all the extra extensions are now enabled in my pages
 and in the preview if :
("^pagedown/", include(mezzanine_pagedown.urls)),

IS in patterns(), NOT in 18n_patterns(). Can you explain that ? (... but it's not important, anyway :) 
Reply all
Reply to author
Forward
0 new messages