Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PhD request about highlight source code

0 views
Skip to first unread message

Laurent Laville

unread,
Jan 23, 2009, 9:34:31 AM1/23/09
to php...@lists.php.net
Hello PhD team,

Is it possible to include/define a custom highlight source-code engine ?

Standard PHP highlight source code functions [1] does not provided line
numbering, and its a regret (for me). I prefer to use GeSHi [2] that
give ability to build such result [3] extends to lot of language. Which
I consider better to follow a tutorial step by step.

Laurent Laville

[1] http://www.php.net/manual/en/function.highlight-file.php
http://www.php.net/manual/en/function.highlight-string.php
[2] http://qbnz.com/highlighter/
[3]
http://www.laurent-laville.org/pear/HTML_QuickForm_advmultiselect/docs/TDG/en/ch05.html

Christian Weiske

unread,
Jan 23, 2009, 9:46:03 AM1/23/09
to php...@lists.php.net
Hello Laurent,

> Is it possible to include/define a custom highlight source-code engine ?

I think this is a decent feature request. Could you add it to the php.net bugtracker?

--
Regards/Mit freundlichen Grüßen
Christian Weiske

Laurent Laville

unread,
Jan 23, 2009, 10:09:40 AM1/23/09
to Christian Weiske, php...@lists.php.net
Christian Weiske a écrit :

> Hello Laurent,
>
>
>
>> Is it possible to include/define a custom highlight source-code engine ?
> I think this is a decent feature request. Could you add it to the php.net bugtracker?
>

Done -> http://bugs.php.net/bug.php?id=47201

Christian Weiske

unread,
Jan 25, 2009, 4:53:54 PM1/25/09
to php...@lists.php.net
Hello Laurent,

I've implemented it; it will be in 0.4.4


--
Regards/Mit freundlichen Grüßen
Christian Weiske

-= Geeking around in the name of science since 1982 =-

signature.asc

Laurent Laville

unread,
Jan 25, 2009, 5:22:10 PM1/25/09
to php...@lists.php.net
Christian Weiske a écrit :

> Hello Laurent,
>
>
>>>> Is it possible to include/define a custom highlight source-code
>>>> engine ?
>>> I think this is a decent feature request. Could you add it to the
>>> php.net bugtracker?
>> Done -> http://bugs.php.net/bug.php?id=47201
>
> I've implemented it; it will be in 0.4.4
>
>

Very impatient to use it :)

Christian Weiske

unread,
Jan 26, 2009, 12:15:26 AM1/26/09
to php...@lists.php.net
Hi Laurent,

Just check out branch phd_0_4 from cvs.

An example:
http://tmp.cweiske.de/package.console.console-commandline.creating-the-parser.html

signature.asc

Laurent Laville

unread,
Jan 26, 2009, 6:36:59 AM1/26/09
to Christian Weiske, php...@lists.php.net
Christian Weiske a écrit :

> Hi Laurent,
>
>
>>>>>> Is it possible to include/define a custom highlight source-code
>>>>>> engine ?
>>>>> I think this is a decent feature request. Could you add it to the
>>>>> php.net bugtracker?
>>>> Done -> http://bugs.php.net/bug.php?id=47201
>>> I've implemented it; it will be in 0.4.4
>> Very impatient to use it :)
>
> Just check out branch phd_0_4 from cvs.
>
> An example:
> http://tmp.cweiske.de/package.console.console-commandline.creating-the-parser.html
>

It's nice Christian, and very impressive to implement this feature so
quickly, but ... sorry there is a but:

I found a problem when using different header type usage with Geshi. My
technical explains will follow offline soon. Just to let me finish my
last tests.

BTW, great job in a very frame time :)

Laurent

Richard Quadling

unread,
Jan 26, 2009, 7:35:29 AM1/26/09
to Laurent Laville, Christian Weiske, php...@lists.php.net
2009/1/26 Laurent Laville <pe...@laurent-laville.org>:

Got this working on phpdoc and peardoc (had to play around with the
name and locations a bit - probably the same issues as Laurent).

--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

Richard Quadling

unread,
Jan 29, 2009, 1:15:14 PM1/29/09
to PHPdoc List
2009/1/26 Christian Weiske <cwe...@cweiske.de>:
> Hello Richard,

>
>
>> >>>>> Done -> http://bugs.php.net/bug.php?id=47201
>> >>>> I've implemented it; it will be in 0.4.4
>> >>> Very impatient to use it :)
>> > I found a problem when using different header type usage with Geshi. My
>> > technical explains will follow offline soon. Just to let me finish my last
>> > tests.
>> Got this working on phpdoc and peardoc (had to play around with the
>
> It requires the highlighter class being available in the include path via the PEAR rules:
> Take class name, replace '_' with '/' and append a '.php' to it.

>
> --
> Regards/Mit freundlichen Grüßen
> Christian Weiske
>

Tiny little bug which only generates an issue in IE (tested in
IE/Chrome/Firefox) and CHM files where you cut and paste an example.
There are no newlines so the example code runs into 1 line.

Adding ...

$geshi->set_header_type(GESHI_HEADER_DIV);

solves this.

See http://bugs.php.net/bug.php?id=47242


Richard.

0 new messages