Skip to main content
Home  ›  Blog

Syntax Highlighter - There's a No-Code App for that!

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...

  1. installed Apps (modules) couldn't contain server-code like C#
  2. ...and thereby could not crash the server, no matter what
  3. ...and could not contain DB-access code to "private" information?
  4. ...and the Apps would not be centralized, but an own install per portal

Because if this were possible, it would allow us to...

  1. ...give admins / web-designers the right to install Apps (not possible right now, too much risk)
  2. ...give admins / web-designers the right to modify Apps as they need to (without host-permissions)
  3. ...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:

  1. Modification of strings (done in JS)
  2. Selectable Color-Schemes (done with well-selected value-names in the dropdown so you don't need code)
  3. Selectable programming language causing different systems to run (done with good dropdowns & logic in JS)
  4. Prevent multiple copies of CSS & JS (done using DNN-Resources-Bundling and some JS)
  5. SEO enabled (done using standard HTML)
  6. Editing data-UIs with Multi-Language UIs (done with 2sxc)
  7. Multi-Language output (done with 2sxc)
  8. 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 Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in Switzerland and Liechtenstein, an 20-head web specialist with over 800 DNN projects since 1999. He is also chief architect of 2sxc (see github), an open source module for creating attractive content and DNN Apps.

Read more posts by Daniel Mettler