|
Jun25Written by:Tom Wellige Samstag, 25. Juni 2011 10:50  I have to admit it: sometimes I really hate DotNetNuke, the content management system behind Swyx Forum. Why? For a couple of days now I am trying to get a tiny nice feature installed: Syntaxhighlighting for any kind of source code. There is an excellent tool available from Alex Gorbatchev to format any kind of source code on the fly. His tool (Java class) seaches the current website for <pre> tags with some special parameters (like the programing language) and renders all text within the <pre> tag accordingly. Pretty nice feature! I have installed it and added a new button to the text editor within DotNetNuke 
to make it extra easy to paste your source code into any blog post, forum post, wiki article, a.s.o. Everything works fine, except DotNetNuke  The pasted source code is properly stored within DotNetNuke’s database, including indents (spaces or tabs, what ever you used). But when DotNetNuke reads the information back from the database and renders it for output, there is obviously some damn function included that REMOVES the indents. How stupid is that??? Bottom line: if you have source code without any indents you can use the above shown button, everything will work fine. If you have source codes with indents (which should be not an exception but the standard) you need to use some external tool to get your source code properly formatted in HTML and paste the HTML code into your blog, forum or wiki article. Sorry for this trouble. I am going to use the weekend to calm down again and try to find some nice other code formatters and make them available to you. If you have some nice code formatter please feel free to use the comment feature of the blog to share it. And of course, I don’t hate DotNetNuke over all, it’s a brilliant and very complete CMS system  But sometimes there are simply such stupid bugs in it that I could just scream  Tags: 3 comment(s) so far...
Re: I don’t like DotNetNuke! I'm currently using Windows Live Writer and this Plugin. If you happen to have formatted and properly syntax colored code in your clipboard this plugin creates nicely formatted output, optionally with title, line number, alternating line colors. It even can add CSS classes, to adapt the output. Currently I'm adding the necessary css manually inside a style element to every post. See my last PowerShell related for some examples how it looks. By Martin Hüser on
Samstag, 25. Juni 2011 21:21
|
Re: I don’t like DotNetNuke! BTW, I tried several different approaches yesterday and it looks like DotNetNuke manipulates the HTML code before returning it to the client. It removed font-family settings from embedded style attributed, for example :-(P.S. There's a Windows Live Writer plugin for Alex Gorbatev's syntax highlighter. So if you get DotNetNuke to behave properly, the syntax highlighting would work with WLW, too. By Martin Hüser on
Samstag, 25. Juni 2011 21:22
|
Re: I don’t like DotNetNuke! Hi Martin. Yes, I know that Plugin for Alex Gorbatev's syntax highlighter, but at the moment it doesn't make any sense to propagate it here. I also use a plugin in Live Writer to get nice html code for the forum or wiki, but actually I wanted to get it a little bit more comfortable. By Tom Wellige on
Sonntag, 26. Juni 2011 08:20
|
|
|