geshifilter needs a drupal7.php filter file. Attached is a first attempt at one:

To get it working:

  1. Download attached txt file
  2. rename to drupal7.php
  3. place in geshi-extra subdirectory
  4. visit the GeSHI filter general settings page, expand the "GeSHI library version 1.0.X detected" panel, and press "Flush the GeSHI language detection cache"
    or
    surf to /devel/php (dev module required) & execute the following to clear the geshi cache (the cache clear button in the admin interface is currently broken)
    include drupal_get_path('module','geshifilter') .'/geshifilter.admin.inc';
    _geshifilter_flush_language_definition_cache();
    
CommentFileSizeAuthor
#3 drupal7.txt139.64 KBsetvik
drupal7.txt139.77 KBsetvik

Comments

setvik’s picture

Updated comments at file top to reflect new Drupal version (Drupal 7)

setvik’s picture

Updated comments at file top to reflect new Drupal version (Drupal 7)

setvik’s picture

StatusFileSize
new139.64 KB
soxofaan’s picture

Hi,

Thanks for the drupal7 file! There seem to be some indentation issues though (not very critical).

How did you generate it? Did you use the script from #179470: Drupal Highlighting for GeSHi?

setvik’s picture

i didn't realize that script was there... nuts, that would've saved some time... i ended up writing a script in PHP to extract functions and constants...

There are a couple of things to note:

  1. api.drupal.org url schema has changed from:
    http://api.drupal.org/api/function/db_query/7
    to:
    http://api.drupal.org/api/drupal/includes--database--database.inc/function/db_query/7
    api.drupal.org redirects the former to the latter. The only way i can see to accomodate the new URL pattern in geshi (and avoid a redirect) would be to group the function names and constants by file which would make it possible to specify a URL pattern per drupal file. I haven't tested it, but i suspect it would be a performance hit. I generated the above file using the old url pattern.
  2. Class names are handled by api.drupal.org but don't work with the old URL schema... so I think they would need to be grouped together by file (as described above) so that the new url schema could be used and correctly applied by geshi.
soxofaan’s picture

Priority: Major » Normal

1. I think it's ok to use the old format, supporting the new format would increase the number of groups massively
2. Too bad classes are not supported in the old format. Doing it with separate groups will look silly I'm afraid: there will be one or two classes per group I guess. Maybe just leave doc link support for classes out of it for the moment?

boobaa’s picture

I think the best approach would be asking api.module guys how do they do their magic, and have something that can generate all the needed stuff for geshifilter.module based on their code, or something alike. Don't know if it really fits here, though, and don't know if handling all the classes, files and whatsoever as "groups" mentioned above would be a performance hit or not.

OTOH, there is another question here, I think: which is the bigger PITA: the man-hours to generate the file geshifilter.module needs (either "by hand" or "by code"), or the performance hit caused by that quite a bunch of "groups" (if any)?

yukare’s picture

Issue summary: View changes

There is something missing on this or we just need to add it to git ?

rosk0’s picture

Status: Needs review » Reviewed & tested by the community

I think we just need to commit it, it works.

gisle’s picture

Issue summary: View changes

Added alternate method for flushing language cache.

delacosta456’s picture

Hi i was facing this issue with Drupal 7.53 and Geshi 1.08.11

and Step 1 to 4 solve it for me.

thanks

  • setvik authored 3c7b935 on 7.x-1.x
    Issue #1166430 by setvik: Drupal 7 Filter file: drupal7.php
    
yukare’s picture

Status: Reviewed & tested by the community » Fixed

Commited, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.