For my needs I have rewritten the geshifilter module. Although I started from the original, it is almost a complete rewrite. Changes include:
1. Support for GeSHi 1.1.x (although I wouldn't reccomend using it at the moment)
2. Rewrote regexp to support larger code blocks (http://drupal.org/node/82276)
3. Special tags per language
4. Same tag for blockcode and inline code
5. Configurable tag names and attribute names (http://drupal.org/node/80407)
At the moment the option to support css classes and change the surrounding block (pre,div,none) are not implemented (because I didn't have the need for this yet).
Tell me what you think.
Comment | File | Size | Author |
---|---|---|---|
#19 | geshifilter-rewrite-node_112067_r14.tar_.gz | 7.17 KB | soxofaan |
#15 | geshifilter-rewrite-node_112067_15.tar_.gz | 6.5 KB | soxofaan |
#1 | geshifilter.tar_0.gz | 6.76 KB | rötzi |
geshifilter.tar.gz | 6.79 KB | rötzi |
Comments
Comment #1
rötzi CreditAttribution: rötzi commentedi forgot to remove some debug stuff. here the new version.
Comment #2
mhutch CreditAttribution: mhutch commentedNice stuff. Not tested it, but had a quick look through the code and it looks like a big improvement.
I'm annoyed I missed this before doing a much more basic port myself! However, I guess some of the CSS changes from my code (at http://drupal.org/node/120300) could be merged into this.
Comment #3
rötzi CreditAttribution: rötzi commentedI will look at it when I find the time (I'm quite busy at the moment, so it may not be that soon).
By the way, there is a new version of the module which works with the latest pearwiki_filter available here: http://drupal.tschannen.net/wiki/geshi_filter
Comment #4
vfilby CreditAttribution: vfilby commentedI just updated my site to 5.1 and your rewrite works wonderfully! The settings interface is much nicer than in my original version.
Good Work!
Comment #5
Jax CreditAttribution: Jax commentedThe module attached to #1 seems to work. Thanks!
Comment #6
BronzeAge CreditAttribution: BronzeAge commentedyes, it works great. thanks!
Comment #7
Dieter_be CreditAttribution: Dieter_be commentedHi, thanks for the effort!
I can't get it to work though :/
I downloaded the latest version (from comment #3).
tried with both geshi 1.0.7.1 and 1.0.7.19 (latest stable)
I use Drupal 5.1, 2007-01-29
the module is enabled, in configuration it says "1.0.x version detected", the config is pretty much left default.
I did made sure php syntax hilighting is enabled
when i try to write a blogpost and type something like this:
i see the cleartext, un-hilighted output.
Anyone has an idea what might be the cause?
thanks,
Dieter
Comment #8
Dieter_be CreditAttribution: Dieter_be commentedOh, drupal ate my surrounding tags in the previous post :)
i typed this [code lang="php"]...[/code] but with < and > instead of [ and ]
Comment #9
drumlin CreditAttribution: drumlin commented@Dieter_be:
Maybe a shot in the dark but you might try this: go to
Administer >> Site configuration >> Input formats
and then make sure that the Geshi filter is activated in the "PHP code" input format.
HTH,
Marco
Comment #10
drumlin CreditAttribution: drumlin commentedAh, OK... you already did that, as I'm reading only now.
Sorry, will do better next time ;)
Comment #11
Dieter_be CreditAttribution: Dieter_be commentedHello fellow Gentoo user,
no you were right, that was exactly what I forgot to do!
Damn, this is even mentioned in the readme, maybe it could be elaborated a bit more?
anyway it works now, thanks
Dieter
Comment #12
drumlin CreditAttribution: drumlin commentedGlad I could help (meanwhile I've read your post for the third time and now I do see where I've misread) ;)
Regards,
Marco
P.S.: Gentoo rocks ;)
Comment #13
anisotropic CreditAttribution: anisotropic commentedSo, is there any talk of commiting the rewrite to contrib as the 'official' geshifilter module? I have some enhancements to this i've done for my own purposes, but would rather see them merged back in.
Comment #14
Prodigyx CreditAttribution: Prodigyx commentedHow do I use Special Tags?...I try to put ... on post...I've configured on Special Tags 'delphi' and do not work.
Comment #15
soxofaan CreditAttribution: soxofaan commentedI spend some time on evaluating rötzi's rewrite for drupal 5 and I like it a lot. I worked further on his version from #3 (http://drupal.tschannen.net/wiki/geshi_filter) and ended up with the attached version.
The changes with rötzi's version are mainly:
As far as I can tell this rewritten geshifilter module is in a very good shape, rötzi did a very good job with his rewrite.
I hope this rewrite will make it in some form to the official branch.
It seems, however, that there is little/low activity in the tracker. Are the maintainers still actively maintaining the geshifilter module? Just curious.
Cheers
Soxofaan
Comment #16
ktonini CreditAttribution: ktonini commentedAwesome job, soxofaan! Would it be possible to create a checkbox that enables custom css styles? Also, as of right now, the geshifilter.css stylesheet overrides any theme level css, but I expect the css checkbox feature would fix this.
Comment #17
soxofaan CreditAttribution: soxofaan commentedIn my test setup with the standard garland theme, the garland css files come after geshifilter.css, so garland could override geshifilter.css.
Moreover, what do you want to change to geshifilter.css? It's such a small file, you could maybe just edit that file?
Anyway, it doesn't feel right to add a checkbox to the settings page for theming purposes. I think there should be a better solution. Can you give more info about your setup?
Thanks for your feedback.
Comment #18
ktonini CreditAttribution: ktonini commentedI checked and my theme stylesheet gets called after geshifilter as well, so this must just be a css issue on my end then.
I tend to shy away from editing any core/module files so that it is easier to update them. Really, the functionality that I would like is to be able to override the geshifilter default styling. This has more to do with the actual *language*.php files in the geshi folder rather than the geshifilter.css file in the module folder. In fact, there is a built in way to handle this in the Geshi code (http://qbnz.com/highlighter/geshi-doc.html#using-css-classes). Since it is more or less a true/false flag, I figured the best, or at least simplest, way to handle it would be with a checkbox. Do you see any other ways of handling it?
Comment #19
soxofaan CreditAttribution: soxofaan commentedIf I understand you correctly, you want to override the GeSHi styling, and not the GeSHi filter styling (technically, the GeSHi filter module is just a wrapper around the GeSHi library). This is indeed a sensible feature request.
in attachment is a new version of the rewrite with:
* option to choose between inline CSS or CSS classes+external stylesheet
* the per language settings can now be filtered with 'all' , 'enabled' or 'disabled'
* solved bug when to much spaces are entered in the tag and attribute fields
cheers
Comment #20
soxofaan CreditAttribution: soxofaan commentedComment #21
ktonini CreditAttribution: ktonini commentedPerfect! That is exactly what I had in mind.
Comment #22
soxofaan CreditAttribution: soxofaan commentedThanks.
Also note that the rewrite of this issue thread is already committed to CVS and further being worked on (as version 5.x-2.x).
Latest version (at the time of this writing): geshifilter 5.x-2.0-rc2.
So you better use that one, than the tar balls in this thread.
Comment #23
(not verified) CreditAttribution: commented