Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-05-24 11:08:01

Sketch
Archived Plugin Author
From: Washington, D.C.
Registered: 2004-05-20
Posts: 23
Website

[plugin] [ORPHAN] tch_code: Code Syntax Highlighter

Notice: This thread is archived, this plugin is no longer available.

**********************************************************

Alright. Since I’m a Programmer and use code snippets on my blog, I created this function. I will add other syntax highlighters as the demand and ability allows.

<a href=“http://www.emmense.com/downloads/tch_code.txt”>Download</a>

Sample: <a href=“http://www.emmense.com/blog/Technology/10/already-a-now-playing-version-2”>Screenshot</a>

Instructions:
This snippet will syntax highlight a code snippet within your blog entry.

Using CSS, you can stylize the legend tag using the .codelabel class and the actual fieldset using the .snippet class.

Currently, syntax highlighting is only for PHP but I may add other languages as necessary.

Usage:
&lt;txp:tch_code label=“PHP”&gt;&lt;?php echo &quot;Hello World!&quot;; ?&gt;&lt;/txp:tch_code&gt;

Aaron

Last edited by Sketch (2004-05-24 11:08:14)


Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden

Offline

#2 2004-05-24 16:03:21

Drew
Plugin Author
From: Red pillar box, Baker St.
Registered: 2004-02-15
Posts: 53
Website

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

Looks cool, but I think you linked to the wrong download.


drew mclellan

Offline

#3 2004-05-24 16:11:20

Sketch
Archived Plugin Author
From: Washington, D.C.
Registered: 2004-05-20
Posts: 23
Website

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

I did? Okay well try again now. :)

Aaron


Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden

Offline

#4 2004-05-24 17:02:31

Ray
Member
Registered: 2004-03-02
Posts: 150

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

The screenshot link went to an entry in your blog called “Already Now Playing Version 2”. Is this what you want us to see?

The download code looks interesting. I’ll install and mess with it later today.

Offline

#5 2004-05-24 17:06:48

Sketch
Archived Plugin Author
From: Washington, D.C.
Registered: 2004-05-20
Posts: 23
Website

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

That is the link to deomnstrate the syntax highlighting. Not the function. I guess that is misleading. That other plugin is different.

Aaron


Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden

Offline

#6 2004-05-24 17:11:28

Ray
Member
Registered: 2004-03-02
Posts: 150

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

OK… The itunes widget is what I’m interested in.

A couple of questions…

Can this be installed directly in through the Txp interface? Is there anything else I need to do on my end?

Offline

#7 2004-05-24 20:27:26

Sketch
Archived Plugin Author
From: Washington, D.C.
Registered: 2004-05-20
Posts: 23
Website

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

You want <a href=“http://forum.textpattern.com/viewtopic.php?pid=10843#10843”>This</a> then.

Aaron


Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden

Offline

#8 2004-06-20 04:10:09

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

I don’t know what this plugin is doing… it has the wrong function name, it’s trying to call your server, etc. In the meantime, I just changed the code to

<pre>
function tch_code($atts,$snippet)
{
$nicecode = highlight_string($snippet,1);
return $nicecode;
}
</pre>

and it does well enough.

Offline

#9 2004-06-20 04:38:21

Sketch
Archived Plugin Author
From: Washington, D.C.
Registered: 2004-05-20
Posts: 23
Website

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

That’s fine if you want to highlight PHP only. However, what if you want to higlight C or bash or ASP? That’s what the plugin does that I provided, though there may have been errors…I don’t recall. It utilizes the Beautifier library to use context highlighting for whatever code you are using.

Aaron


Aaron Brazell
United States Navy
chmod a+x /bin/laden – Give everyone permission to execute /bin/laden

Offline

#10 2005-10-26 20:05:51

stefan koopmanschap
Member
Registered: 2005-09-14
Posts: 10

Re: [plugin] [ORPHAN] tch_code: Code Syntax Highlighter

it seems the link to the plugin is dead? :(

Offline

Board footer

Powered by FluxBB