Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.3

Request #4634 Code block title/filename
Submitted: 2005-06-19 21:31 UTC
From: ben at horde dot org Assigned: toggg
Status: Closed Package: Text_Wiki
PHP Version: 4.3.11 OS: Linux (gentoo)
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 26 + 12 = ?

 
 [2005-06-19 21:31 UTC] ben at horde dot org
Description: ------------ I'd like to be able to give a title, or filename attribute to code blocks. An example of how this would be useful is for specifying a filename in howto documents, so the reader can easily determine which file this code belongs in. I envision displaying the file name in italics, either directly above, or directly below the code block, with little or no padding. A small patch is provided to demonstrate what I'm looking for. Reproduce code: --------------- --- Code.php.bak 2005-06-19 16:26:41.000000000 -0500 +++ Code.php 2005-06-19 16:20:19.000000000 -0500 @@ -96,6 +96,10 @@ $text = "$text"; } + if (isset($options['attr']['filename'])) { + $text = '
' . $options['attr']['filename'] . '
' . $text; + } + return "\n$text\n\n"; } }

Comments

 [2005-07-16 09:09 UTC] toggg
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. To be coherent with the existing, it's using the configuration parameter 'css_filename'. You will have to do something like: $wiki->setRenderConf('xhtml', 'code', 'css_filename', 'codefilename'); to get this feature working
 [2005-07-16 15:51 UTC] yunosh
This doesn't make sense because you want different code blocks on a page.
 [2005-07-16 20:07 UTC] toggg
Sorry, the style is fixed under conf render xhtml code css_filename. But filename itself is parsed and associated in token with the other attributes. You can refer/try the test/example left in Text_Wiki/doc Please, close that one or give some more info about what does not work. If your request relates to some changes of the general interface, please, open another bug/RFE
 [2005-07-19 07:08 UTC] yunosh
Looks fine now.