Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 17

CurtisOdenGuppethafiqasyraf93ericgillettewykthreedx00 +11 guests

can you embed code inside the actual posts?

UPDATE:
ok, now my question is:
can you simply add syntax highlighting?
when you change themes, will the way code tags are displayed change?

i am planning to create a developer community and the posts will be centered around codes embedded in them, so it is vital that they are displayed correctly.
thanks

original post:
this is some random code for testing, let's see how it works =)

g.flashNotReady = function () {
if (!g.ready) {
g.soundAvailable = e;
g.soundEnabled = e;
g.soundReady = a;
g.checkIfEverythingIsReady()
}
};
g.flashReady = function (b) {
g.flashSoundPlayer = b;
g.soundAvailable = a;
g.soundEnabled = a;
g.soundReady = a;
g.checkIfEverythingIsReady()
};
g.flashLoaded = function () {
if (g.flashIframeDoc) {
var b = g.flashIframeDoc.getElementById("pacman-sound-player");
if (b && b.playTrack) {
g.flashReady(b);
return
} else if ((b = g.flashIframeDoc.getElementById("pacman-sound-player-2")) && b.playTrack) {
g.flashReady(b);
return
}
}
g.flashNotReady()
};
g.destroy = function () {
if (google.pacman) {
g.stopAllAudio();
window.clearInterval(g.tickTimer);
window.clearInterval(g.dotTimer);
window.clearInterval(g.dotTimerMs);
google.dom.remove(g.styleElement);
google.dom.remove(g.flashIframe);
google.dom.remove(g.canvasEl);
google.pacman = undefined
}
};
g.exportFunctionCalls = function () {
google.pacman = {};
google.pacman.insertCoin = g.insertCoin;
google.pacman.flashLoaded = g.flashLoaded;
google.pacman.destroy = g.destroy
};
g.updateLoadingProgress = function (b) {
b = Math.round(b * 200);
document.getElementById("logo-b").style.width = b + "px"
};
Tagged:

Comments

  • Posts: 4
    --
  • lucluc
    Posts: 1,015
    Use the GeshiSyntaxHighlighter plugin .
    http://vanillaforums.org/addon/geshisyntaxhighlighter-plugin
    g.flashNotReady = function () {
    if (!g.ready) {
    g.soundAvailable = e;
    g.soundEnabled = e;
    g.soundReady = a;
    g.checkIfEverythingIsReady()
    }
    };
    g.flashReady = function (b) {
    g.flashSoundPlayer = b;
    g.soundAvailable = a;
    g.soundEnabled = a;
    g.soundReady = a;
    g.checkIfEverythingIsReady()
    };
    g.flashLoaded = function () {
    if (g.flashIframeDoc) {
    var b = g.flashIframeDoc.getElementById("pacman-sound-player");
    if (b && b.playTrack) {
    g.flashReady(b);
    return
    } else if ((b = g.flashIframeDoc.getElementById("pacman-sound-player-2")) && b.playTrack) {
    g.flashReady(b);
    return
    }
    }
    g.flashNotReady()
    };
    g.destroy = function () {
    if (google.pacman) {
    g.stopAllAudio();
    window.clearInterval(g.tickTimer);
    window.clearInterval(g.dotTimer);
    window.clearInterval(g.dotTimerMs);
    google.dom.remove(g.styleElement);
    google.dom.remove(g.flashIframe);
    google.dom.remove(g.canvasEl);
    google.pacman = undefined
    }
    };
    g.exportFunctionCalls = function () {
    google.pacman = {};
    google.pacman.insertCoin = g.insertCoin;
    google.pacman.flashLoaded = g.flashLoaded;
    google.pacman.destroy = g.destroy
    };
    g.updateLoadingProgress = function (b) {
    b = Math.round(b * 200);
    document.getElementById("logo-b").style.width = b + "px"
    };
  • Here is an alternative way to do this, using Pygments as the syntax highlighter via Dexy.

    http://blog.dexy.it/394

    Examples are here and here.
  • lucluc
    Posts: 1,015
    ananelson said:

    Here is an alternative way to do this, using Pygments as the syntax highlighter via Dexy.

    http://blog.dexy.it/394

    Examples are here and here.

    Hi Ana,

    That doesn't seem really user friendly :)
    You should create a plugin so it's easier to use.

    Otherwise, I had your blog already opened to remind me to read stuff there about Dexy (I discovered it via some python feeds I read).

  • Yes, it's not for everyone, but it is very powerful and flexible. At this point a plugin isn't practical, but will keep it in mind.
  • Posts: 10
    ananelson said:

    Yes, it's not for everyone, but it is very powerful and flexible. At this point a plugin isn't practical, but will keep it in mind.

Sign In or Register to comment.