# Two new extensions - WYSIWYG editor and Maruku filter

**URL:** <https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647>\
**Category:** Radiant CMS\
**Created:** [February 24, 2007, 1:56am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647 "2007-02-24T01:56:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 24, 2007, 1:56am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/1 "2007-02-24T01:56:24Z")

</div>

I was a little late to the game when it came to checking out the Mental  
branch, but _wow_ I really like what I see. The extensions are very  
slick,  
and I can already see myself spending long hours making new ones.

In fact, I’ve got a few to offer right now.

The first is a simple text filter based on Maruku \<URL:  
[http://maruku.rubyforge.org/](http://maruku.rubyforge.org/) \>. Maruku is very much like Markdown, but  
it  
has extended HTML support and a number of other goodies. You can  
download  
it here:  
\<URL: [http://tinyurl.com/yr96bz](http://tinyurl.com/yr96bz) \>

The second is the one that I know a lot of people have been waiting for  
(Florian, I’m looking at you 😉 ). This is a WYSIWYG extension based on  
TinyMCE. It’s still a work in progress (I want to integrate an asset  
handler) but the basic functionality is all there.  
\<URL: [http://tinyurl.com/2xfegp](http://tinyurl.com/2xfegp) \>

Try 'em out and tell me what you think … I’ll be around on and off  
over  
the weekend to answer questions or help with problems, so don’t be  
scared  
to ask. It may take a minute to get back to you, but I’ll do my best.

–  
Nathan W.

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 24, 2007, 3:55am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/2 "2007-02-24T03:55:04Z")

</div>

Sounds good. I’m looking forward to playing with this. I can see it  
being very useful (though I share John’s distaste for using WYSIWYG  
editors) for my customers.

Are you willing to provide any details on the asset management piece you  
are working on? I’ve read about what the others are doing on and none  
of the approaches seems quite “right” for my needs.

Actually, anyone working on an asset management system is welcome to  
contact me directly. If there is some way to make things work, it is  
possible that I could generate some funding to help develop it.

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 24, 2007, 6:22am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/3 "2007-02-24T06:22:42Z")

</div>

On Fri, 23 Feb 2007 19:55:04 -0700, Chris P.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sounds good. I’m looking forward to playing with this. I can see it  
> being very useful (though I share John’s distaste for using WYSIWYG  
> editors) for my customers.

Ditto. How have you persuaded them to use something else? Mind altering  
drugs, perhaps? 😉 Mine have always been convinced that they need to use  
dreamweaver to manange their hundreds of pages … I figured that  
Radiant  
with a WYSIWYG was the lesser of two evils.

> Are you willing to provide any details on the asset management piece you  
> are working on? I’ve read about what the others are doing on and none  
> of the approaches seems quite “right” for my needs.

I think that John believes that assets should belong to a page rather  
than  
being more universal in nature, but I honestly think that this may  
complicate things too much for the average user.

In my system all assets are available to all pages. You add those assets  
(be they images, pdfs, whatever) to your bucket (yes, I’m shamelessly  
ripping off Mephisto’s buckets), and then you simply click on them to  
insert them into your page.

The insert behavior is “smart”. If you are inserting an image, it will  
insert an image tag into the page. This tag differs depending on the  
filter applied to the page … if you have no filter applied, or if you  
have my WYSIWYG applied, a basic \<img …\> will be inserted into the  
page;  
if you use markdown you’ll get a ![alt text](https://www.ruby-forum.com/path/to/img.jpg "Title")  
…  
you get the idea.

If you try to insert a PDF, mp3, etc. into the page (or something else  
that can’t be directly viewed by the browser) the insert behavior will  
stuck a link into the page instead. Like above, the precise form of this  
link will depend on the filter that is applied to the page.

In short, I think that inserting an asset into a page should be a simple  
procedure … the user shouldn’t have to think about the markup required  
to insert it.

Since most assets are likely to be images, I want to make it easy for  
the  
user to resize those images to suit their needs. The URL of the image  
determines the size of the image, and the image can only be resized from  
the admin side of things. I’m still working out the details of how all  
of  
this will work, but I’ve got a basic system in place that seems to work  
well. It still hits the database to determine if an asset matching the  
size parameters exists … I need to work that out yet to minimize the  
database load.

Is this at all like what you’re looking for? What are your ideas on the  
matter?

–  
Nathan W.

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 24, 2007, 11:13am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/4 "2007-02-24T11:13:04Z")

</div>

I wrote one of the first extensions for this, but kind of dropped it  
as I was in Central America for a month and have yet to pick it up  
again.

For me at least, centralized assets are much better. I don’t want to  
have to hunt through each page to find a photo. The bucket idea seems  
like the easiest way to insert an image. Steal from the best and all.

This is basically how I envisioned it… do you have anything ready to  
show?

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 24, 2007, 7:05pm UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/5 "2007-02-24T19:05:00Z")

</div>

On Feb 24, 2007, at 9:19 AM, Chris P. wrote:

> Sounds like you’re heading in the right direction (IMHO, anyway).  
> Feel  
> free to contact me directly. Others are welcome too – I’d like to  
> consider all possibilities. I think that this is a much needed aspect  
> to radiant (though maybe not something you’d ever put in the core).

I’m hearing the arguments for both ways of managing assets (per page  
and global) and I really think both are valid. The use cases are  
there for having an asset local to the page, but lots of use cases  
for needing to easily reuse the assets too. Maybe we should be  
thinking about a global bucket but have the page UI able to add  
images restricted to only that page?

dm

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 25, 2007, 12:55am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/6 "2007-02-25T00:55:45Z")

</div>

Nothing ready for public consumption just yet … though I am hoping to  
have it ready soon (next week or so, if my free time holds up).

On Sat, 24 Feb 2007 03:12:05 -0700, Keith B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > Ditto. How have you persuaded them to use something else? Mind
> > 
> > > none  
> > > ripping off Mephisto’s buckets), and then you simply click on them to  
> > > you get the idea.  
> > > required  
> > > work
> > 
> > * * *
> > 
> > Radiant mailing list  
> > Post: removed\_email\_address@domain.invalid  
> > Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> > Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)
> 
> * * *
> 
> Radiant mailing list  
> Post: removed\_email\_address@domain.invalid  
> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site: [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

## –

Nathan W.

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 24, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/7 "2007-02-24T16:19:14Z")

</div>

Nathan W. wrote:

> I think that John believes that assets should belong to a page rather  
> than  
> being more universal in nature, but I honestly think that this may  
> complicate things too much for the average user.
> 
> In my system all assets are available to all pages. You add those assets  
> (be they images, pdfs, whatever) to your bucket (yes, I’m shamelessly  
> ripping off Mephisto’s buckets), and then you simply click on them to  
> insert them into your page.

I agree with John and other’s drive for simplicity in design and  
implementation. So there, the attach-an-image-to-a-page makes some  
sense – but only as long as users only ever use a given asset once.

The minute they want to reuse it, we’ve just made the user’s life  
harder. The concept that an image is “owned” by page A and not page B  
is arbitrary (I can see them thinking that it is somehow “unfair” to  
page B and would probably just store the image with each page – messing  
things up when they must update that image and kissing DRY goodbye.

It also forces the user to use their memory instead of having the system  
keep that knowledge: “I need picture X – I know I used it before. Let  
me see, where did I put that…” In my opinion, any good system should  
be able to tell you where (or if) assets are being used (in other words  
look at it from the asset perspective too).

> The insert behavior is “smart”. If you are inserting an image, it will  
> insert an image tag into the page.

> If you try to insert a PDF, mp3, etc. into the page (or something else  
> that can’t be directly viewed by the browser) the insert behavior will  
> stuck a link into the page instead. Like above, the precise form of this  
> link will depend on the filter that is applied to the page.
> 
> In short, I think that inserting an asset into a page should be a simple  
> procedure … the user shouldn’t have to think about the markup required  
> to insert it.

I like this approach too. In fact one of the concepts that I’ve been  
playing with is uniquely styling elements in certain pages – rather  
than sticking every possible fringe case into my main CSS file.  
Similarly, I may create a dynamic page or two (say with an interactive  
maps) that needs some unique javascript.

In these cases I build mini CSS or JS files that are, really just assets  
to me. These need that same “smart” behavior to include them in the  
page correctly. Of course, in this case, they are added to the head  
section (automatically). This is certainly beyond what most asset  
managers are attempting but the use cases are, really, identical with  
“insert an image”, “figure out where this image is used” or “remove  
image from page.”

> Is this at all like what you’re looking for? What are your ideas on the  
> matter?

Sounds like you’re heading in the right direction (IMHO, anyway). Feel  
free to contact me directly. Others are welcome too – I’d like to  
consider all possibilities. I think that this is a much needed aspect  
to radiant (though maybe not something you’d ever put in the core).

-Chris

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 26, 2007, 4:04pm UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/8 "2007-02-26T16:04:13Z")

</div>

Nathan W. wrote:

> While I agree that they are an “asset” in a sense, they are also an  
> asset  
> with a behavior, and that certainly complicates things quite a bit.  
> Depending on the technical skill (or lack thereof) of a user they could  
> even bring down your site (image a bad javascript file that writes in  
> pr0n  
> to your page or a css file that includes the declaration “body {  
> display:  
> none; }”). For most purposes, I’d think that this would be giving too  
> _much_ power to the average user.

I’m not sure that it’s a problem in “most cases” but certainly the  
developer ought to be able to say that “for this site, users won’t be  
able to add js but css is ok” – or whatever.

In another site, like one I’m building where the users are trustworthy  
and where it will also require approval before publishing, this is  
perfectly fine.

I see it like configuring your WYSISYG editor to allow H1 tags or not,  
or blockquotes – or anything that the developer, owner wants to offer  
or hide, really.

-Chris

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [March 1, 2007, 10:49pm UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/9 "2007-03-01T22:49:47Z")

</div>

On 2/26/07, Nathan W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m hoping that someone makes an asset manager that’s so well thought out  
> and executed that John looks at it and says “Damn, we’ve got to have  
> that!”

The have an interesting look asset management system at  
[http://www.silverstripe.com/home/](http://www.silverstripe.com/home/). Maybe radiant can borrow some ideas.

Nicholas

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [February 26, 2007, 8:43am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/10 "2007-02-26T08:43:57Z")

</div>

> It also forces the user to use their memory instead of having the system  
> keep that knowledge: “I need picture X – I know I used it before. Let  
> me see, where did I put that…” In my opinion, any good system should  
> be able to tell you where (or if) assets are being used (in other words  
> look at it from the asset perspective too).

I agree.

> In these cases I build mini CSS or JS files that are, really just assets  
> to me. These need that same “smart” behavior to include them in the  
> page correctly. Of course, in this case, they are added to the head  
> section (automatically). This is certainly beyond what most asset  
> managers are attempting but the use cases are, really, identical with  
> “insert an image”, “figure out where this image is used” or “remove  
> image from page.”

While I agree that they are an “asset” in a sense, they are also an  
asset  
with a behavior, and that certainly complicates things quite a bit.  
Depending on the technical skill (or lack thereof) of a user they could  
even bring down your site (image a bad javascript file that writes in  
pr0n  
to your page or a css file that includes the declaration “body {  
display:  
none; }”). For most purposes, I’d think that this would be giving too  
_much_ power to the average user.

> Sounds like you’re heading in the right direction (IMHO, anyway).

Thanks, I’ll certainly keep the list posted. That, and your comments  
have  
given me some great new ideas/directions to take this thing.

> I think that this is a much needed aspect  
> to radiant (though maybe not something you’d ever put in the core).

I’m hoping that someone makes an asset manager that’s so well thought  
out  
and executed that John looks at it and says “Damn, we’ve got to have  
that!”

–  
Nathan W.

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [March 2, 2007, 3:17am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/11 "2007-03-02T03:17:23Z")

</div>

Just had a little bit of a poke around in their demo site. What ideas  
are you thinking we should borrow?

On 2/26/07, Nathan W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

I’m hoping that someone makes an asset manager that’s so well thought  
out  
and executed that John looks at it and says “Damn, we’ve got to have  
that!”

The have an interesting look asset management system at  
[http://www.silverstripe.com/home/](http://www.silverstripe.com/home/). Maybe radiant can borrow some ideas.

Nicholas

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [March 2, 2007, 7:28am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/12 "2007-03-02T07:28:53Z")

</div>

I just finished building a site that used a lot of PDF files scattered  
across pages. At over 50 pages, in some cases a single PDF fit well on  
more than one page.

Now that I’m done, it looks like I am going to build another page  
listing all the PDF documents - an asset tree, if you will. This way,  
if the user remembers seeing a particular asset somewhere and wants to  
see it again, they can find it more directly.

I’ve already organized my PDFs in an organized folder structure inside  
/public. I did this naturally – in keeping with Dan’s comment that all  
the assets in one “folder” would be a big mess.

It seems to me that if I organized all my PDFs in some sort of asset  
manager centralized location, that I could now automatically create the  
asset tree summary page I need - complete with organization. Just like  
you’d create a menu using radiant tags based on pages.

-Chris

---

<div class="post-metadata">

**Author:** ![laserwhit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@laserwhit](https://www.ruby-forum.com/u/laserwhit)\
**Post date:** [March 2, 2007, 5:15am UTC](https://www.ruby-forum.com/t/two-new-extensions-wysiwyg-editor-and-maruku-filter/86647/13 "2007-03-02T05:15:31Z")

</div>

On 3/2/07, Daniel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Just had a little bit of a poke around in their demo site. What ideas are  
> you thinking we should borrow?

I liked the method used for maintaining an image in page. Option to  
select  
another from the asset location or via an upload. Which I assume can be  
upload to a specified location in the asset tree.

Their draft/staging mechanism is interesting as well. I haven’t used  
radiant  
for a long while so I’m not sure where it is with that. I’m planning to  
set  
it up again for a small site, so I might have better comments after  
that.

I think that assets like images, pdfs, etc should be centrally managed  
as  
the can often be access by multiple pages. Allocation them to their own  
tree  
also allows more opportunity for static caching.

Nicholas
