SyntaxHighlighter

  • 1
  • Question
  • Updated 8 years ago
Hi every one.
I have been trying to get SyntaxHighlighter working on my site, for the displaying of Delphi script. I am using the following SyntaxHighlighter: Alex Gorbatchev

I have been trying to get it to work for hours now with no success, I have all the required .js and .css files hosted on my Yola.com. I have also tried using the hosted files rather than hosting my self but also no success.

[code]
-
Hello SyntaxHighlighter

Hello SyntaxHighlighter



unit SpyArrayU;
//Jesar|Arts
//Jeremy Paton
// Open Source - Free Ware
interface

uses Sysutils, SpyU, ZeroSpyU, DBU;

Type TSpyArray = Class
Private
SpyArr: Array[1..100] of spy; //Will require a Loop in most code. //Allways of the original
Size: Integer;
protected

Public
Constructor create; //Always in Public.
//Accessor Methods

//Mutator Methods

//Other Methods
Procedure Sort;
Function Search(Wh: String): String;
Function ZeroString: String;
Function ToString: string;
End;
---!>
[code]

Does anybody know why this code works in a basic HTML document but not in Yola?
And has anybody used a SyntaxHighligher with any success on Yola?

Thanks Jeremy

Photo of Jeremy Paton

Jeremy Paton

  • 159 Posts
  • 16 Reply Likes
  • frustrated

Posted 8 years ago

  • 1
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
A file has to be saved before it to work. For example, unsaved file will have no file extension, therefore, they don't know what syntaxing to use. Save it as mypage.html or something and the syntaxing "should" work. If not, go get notepad++ I find that's one of the better ones.
Photo of Jeremy Paton

Jeremy Paton

  • 159 Posts
  • 16 Reply Likes
Thanks Donald.
But I am a bit confused about which file needs to be saved?
Also what exactly do you mean by save it as "mypage.html"?
Photo of Jeremy Paton

Jeremy Paton

  • 159 Posts
  • 16 Reply Likes
sorry can't seem to edit my above post here is what the full code should appear as:

<!--
<title>Hello SyntaxHighlighter</title>
<script type="text/javascript" src="scripts/shCore.js"></script>
<script type="text/javascript" src="scripts/shBrushDelphi.js"></script>
<link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/>
<script type="text/javascript">SyntaxHighlighter.all();</script>

<h1>Hello SyntaxHighlighter</h1>
<pre class="brush: delphi;">
unit SpyArrayU;
//Project Development
//Jeremy Paton
// Open Source - Free Ware
interface

uses Sysutils, SpyU, ZeroSpyU, DBU;

Type TSpyArray = Class
Private
SpyArr: Array[1..100] of spy; //Will require a Loop in most code. //Allways of the original
Size: Integer;
protected

Public
Constructor create; //Always in Public.
//Accessor Methods

//Mutator Methods

//Other Methods
Procedure Sort;
Function Search(Wh: String): String;
Function ZeroString: String;
Function ToString: string;
End;
</pre>
-->

This code works in a basic index.html file, but as soon as a past the code to my site and copy the directories of the .js & .css files hosted on my site, it refuses to work ??
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
to use javascript in yola you need the paid yola account if I'm not mistaken, do you have a paid account? You can also host javascript on another host that supports it and then link to it from your yola account and that should work as well.
Photo of Jeremy Paton

Jeremy Paton

  • 159 Posts
  • 16 Reply Likes
Yup I have Yola Silver.
I am having slightly better success with the code.
Now just trying to integrate it into the page.

The .css file is however causing problems with spacing on the entire page.
Photo of Jeremy Paton

Jeremy Paton

  • 159 Posts
  • 16 Reply Likes
Ok no worries finally gotten it all working :D
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Fantastic to hear! Well done on figuring it all out :)
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
what's the code to your .css file?
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Jeremy

Would you mind posting your URL so that we can see what is going on here? I am not sure if this is something that we'll be able to assist with but I would like to at least have an opportunity to look. It sounds like Donald is giving you some good assistance as well.
Photo of Jeremy Paton

Jeremy Paton

  • 159 Posts
  • 16 Reply Likes
The link to my css is as follows: http://www.jesararts.net/resources/Sc...

My sites link: http://www.jesararts.net

Thanks all for the help, I have gotten SyntaxHighlighter to work. You can see an example here: http://www.jesararts.net/delphi_field...