Setup finished, and yet so much work to do

by Yazide 28. March 2009 09:44

The blog installation is finished but I’m not yet satisfied with the result. I’m using the latest version of BlogEngine.net which I first installed from the web archive. A problem quickly popped-up when I tried to use the raw HTML editor and I must say that I’m a little bit disappointed here. The web archive was released on August last year, the bug was raised one week later, fixed another week later and nearly 8 months after that… nothing. No new release, you still have to fix the code yourself or download and compile the latest version from the repository. Ok, I’m overreacting, this is a very low impact bug and the fix is very easy to apply. Fortunately, among the 101 issues fixed since last release, there is no high impact bug (actually, all fixed issues had a low impact) but I still think that 101 fixes may justify an up-to-date web archive. For me and for many other developers using BlogEngine.Net, there is no major problem as it takes around 15 minutes to download, compile and deploy the latest version but if the Blogengine.net team targets a larger audience than the .Net community, I think that an extra effort is needed.

Anyway, no more bug right know, this blog engine is really great and I’ll definitely stick with it. I have, however, a few changes I’d like to do (and not to complain about;) regarding post edition/rendering. BlogEngine.net is shipped with tinyMCE, a platform independent web based Javascript HTML WYSIWYG editor control. This editor is nice, but I’d like to switch to a WYSIWYM editor instead, like wmd editor by Attacklab used on stackoverflow.com. Actually, I already did it on my dev machine, using the TextFormatter extension to output HTML when rendering posts. It’s a good start, but there are still some problems blocking the live roll-out:

  • wmd editor code is “obfuscated” (next release will be open source) and I want to be able to find and fix issues if I find any
  • I can’t write closing curly braces (at least on my French keyboard), it seems to be a shortcut to format a code block (!)
  • there is no code syntax highlight (I have the CodeFormatter extension shipped with BlogEngine.net, but it’s no compatible with markdown syntax)

Fortunately, Attacklab also releases Showdown, a JavaScript port of Markdown, which is not obfuscated (great!). Showdown can be used to do a live preview of text edited with markItUp!. This will hopefully solve the two first issues. For the third one, code syntax highlight, It’s a little bit more complex… There is no way (or not yet) in markdown syntax for code block formatting to specify a language, allowing a syntax highlighter to format the code efficiently. This means that even if I modify the CodeFormatter extension or SyntaxHighlighter extension to format the content of <code></code> tags after the markdown input conversion to HTML, I have no standard way to let it know which language formatting should be used. After a few minutes of googling, I found a very nice solution posted by Ryan Tomayko that involves lazy loading of google code prettify. We’ve got a nice solution, without writing too many lines of code:

  • use markItDown instead of tinyMCE
  • use Showdown to provide live preview of Markdown input
  • use TextFormatter to convert Markdown input to HTML when serving a page
  • use lazy loaded google code prettify to format code blocks

This should fit my needs and I’ll try to post the exacts steps I went through to achieve this solution, but my feeling right now is that it should be more integrated in BlogEngine.Net core. Well, I’ll see what I can do about that…

Tags: , , ,

BlogEngine.NET

Comments

Powered by BlogEngine.NET 1.4.5.15
Theme by Mads Kristensen

Who am I ?

My name is Yazide Boujlil, I'm a freelance .Net Consultant working in the area of Brussels, Belgium. I'm interested in Domain Driven Design, Design Patterns, Software Architecture, C#, Web development and everything related to the .Net Framework and Laziness Driven Design.

Month List