|
TextArea<< | Cookbook-V1 | >> Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.
GoalProvide a =textarea markup to allow scrolling display of program listings. SolutionAdd the following to local.php: $InlineReplacements['/^=textarea (.*)$/'] =
'<textarea cols="60" rows="6" wrap="no">$1</textarea>';
DiscussionThe above code adds
=textarea [=
<?php
print "Here is some sample PHP code\n";
print "Complete with variables and other items\n";
?>
=]
produces =textarea <?php print "Here is some sample PHP code\n"; print "Complete with variables and other items\n"; ?> A useful feature of this approach is that many browsers make it easy to select the contents of a textarea control (for copy-and-paste operations) by using CTRL-A or some other keyboard shortcut. See Also
Contributors
pmwiki-2.2.0-beta68 -- Last modified by {{}}?
|