EzDevInfo.com

syntaxhighlighter

SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript. SyntaxHighlighter

how to setup syntax highlighter on blogger [closed]

how to setup syntax highlighter on blogger new interface.I did try with many options but till didn't work.please give any suggestions .


Source: (StackOverflow)

Automatic line break in js SyntaxHighlighter

Im using the js SyntaxHighlighter 3.0.83 from http://alexgorbatchev.com/SyntaxHighlighter/

I've been googling the entire world now it seem but cant really find how to enable line breaks. Instad i get a horizontal scrollbar, which is good sometimes but not in my scenario.

In example Horizontal scrollbar

Anyone out there who know the way around this?


Source: (StackOverflow)

Advertisements

Aptana Studio 3: How to get Syntax Highlighting of Shell Scripts *.sh

Is there any "Formatter" / syntanx highlighting for linux shell script available for Aptana Studio 3 ?!?

I did find "shelled" but this seems only to work with eclipse and not aptana studio 3 standalone (and i could not get it to work in eclipse either)

Just simple plain syntax highlighting for *.sh files anyone?!?


Source: (StackOverflow)

How can I show code (specifically C++) in an HTML page?

How can I show code in a website using HTML? Basically, I have a C++ program that I'd like to share on my website and I want to show it in the page.

Is there anyway to show a C++ code in HTML other than using HTML text?


Source: (StackOverflow)

Eclipse syntax highlighting on extensionless files?

I have a perl CGI script that needs to have a specific extensionless filename to run correctly from the software that uses it. I'm using Eclipse 3.7.0 on Ubuntu 11.04 Linux as my IDE, and it's not highlighting syntax on the file nor using the limited autocomplete features (like adding a second closing tag for things like quotes and various brackets). Right click> properties on the file reveals that the OS seems to know it's a perl script, but Eclipse evidently does not. Can I somehow tell Eclipse to use the perl syntax highlighter for all extensionless files? Or, failing that, for this specific file?


Source: (StackOverflow)

Disable double click selection for SyntaxHighlighter

SyntaxHighlighter has a feature that allows code selection by double clicking. How can I disable this feature?


Source: (StackOverflow)

How to change font size in Alex's Gorbatchev SyntaxHighlighter? [closed]

I've tried to change the font sizes in Alex Gorbatchev's SyntaxHighlighter .css theme files, and used font-size in the <pre> tag, etc, but nothing happens. The size won't change.

PD: this is the shCore.css main file.


Source: (StackOverflow)

Extra Lines using SyntaxHighlighter for Chrome Only?

Extra lines are being inserted when I am using Chrome to look at a draft blog post (on blogger) that uses syntax highlighter e.g.

Chrome extra lines inserted

But on IE it looks fine:

IE looks fine

Any ideas what I am doing wrong here?

edit:

The config/setup for SyntaxHighlighter I am using is below:

<!-- Syntax Highlighter Additions START -->
<link rel='nofollow' href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link rel='nofollow' href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushcsharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>

<script language='javascript' type='text/javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>
<!-- Syntax Highlighter Additions END -->

edit:

And the HTML generated is:

<pre class="brush: csharp;">using System;
<br />using System.Text;
<br />using System.Collections.Generic;
<br />using System.Linq;
<br />using Microsoft.VisualStudio.TestTools.UnitTesting;
<br />using AccountTypeFollowUp;
<br />
<br />namespace PluginsUnitTests
<br />{
<br />    [TestClass]
<br />    public class AccountTypeFollowUpTests
<br />    {
<br />        [TestMethod]
<br />        public void AccountTypeFollowUp_Account_Is_Supplier()
<br />        {
<br />            throw new NotImplementedException();
<br />        }
<br />
<br />        [TestMethod]
<br />        public void AccountTypeFollowUp_Account_Is_Client()
<br />        {
<br />            throw new NotImplementedException();
<br />        }
<br />
<br />        [TestMethod]
<br />        public void AccountTypeFollowUp_Account_Is_Other)
<br />        {
<br />            throw new NotImplementedException();
<br />        }
<br />    }
<br />}
<br /></pre>

Source: (StackOverflow)

Blogger SyntaxHighlighter doesn't work at all

I've been trying to install SyntaxHighlighter 3.0.83 on Blogger for couple hours. I've tried many tutorials but it still doesn't work. I mean it looks just as normal text inserted nto pre tag.

I created a new blog and pasted:

<link rel='nofollow' href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css'     rel='stylesheet' type='text/css'/>
<link rel='nofollow' href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js'     type='text/javascript'></script>
<script language="javascript" type="text/javascript">
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>

...just before closing head tag. The code pasted above had been generated here: generator

The strange thing is that it works in my own html document. As an example:

<html>
<head>
<link rel='nofollow' href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link rel='nofollow' href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script>
<script language="javascript" type="text/javascript">
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.all();
</script>
</head>
<body>
<pre class='brush:java;'>import gt.memorize;
public class Test
{
    private static final String test = "test";
}</pre>
</body>

</html>

But the same pre tag doesn't work on blogger.

I have also tried pasting

<script language="javascript" type="text/javascript">
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.all();
</script>

at the end of body and pasting styles at the end of b:skin tag. Neither works. And I don't paste the code into Compose part :) I'm very confused so any help will be extremely appreciated.


Source: (StackOverflow)

SyntaxHighlighter not showing toolbar

I am using the latest SyntaxHighlighter within my app and for some reason the toolbars do not show in IE, Firefox or Chrome. The code highlights without issue, but I want to have toolbars. What makes things worse is that the toolbar demo on the official website is not working either.

Am I missing something obvious? Below are the code nuggets.

<script src="Scripts/syntaxhighlighter/scripts/shBrushCSharp.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" rel='nofollow' href="Scripts/syntaxhighlighter/styles/shCoreDefault.css" />
<script type="text/javascript">
    // Highlight code
    SyntaxHighlighter.all();
</script>

<pre class="brush: csharp; ruler: true; title: 'Test'; toolbar: true;">
public static bool HelloWorld()
{
    // Return
    return false;
}
</pre>

Source: (StackOverflow)

What is the fastest way to create a cross-platform IDE for a new programming language?

The title already says most of what I'm after, but let me state some of the requirements explicitly:

  • The language is not widely used, so writing a new language tokenizer etc is assumed to probably be required.
  • Cross-platform, means at least Linux, Mac OS and Windows
  • Minimal features: Syntax highlighting and Code-completion (aka "IntelliSense")
  • Preferrable features: Interactive debugging
  • Assumption: The developer is not an expert in any one programming language (although mediocre in a few, and eager to learn new techniques), so the focus on an environment / tools that quickly gets a developer up to speed, and is productive enough to reach the goal as fast as possible.

Source: (StackOverflow)

How to disable built-in code box when using Syntaxhighlighter3?

enter image description here

I'm using Dokuwiki and want to get rid built-in code box (boxes with grey outline) when using Syntaxhighlighter3.

Appreciate if anyone know how to do this.


Source: (StackOverflow)

Editable Java Syntax Highlighter for j2ee Application

I need a java SyntaxHighlighter for my jsp based web application.The field or TextArea should remain editable as I will need to save the file again as per the user changes of code.

I found this https://code.google.com/p/syntaxhighlighter/wiki/Overview though its highlighting the code but the area is no more editable.


Source: (StackOverflow)

Remove extra blank lines from SyntaxHighlighter

I'm using SyntaxHighlighter in my blogger blog. But since few days it adds extra blank lines in my code. It only happens to new posts only. Can anyone please tell me how to remove these extra blank lines. I saw similar question. But it does not clearly answered. Thanks in advance.


Source: (StackOverflow)

SyntaxHighlighter.all() doesn't work on DOM level? [duplicate]

Possible Duplicate:
jquery load issue

I'm loading content dynamically into a div using the jQuery load() function. In the callback I'm calling SyntaxHighlighter.all(), to pretty print the syntax of the pre block that just got loaded into the div.

The problem is that the content is loaded OK, but the syntax doesn't get highlighted. However, when I hardcode the pre block in the div, so not loading in into the DOM via the jQUery load() function, the syntax get's highlighted as it should.

So I'm guessing that the SyntaxHighlighter.all() only works on pre blocks that are in the html source, that can be viewed using view page source, and not on the actual content in the DOM?

Any idea how I can make it work?

The javascript to do the loading and highlighting:

<script type="text/javascript">
        $.ajaxSetup ({
            cache: false
        });

        $(document).ready(function() {
            var tree = $("#tree li");
            var contentContainer = $("#contentContainer");
            var content = $("#content");

            SyntaxHighlighter.config.clipboardSwf = 'syntaxhighlighter_2.0.320/scripts/clipboard.swf';
            SyntaxHighlighter.all();

            // Treeview
            $("#tree").treeview({
                persist: "location",
                collapsed: true
            });

            tree.click(function() {
                if ($(this).hasClass("file")) {
                    tree.removeClass("selected");
                    $(this).addClass("selected");
                    content.load("content/"+this.id+".html", function() {
                        contentContainer.effect("highlight");
                        SyntaxHighlighter.all();
                    });
                }
            });
        });
    </script>

the content div:

<div id="content">
                <pre class="brush: java;">
/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}
                </pre>
            </div>

the external file that gets loaded with jQuery.load():

Hello World

<pre class="brush: java;">
/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}
</pre>

Kind regards


Source: (StackOverflow)