Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Hi, thanks for using my plugin :D
I suppose you’re using textile. You have to disable it just before the opening tag. I’m not used to textile, so I cannot say you how to disable it only in a little part of the message, but I’m sure you can.
Gr3yFox
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Ops. You’re right. I haven’t seen this mentioned in the help or in your article! To be honest, I thought it could have been a textile problem, but failed to find the exact place to put notextile.. . Thanks to Gocom I made it! Thanks again.
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Hi everyone.
I’m here just to say hello, ensure this plugin is not marked as orphaned again, and, last but not least, announce the new 0.2.1 version. Now it’s compatible with Textpattern 4.4, there were some problems with the new mandatory tag naming conventions.
I’m sorry to post an update this late, but I really did not notice the problem until today.
Gr3yFox
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
I just released my code on GitHub to improve its maintainability.
I’m planning to review a little bit the code soon and check for it’s compatibility with new versions of geshi (my library version is still quite old).
I have a favor to ask you: could you post some tickets about the problems you’re experiencing or about the features that in your opinion are still missing on my GitHub page, please?
https://github.com/Gr3yFox/fox_code/issues
I’m planning to do that for fox_files_stats too.
Gr3yFox
Offline
#20 2011-09-16 07:43:36
- sgreener
- Member
- Registered: 2008-11-05
- Posts: 16
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Gr3yFox,
You have done us a great service.
I downloaded the latest geshi and moved geshi.php and the geshi folder to textpattern/lib.
I am now trying to get it to work.
I create a new article and put this into it.
<txp:fox_code language=“sql” >SELECT * FROM DUAL;</txp:fox_code>
I don’t get any colouring of SELECT and FROM. I have tried putting notextile. in front but it still doesn’t work.
Can you help me get it working please?
regards
Simon
Last edited by sgreener (2011-09-16 07:44:39)
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Hi,
I’ll try to check it this evening.
Best,
Riccardo
edit: is that an issue that arises only with fox_code + sql language or not?
Last edited by Gr3yFox (2011-09-16 07:57:55)
Gr3yFox
Offline
#22 2011-09-16 08:25:54
- sgreener
- Member
- Registered: 2008-11-05
- Posts: 16
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
I don’t know Italian though I am married to one. No, I was not being sarcastic at all. I have been looking for a functional syntax highlighter for TextPattern for a long time. I want it to highlight SQL that I publish on my website. I have done all the installs I think correctly but can’t get fox_code to work. Can you help me.
Simon
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Sure, no problem. Can you switch for a brief moment to debug mode (instead of live) from administration -> preferences and see which errors shows up in the page with the sql code please? That could be really helpful to solve your problem.
edit: just to be on the safe side, is the plugin enabled? :) Which version of geshi did you install, 1.0.8.10 (the latest stable)?
Last edited by Gr3yFox (2011-09-16 12:15:43)
Gr3yFox
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
@sgreener: please tell me more details about your problem. I just made some checks, and fox_code works correctly for me up to GeSHi-1.0.8.10. There must be some error in your installation.
Gr3yFox
Offline
#25 2011-09-26 02:12:55
- sgreener
- Member
- Registered: 2008-11-05
- Posts: 16
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Gr3yFox,
Apologies for not having responded earlier. I stopped receiving emails about comments on this post so I assumed all had gone quiet.
And I got busy doing some non-computing stuff for my wife around the garden….
I had debugging on and have now turned it off.
I have sorted out one issue. When constructing an article (to test the fox_code tags) I tried using Preview to view the result. It doesn’t work.
So, now I have published my tests for you to see at : http://www.spatialdbadvisor.com/manifold_tips_tricks (select Test GeSHI).
The first, which doesn’t work, is generated by:
<txp:fox_code language=“sql” >
SELECT 1
FROM DUAL;
</txp:fox_code>
I get html like this:
<br />
<span class=“caps”>SELECT</span> 1
<span class=“caps”>FROM</span> <span class=“caps”>DUAL</span>;<br />
The second, which does work, is generated by:
<txp:fox_code language=“sql” fileid=“14” />
It is the former that will be the dominant method of using fox_code as my articles always include single SQL queries.
regards
Simon
Offline
#26 2011-09-26 02:17:04
- sgreener
- Member
- Registered: 2008-11-05
- Posts: 16
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
OK, Textpattern’s article construction form I changed “Article Markup” on the left to “leave text unchanged” from “Use Texttile” and I now get colour coded SQL. But this stuffs up other things.
Surely this is not the right way to use fox_code?
regards
Simon
Offline
#27 2011-09-27 02:23:04
- sgreener
- Member
- Registered: 2008-11-05
- Posts: 16
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
OK, so I have gotten it to work reasonably well by use of “notextile..” before <txp:fox_code language=“sql” >
followed by “p.” afterwards.
I would rather NOT have to do this so, Gr3yFox, if you are doing any more work on this most useful plugin I would like to see this issue solved so that I did not have to use “notextile..”/“p.”.
Thank you for all your efforts.
regards
Simon
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
So you problem was the absence of “notextile.” before the code tag? I’m aware of this behaviour, I should specify it in the documentation. I’m sorry I forgot.
The issue does not hold for plain html formatted articles, however I’m afraid you’ll have to specify “notextile.” every time you use those tags in textile formatted articles: you can have a look at this (technical) discussion if you want to find out why I’ll not modify my plugin like that, but the point is that it quite goes against the normal textpattern plugin workflow, and it’s far too complicated with respect to the gains.
edit: sorry for the late in answering you, but I’m really busy these days. Should textpattern include the mechanism to add textile plugins, probably I’ll turn my fox_code into a textile plugin, so that the issue will be solved.
Last edited by Gr3yFox (2011-09-27 08:37:41)
Gr3yFox
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Hi Riccardo,
Is it possible to edit the plugin to output code without the DIV wrapper, move the selectors to the PRE element, and eliminate inline style attributes?
So instead of this…
<pre>
<code>
<div class="php" style="font-family:mono-space;">
<ol>
...
</ol>
</div>
</code>
</pre>
Have this…
<pre class="php">
<code>
<ol>
...
</ol>
</code>
</pre>
The DIV seems extra to me (though I’m not sure if it’s actually needed to control the numbered listing), and I’d rather control presentation via CSS than inline.
I’ve had a look at the plugin code, but it might as well be Klingon, as far as my non-developer mind can make it out.
Offline
Re: fox_code - A bridge to the powerful GeSHi syntax highlighter
Hi Destry.
Both (X)HTML and CSS used in <txp:fox_code_form> come from textpattern’s templates and styles in the admin control panel.
If you are talking about the basic <txp:fox_code> tag then you should be able to change this behaviour by changing a single line of my code. Just comment out (i.e. add two consecutive slashes // in front of it) the $geshi->set_header_type(GESHI_HEADER_DIV); line in the function fox_code: GeSHi’s behaviour will go back to default, leaving only a <pre> around the code. Here is the documentation, should you need it: set_header_type.
Thanks for using my plugin :)
Gr3yFox
Offline