Syntax Highlighter

By tsangk tsangk

Description

Uses the Syntax Highlighter Library in alexgorbatchev.com.

The type attribute can be any of the below:

  • C++: cpp
  • C#: csharp
  • CSS: css
  • Java: java
  • Javascript: jscript
  • PHP: php
  • Pythod: python
  • Ruby: ruby
  • SQL: sql
  • VisualBasic: vb
  • XML: xml
  • Perl: perl

Code

[[include :snippets:syntax type=cpp]]
int main()
{
printf("some code here like this.");
}
[[include :snippets:syntax-end]]

renders this:

[フレーム]


Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by tsangk

URL Title with Slash Redirect - 04 Jan 2018 11:32
404 (Page does not exist) Redirect - 20 Nov 2012 11:40
Custom HTML Blocks - 25 Oct 2012 11:30
Conditional Blocks - 15 Feb 2012 00:36


Rate this solution

If you think this solution is useful — rate it up!

rating: +11
page 1 of 21
Fontsize?
herenz herenz 18 Mar 2016 19:46

The default font-size is a bit to big for my taste… Is it possible to change it?

by herenz herenz , 18 Mar 2016 19:46
Brush for shell / bash is not available yet?
erezcohenbox erezcohenbox 30 Jun 2011 22:42

The system can't find brush for both shell and bash - will it be added?

by erezcohenbox erezcohenbox , 30 Jun 2011 22:42
leiger leiger 23 Nov 2010 23:29

Please add a bash brush

According to this list of brushes, the bash shell brush is already available. Is this what you wanted elbahek? —> Example of it being used.

If that's the case, then it just needs to be added to this snippet. If tsangk hasn't done it later on, I'll add it myself. I should be head-first into exam revision at the moment, so I'll avoid doing it just yet.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 23 Nov 2010 23:29
elbahek elbahek 23 Nov 2010 22:40

Please add a bash brush

by elbahek elbahek , 23 Nov 2010 22:40
leiger leiger 14 Oct 2010 23:43

I need code blocks with C# highlighting and the regular Wikidot ones don't support this… so thanks! ;-)

Edit: Actually, I had to use < just to get a less-than symbol to show up on the page, otherwise it broke it. Am going to use the C++ highlighting in the default wikidot code blocks for now.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

Last edited on 14 Oct 2010 23:59 by leiger
by leiger leiger , 14 Oct 2010 23:43
Any way to update this?
mobilediesel mobilediesel 14 Sep 2010 00:23

Is there any way to update this to version 3.0.83? The new version handles several more brushes. http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/

by mobilediesel mobilediesel , 14 Sep 2010 00:23
Support for Groovy?
tamilyn tamilyn 05 Aug 2010 16:32

Groovy is supported, according to the SyntaxHighlighter site
http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
but when I use that on site, it displays a popup saying: Syntax Highlighter
Can't find brush for: Groovy

by tamilyn tamilyn , 05 Aug 2010 16:32
tsangk tsangk 28 Apr 2010 07:22

James, I started this last night on the Syntax Highlighter for Wikidot but I have assignments to do…. xD
Here is what I got done:
http://my-sandbox.wikidot.com/start


Kenneth Tsang (@jxeeno)

by tsangk tsangk , 28 Apr 2010 07:22
tsangk tsangk 27 Apr 2010 08:50

Okay :-)
This highlighter looks a lot better than the Wikidot's one. I'm going to see if its possible to make a highlighter for Wikidot's syntax xD


Kenneth Tsang (@jxeeno)

by tsangk tsangk , 27 Apr 2010 08:50
Highlight Wikidot's Syntax
GoVegan GoVegan 27 Apr 2010 13:39

Yes Please!!!

I remember making a design for this: Community Wish #71

by GoVegan GoVegan , 27 Apr 2010 13:39
Re: Highlight Wikidot's Syntax
leiger leiger 27 Apr 2010 14:38

That would be great. I'm looking forward to seeing Wikidot's design for the new editor… so perhaps it could be suggested then, once the basics have been drawn up @ the projects site.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 27 Apr 2010 14:38
tsangk tsangk 27 Apr 2010 07:47

yes.
[[include :snippets:syntax-start type=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.
}
}
[[include :snippets:syntax-end]]


Kenneth Tsang (@jxeeno)

by tsangk tsangk , 27 Apr 2010 07:47
leiger leiger 27 Apr 2010 08:48

Awesome. Wasn't sure if it was just C++


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 27 Apr 2010 08:48
(account deleted) 18 Jan 2017 17:11

Does't work. Show error, that Java brush not found and on the page I see ");" chars.

Last edited on 18 Jan 2017 17:12 by (account deleted)
by (account deleted), 18 Jan 2017 17:11
page 1 of 21
page revision: 3, last edited: 16 Feb 2012 01:45
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).

AltStyle によって変換されたページ (->オリジナル) /