ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
#45455 [Opn->Bgs]: highlight_file could take start/length line numbers for excerpts
by johannes other posts by this author
Jul 8 2008 7:44AM messages near this date
#45455 [NEW]: highlight_file could take start/length line numbers for excerpts | #45454 [NEW]: strtoupper() doesn't work with danish letters: זרו
ID:               45455
 Updated by:       johannes@[...].net
 Reported By:      ceo at l-i-e dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: N/A
 PHP Version:      5.2.6
 New Comment:

highlight_file is a small helper and not meant to be a full-features
highlighter.

Instead of parsing the output you might also read the file (using
file(), file_Get_contents() or so and then use highlight_string() on
some chunks of it.


Previous Comments:
------------------------------------------------------------------------

[2008-07-08 13:45:09] ceo at l-i-e dot com

Description:
------------
I would find highlight_file much more useful, particularly for writing
on-line tutorials, articles, etc if it would take a line number and
count optional arguments, to print out only an excerpt of the file.

One could then intersperse bits of code and commentary very easily with
original source files instead of having to keep code snippets in sync as
you develop/author an article.

One can, of course, play games with explode("<br /> " and array_slice,
but it's a bit of a pain, really.

It would also be extra nifty if line numbers could be added on the left
with yet another optional arg, and maybe even an arg for
absolute|relative numbering for the snippets.

PHP Rocks!




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45455&edit=1
Thread:
Ceo At L-I-E Dot Com
johannes

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved