Login Register

The Markup Previews project idea

Hello,

I'm interested in "Markup Previews" from the ideas list.

Some time ago I used Markdown in one of my projects and thought that it would be great to be able to see how it looks like in real-time while the text is being edited without sending a request to server.

So I'll be glad to create a markup language parser and integrate it with dojo as a GSoC project.
The development will include:

  • architecture design (from what it will consist off and how it will be integrated with other dojo stuff)
  • implementation of a markup language parser (it may be Markdown or other if you wish)
  • integration with some dojo widgets and/or creation of new widgets that use the feature

Also it can be integrated with visual text editor, so when someone edits text visually the result will be produced not in xhtml but in chosen markup language. It would be a good feature I think.

A little about me:
I am 4th year computer science student from Ukraine. I am very interested in web-development, always willing to learn and have already a good experience in creating a valid and semantic xhtml/css markups for different sites and server-side scripting in php. For now I'm in love with Ruby and trying to forget about php and especially interested in client-side programming.

Andrew

Hi Andrew, Personally, I

Hi Andrew,

Personally, I like markdown. But there are lots of other lightweight markup languages about as well (see the Wikipedia link on the ideas page). Do you have any ideas about how you could setup the architecture so that languages are pluggable - making it easy for someone else to add Textile at a later point?

Obviously the main text editor we're interested in is the dojo one. Have you had a look at how it works? Any ideas on how could it be subclassed/changed to produce markup instead of HTML?

- Rob :)

Personally, I like

Personally, I like markdown. But there are lots of other lightweight markup languages about as well (see the Wikipedia link on the ideas page). Do you have any ideas about how you could setup the architecture so that languages are pluggable - making it easy for someone else to add Textile at a later point?

For example, we can create a base class (MarkupParser, for example) that will have an interface understandable to other dojo objects and will contain the common code for all parsers (the code that will interact with dojo objects and other). A parsing algorithm for a particular language will be implemented in a derivable classes.

So, when someone wants to add a new parser he must just inherit the MarkupParser and implement required method(s) (transform(), for example)

Obviously the main text editor we're interested in is the dojo one. Have you had a look at how it works? Any ideas on how could it be subclassed/changed to produce markup instead of HTML?

I never used dojo before, so I can't suggest the best solution right now, but today I looked a little at sources and as I see, the dijit._editor.RichText has a contentPostFilters property. So the markup producer can be implemented as a post filter, for example. It will take the edited text and translate it to chosen markup language. The name of markup language could be set maybe like this (if it is possible):

<div dojoType="dijit.Editor"
          plugins="['bold','italic','|','createLink']"
          markupProducer="markdown" ... >

</div>

It is one of the possible ways, that came quickly to my mind.