Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
Tariq Ahmed
Code Syntax Highligher / Code Formatting in posts
April 4, 2011 9:29 AM
Answer

Tariq Ahmed

Rank: New Member

Posts: 7

Join Date: April 1, 2011

Recent Posts

Hi there. Is there a plug-in out there that adds in code syntax highlighting. I didn't see it under the official gallery, but thinking there might be a third party one out there? E.g.:

http://alexgorbatchev.com/SyntaxHighlighter/

Thx.
Hitoshi Ozawa
RE: Code Syntax Highligher / Code Formatting in posts
April 4, 2011 3:43 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

Hi there. Is there a plug-in out there that adds in code syntax highlighting. I didn't see it under the official gallery, but thinking there might be a third party one out there?


Do you mean an addition to the current CKEditor used in Web Content portlet and Blog portlet? Or a portlet to display javascript codes with syntax highlighted?

If the former, it may be better to ask the CKEditor project.
Tariq Ahmed
RE: Code Syntax Highligher / Code Formatting in posts
April 5, 2011 4:22 PM
Answer

Tariq Ahmed

Rank: New Member

Posts: 7

Join Date: April 1, 2011

Recent Posts

Not in the editor, but so that code snippets when displayed in a Blog or Web Content portlet are colorized/formatted.

E.g. are here two blog posting examples that use a code syntax highlighter to format/colorize code snippets similar to how they'd be presented within an IDE:

http://www.bennadel.com/blog/2161-Exploring-ColdFusion-9-Implicit-Synthesized-Getter-And-Setter-Behavior.htm

http://www.coldfusionjedi.com/index.cfm/2011/4/4/ColdFusion-Quickie-Finding-all-the-credit-card-numbers-in-a-string

They all use third party plugins in the form of JavaScript and CSS to accomplish it, and they're generally triggered off the JavaScript function detecting a certain tag. E.g.



SELECT * FROM BLAH...


Would then format it using the SQL syntax highlighter.
Tomi Savolainen
RE: Code Syntax Highligher / Code Formatting in posts
November 16, 2012 6:03 AM
Answer

Tomi Savolainen

Rank: New Member

Posts: 6

Join Date: October 13, 2008

Recent Posts

I would like to see something similar as well.
Hitoshi Ozawa
RE: Code Syntax Highligher / Code Formatting in posts
November 16, 2012 7:09 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

Sorry but I haven't seen any.