Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
New Mezzanine Markdown editor with media library integration
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ahmad Khayyat  
View profile  
 More options Nov 8 2012, 2:50 am
From: Ahmad Khayyat <akhay...@gmail.com>
Date: Wed, 7 Nov 2012 23:50:46 -0800 (PST)
Local: Thurs, Nov 8 2012 2:50 am
Subject: New Mezzanine Markdown editor with media library integration

I am pleased to announce that a new Markdown editor for Mezzanine is
available at:

https://bitbucket.org/akhayyat/mezzanine-pagedown

First, many thanks to the mezzanine-mdown<https://bitbucket.org/onelson/mezzanine-mdown>and
django-pagedown <https://bitbucket.org/moberley/django-pagedown> projects.

This project does mainly three things:

- Provides a rich text editor for mezzanine, based on Mezzanine-mdown.
- Uses the PageDown Markdown editor and viewer, based on django-pagdown.
- Integrates the editor's 'insert image' button with Mezzanine's media
library via a jquery-ui dialog, which is this project's contribution.

It also styles the editor and previewer to match Grappelli's admin theme.

Screenshots:
- The editor: http://imgur.com/hpyXt
- The media library browser: http://imgur.com/xdXhO

I should point out that it requires a fresh checkout of filebrowser_safe,
specifically one that includes commit 35fe7e3<https://bitbucket.org/stephenmcd/filebrowser-safe/changeset/35fe7e3ec...>
Otherwise, it's ready to use. Just follow the instructions in the README.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen McDonald  
View profile  
 More options Nov 16 2012, 9:41 pm
From: Stephen McDonald <st...@jupo.org>
Date: Sat, 17 Nov 2012 13:41:08 +1100
Local: Fri, Nov 16 2012 9:41 pm
Subject: Re: [mezzanine-users] New Mezzanine Markdown editor with media library integration

Great stuff Ahmad, thanks for your work on this.

I've added mezzanine-pagedown to the list of third-party apps in the
readme, and I've just merged the filebrowser-safe changes in - at the
latest, I'll do an official release with the next Mezzanine release.

--
Stephen McDonald
http://jupo.org

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad Khayyat  
View profile  
 More options Nov 17 2012, 12:05 am
From: Ahmad Khayyat <akhay...@gmail.com>
Date: Sat, 17 Nov 2012 00:05:20 -0500
Local: Sat, Nov 17 2012 12:05 am
Subject: Re: [mezzanine-users] New Mezzanine Markdown editor with media library integration

On Fri, Nov 16, 2012 at 9:41 PM, Stephen McDonald <st...@jupo.org> wrote:
> I've added mezzanine-pagedown to the list of third-party apps in the
> readme,

Great! Thanks.
One note though.. I'm not sure Pagedown is considered a WYSIWYG editor.
It's a markdown editor, so perhaps a WYSIWY*M*? No biggie though.

> and I've just merged the filebrowser-safe changes in - at the latest, I'll
> do an official release with the next Mezzanine release.

Oh great. Perhaps some documentation is needed to explain how an app can
launch the filebrowser for file selection? Where should such documentation
go? The documentation text is already in the pull
request<https://bitbucket.org/stephenmcd/filebrowser-safe/pull-request/2/incl...>
.

Also, ideally, other editors/widgets should use this browser instead of the
current if-else special handling for each calling widget in
filebrowser-safe<https://bitbucket.org/stephenmcd/filebrowser-safe/src/433d13255243a15...>.
From a user's point-of-view, the visible difference is that the filebrowser
pop-up window is replaced by an in-window jquery-ui dialog. From a
developer's point-of-view, it's a single, generic API instead of doing
different things for different calling widgets.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen McDonald  
View profile  
 More options Nov 17 2012, 12:10 am
From: Stephen McDonald <st...@jupo.org>
Date: Sat, 17 Nov 2012 16:09:54 +1100
Local: Sat, Nov 17 2012 12:09 am
Subject: Re: [mezzanine-users] New Mezzanine Markdown editor with media library integration

There's a section for the editor under "admin customisation", a sub-section
under the WYSIWYG section would be perfect:

https://github.com/stephenmcd/mezzanine/blob/master/docs/admin-custom...

> Also, ideally, other editors/widgets should use this browser instead of
> the current if-else special handling for each calling widget in
> filebrowser-safe<https://bitbucket.org/stephenmcd/filebrowser-safe/src/433d13255243a15...>.
> From a user's point-of-view, the visible difference is that the filebrowser
> pop-up window is replaced by an in-window jquery-ui dialog. From a
> developer's point-of-view, it's a single, generic API instead of doing
> different things for different calling widgets.

Agreed :-)

--
Stephen McDonald
http://jupo.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eduardo Rivas  
View profile  
 More options Nov 28 2012, 6:27 pm
From: Eduardo Rivas <jerivasmel...@gmail.com>
Date: Wed, 28 Nov 2012 15:27:10 -0800 (PST)
Local: Wed, Nov 28 2012 6:27 pm
Subject: Re: New Mezzanine Markdown editor with media library integration

Hello, I just installed mezzanine-markdown and its awesome! However, I
believe I'm experiencing some bug with codehilite. When I right my code
blocks in the admin interface (using four-space indentation), the preview
renders just fine (not highlighted, of course, but in mono font and dark
background). However, when I save the field and visit the site, the code is
highlighted, but it appears in a single line. Examining the rendered HTML
reveals that all the <span> tags generated by pygments follow each other
without spaces or line breaks.

For example, my markdown is as follows:

    #!python
    from fake import lies

    if somestuff:
        do_stuff

And the result in the site is a single line:

fromfakeimportliesifsomestuff:do_stuff

Any ideas?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad Khayyat  
View profile  
 More options Nov 29 2012, 2:47 am
From: Ahmad Khayyat <akhay...@gmail.com>
Date: Thu, 29 Nov 2012 02:47:49 -0500
Local: Thurs, Nov 29 2012 2:47 am
Subject: Re: [mezzanine-users] Re: New Mezzanine Markdown editor with media library integration

On Wed, Nov 28, 2012 at 6:27 PM, Eduardo Rivas <jerivasmel...@gmail.com>wrote:

> Hello, I just installed mezzanine-markdown and its awesome!

Did you mean mezzanine-pagedown? If yes, then.. Thanks! If not, then please
ignore the rest of this message ;)

> However, I believe I'm experiencing some bug with codehilite.

I admit that codehilite integration received absolutely no testing. I
shamelessly reused that code from mezzanine-mdown. That said, I don't see
how codehilite could cause problems, being merely color-related CSS.

I could not reproduce what you are getting. I do get spaces and newlines.
In fact, here is the actual generated code from your snippet:

<table class="codehilitetable"><tbody><tr><td class="linenos"><div
class="linenodiv"><pre>1
2
3
4</pre></div></td><td class="code"><div class="codehilite"><pre><span
class="kn">from</span> <span class="nn">fake</span> <span
class="kn">import</span> <span class="n">lies</span>

<span class="k">if</span> <span class="n">somestuff</span><span
class="p">:</span>
    <span class="n">do_stuff</span>
</pre></div>
</td></tr></tbody></table>

-----------------

Do you have the same problem without codehilite?
i.e. RICHTEXT_FILTER = 'mezzanine_pagedown.filters.plain'


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eduardo Rivas  
View profile  
 More options Nov 29 2012, 11:20 am
From: Eduardo Rivas <jerivasmel...@gmail.com>
Date: Thu, 29 Nov 2012 08:20:42 -0800 (PST)
Local: Thurs, Nov 29 2012 11:20 am
Subject: Re: New Mezzanine Markdown editor with media library integration

The plain filter gets it right (I switched to triple colons to avoid line
numbers for now). HTML source:
<pre><code>:::python
from fake import lies

if somestuff:
    do_stuff
</code></pre>

But when I use the codehilite filter, I get this HTML source:
<div class="codehilite"><pre><span class="kn">from</span><span
class="nn">fake</span><span class="kn">import</span><span
class="n">lies</span><span class="k">if</span><span
class="n">somestuff</span><span class="p">:</span><span
class="n">do_stuff</span></pre></div>

The template tag I'm using is {{ blog_post.content|richtext_filter|safe }}

I removed the "safe" filter, and of course, that escaped pagedown's output,
but in this case I can see the spaces are preserved. Page content:
<pre><span class="kn">from</span> <span class="nn">fake</span> <span
class="kn">import</span> <span class="n">lies</span> <span
class="k">if</span> <span class="n">somestuff</span><span
class="p">:</span> <span class="n">do_stuff</span> </pre>

So, is the safe filter conflicting with pagedown? What version of Python,
Django and Mezzanine are you testing with? I have 2.7, 1.4.2 and latest
master from github respectively.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad Khayyat  
View profile  
 More options Nov 29 2012, 11:45 am
From: Ahmad Khayyat <akhay...@gmail.com>
Date: Thu, 29 Nov 2012 11:45:45 -0500
Local: Thurs, Nov 29 2012 11:45 am
Subject: Re: [mezzanine-users] Re: New Mezzanine Markdown editor with media library integration

On Thu, Nov 29, 2012 at 11:20 AM, Eduardo Rivas <jerivasmel...@gmail.com>wrote:

> The template tag I'm using is {{ blog_post.content|richtext_filter|safe }}

> I removed the "safe" filter, and of course, that escaped pagedown's
> output, but in this case I can see the spaces are preserved.
> So, is the safe filter conflicting with pagedown?

I'm using a similar tag with no such issues, so it's not "safe" that's
causing the problem:
{{ page.get_content_model.content|richtext_filter|safe }}

> What version of Python, Django and Mezzanine are you testing with? I have
> 2.7, 1.4.2 and latest master from github respectively.

Python: 2.7.3rc2
Django: 1.4.2
*Markdown: 2.2.1*
Mezzanine, Grappelli-safe, Filebrowser-safe: I'm using slightly modified
versions with fewer jquery/jquery-ui versions fighting about. They are in
the pull-request queue, although I'm not sure if they will be accepted. I
don't think this is relevant to your problem, not in an obvious way anyway,
but feel free to try them at:
https://bitbucket.org/akhayyat/mezzanine
https://bitbucket.org/akhayyat/grappelli-safe
https://bitbucket.org/akhayyat/filebrowser-safe

Try running:

markdown(content, ['codehilite',])

manually on your input markdown string (which is all
mezzanine_pagedown.filters.codehilite does) outside of django and in
django's shell and see where exactly in the chain does the problem manifest.

On Thu, Nov 29, 2012 at 11:20 AM, Eduardo Rivas <jerivasmel...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad Khayyat  
View profile  
 More options Nov 29 2012, 3:12 pm
From: Ahmad Khayyat <akhay...@gmail.com>
Date: Thu, 29 Nov 2012 12:12:55 -0800 (PST)
Local: Thurs, Nov 29 2012 3:12 pm
Subject: Re: [mezzanine-users] Re: New Mezzanine Markdown editor with media library integration

On Thursday, November 29, 2012 11:45:45 AM UTC-5, Ahmad Khayyat wrote:
> Mezzanine, Grappelli-safe, Filebrowser-safe: I'm using slightly modified
> versions with fewer jquery/jquery-ui versions fighting about. They are in
> the pull-request queue, although I'm not sure if they will be accepted. I
> don't think this is relevant to your problem, not in an obvious way anyway,
> but feel free to try them at:
> https://bitbucket.org/akhayyat/mezzanine
> https://bitbucket.org/akhayyat/grappelli-safe
> https://bitbucket.org/akhayyat/filebrowser-safe

All merged in now. So a simple update/pull/fetch/... will do.

Thanks steve for merging despite your discomfort!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eduardo Rivas  
View profile  
 More options Nov 30 2012, 6:24 pm
From: Eduardo Rivas <jerivasmel...@gmail.com>
Date: Fri, 30 Nov 2012 15:24:36 -0800 (PST)
Local: Fri, Nov 30 2012 6:24 pm
Subject: Re: New Mezzanine Markdown editor with media library integration

I'm very confused right now. I pulled in the latest changes, and the
results are the same (no surprise there). However, I have now created a new
Mezzanine project, installed mezzanine_pagedown and everything works ok.
Also, the ouput from the shell is the correct one in every case. There is
something sistematically removing whitespace between <span> tags in the
<pre> block when I use the safe filter.

The good news is that mezzanine_pagedown is working as expected. I now have
to figure out if there is some script or style messing with the page or
something. Any ideas? Can a CSS style or JS script do something like this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad Khayyat  
View profile  
 More options Nov 30 2012, 6:44 pm
From: Ahmad Khayyat <akhay...@gmail.com>
Date: Fri, 30 Nov 2012 18:44:55 -0500
Local: Fri, Nov 30 2012 6:44 pm
Subject: Re: [mezzanine-users] Re: New Mezzanine Markdown editor with media library integration

On Fri, Nov 30, 2012 at 6:24 PM, Eduardo Rivas <jerivasmel...@gmail.com>wrote:

> The good news is that mezzanine_pagedown is working as expected.

Great!

> I now have to figure out if there is some script or style messing with the
> page or something. Any ideas? Can a CSS style or JS script do something
> like this?

CSS would not modify the HTML code, only changes how it's
rendered/presented.
JS: definitely. A script can rewrite the entire page.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eduardo Rivas  
View profile  
 More options Nov 30 2012, 9:50 pm
From: Eduardo Rivas <jerivasmel...@gmail.com>
Date: Fri, 30 Nov 2012 18:50:43 -0800 (PST)
Local: Fri, Nov 30 2012 9:50 pm
Subject: Re: New Mezzanine Markdown editor with media library integration

I can't believe I didn't notice this one, but it was the {% spaceless %}
tag in my base.html template causing the issue. Got rid of it and
everything is ok now.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »