|
Cookbook /
SourceBlock-Talkback to SourceBlock Please leave the latest message at the top.I encountered the problem that the Link GetCode is no longer written as GetCode but now with A workaround is to add SDV($SourceBlockLinkText, "Get Code"); before the include_once line. This breaks the automatic localisation. Maxim? October 31, 2009, at 07:48 AM
Question: Is there an easy way to add a little expand/collapse button to expand or collapse the source code block. I have code that has 100s of line of code and will be helpful. Thanks. -Shah April 23, 2009 at 02:18 PM Nevermind - It was quite easy to implement, I just used Toggle - Shah Regarding leading whitespace trimming: for many languages, the whitespace is significant and the first line might contain leading whitespace. If I change line 147 to restrict the trim characters:
if(!@in_array('trim', (array)$opt['-'])) $block = trim($block, "\n\r");
it behaves as I'd like - it still trims line breaks so you don't have to cram the first line after the SourceBlock is very nice and works well but I find that some of the colors really hard to read. I assume that Provided that:
<div class='sourceblock MYCLASS' id='...'> <div class='sourceblocktext'>COLORIZED SOURCE CODE HERE</div> <div class='sourceblocklink'>...</div> </div> You may use you own CSS definition such as:
.MYCLASS .LANG .kw1 { ... }
Please refer to the Local customization files and the GeShi documentation for further details on what styles to define and how to enable them on your pages. --Dfaure April 02, 2009, at 07:35 AM
Leading whitespace on the first line is lost. This is a feature. Use the -trim option to prevent this behavior. --Dfaure April 02, 2009, at 06:21 AM
What is the recommended way of changing colors? You may either use the id=... or class=... parameters associated with your own stylesheet definition, or alter the $GeshStyles global variable --Dfaure June 11, 2008, at 07:54 AM
I like SourceBlock very much and without external files it works for me like a charm. But I just can't get external files running. I installed LinkedResourceExtras and as an "enduser" didn't configure anything else - although this feels a little wrong because the receipe for LinkedResourceExtras says to I tried [EDIT: deleted the wrong ones]
and only get empty code blocks. Thanks for any help! Frank - October 12, 2007, 7:20 PM The LinkedResourceExtras must be includes before SourceBlock to be taken in account. Then the dedicated markup is simply (:source FILE_SPECIFICATION PARAMS:).--Dfaure October 14, 2007, at 04:40 AM
Talk page for the SourceBlock recipe (users). |