This Blog is about 2 things. On one hand it's about Syntax-Highlighting, but actually it's more about creating safe No-Server-Code-Apps.
Part 1: Syntax Highlighting
I recent Blog-Post by Peter Donker called Strong Typing Your Settings on the DNN-Connect inspired me to this. Basically we often want to show a bit of code to help people get something to work, but then...
...the WYSIWYG f***s it up :(.
If you read my post #3 on Responsive/Mobile about The Good Death of WYSIWYG, you'll know that I've had my bad times with the not-so-great WYSIWYG and that I'm glad it will become a relict soon - thanks to responsive websites which cannot "responsively" handle WYSIWYG content.
So Peter had all these nice code-snippets in his blog, and they looked really nice - thanks to a open-source JS called SyntaxHighlighter. It looked like this:

So I figured: there should be an App for that!
A day later I revisited the blog, and everything had fallen apart. It looked like this:

So I figured: there should REALLY be an App for that! My guess was that someone re-edited the blog in the WYSIWYG, and BAM! the code was mangled. Had happened to me a lot already :(.
So I created a App for that. You can find it here SyntaxHighligter App and a quick demo here. Enjoy!
Part 2: Safe No-Server-Code-Apps
I've made it my mission to promote creating no-server-code-solutions. Wouldn't it be nice if...
- ...an installed Apps (modules) couldn't contain server-code like C#
- ...and thereby could not crash the server, no matter what
- ...and could not contain DB-access code to "private" information?
- ...and the Apps would not be centralized, but an own install per portal
Because if this were possible, it would allow us to...
- ...give admins / web-designers the right to install Apps (not possible right now, too much risk)
- ...give admins / web-designers the right to modify Apps as they need to (without host-permissions)
- ...modified Apps would not effect other sites!
Enabling this is part of my mission. It's something that DNN cannot do by itself (for various architecture/feature reasons) but 2sxc can do it! We're not 100% there yet, but getting closer. And the Syntax-Highlighter App demonstates this - because it can do everything needed without any App-specific server-code. These are some features, that usually require code on the server:
- Modification of strings (done in JS)
- Selectable Color-Schemes (done with well-selected value-names in the dropdown so you don't need code)
- Selectable programming language causing different systems to run (done with good dropdowns & logic in JS)
- Prevent multiple copies of CSS & JS (done using DNN-Resources-Bundling and some JS)
- SEO enabled (done using standard HTML)
- Editing data-UIs with Multi-Language UIs (done with 2sxc)
- Multi-Language output (done with 2sxc)
- Data storage, retrieval & versioning (done with 2sxc)
We'll release a few more such Apps in the coming weeks, and I would love your feedback. Do you also see the need? Do you think we're wasting our time optimizing for this? Please tell me :)
Yours from Switzerland
Daniel