Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello
Is there a tutorial how to integrate this great module with Geshi Filter for syntax highlighting
there are serveral issues like
http://drupal.org/node/283444 & http://drupal.org/node/269937
I want to be able to mark part of the text as code and set it's code language
I will be happy to document this if someone can give me a hint
Comments
Comment #1
wwalc CreditAttribution: wwalc commentedActually I think that the best solution would be to create a simple plugin that integrates Geshi Filter with FCKeditor.
At this moment all you have to do is to switch to source mode, create a
<pre>
tag with a "type" attribute (pre should be added to "Generic syntax highlighting tags" in Geshi Filter settings).The plugin I'm thinking of could contain the following things:
- textarea for a code
- select box with all languages supported by Geshi
After user presses the "ok" button, code could be automatically surrounded by
<pre type="php">
and pasted into FCKeditor.Additionally, you could use the "Style" button in FCKeditor and add in fckstyles.xml
this way after code is already in FCKeditor you could still easily change it's language using the "Style" button.
Useful links:
http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API
http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Customization/P...
Remember to share your plugin with others if you create such ;-) I could add it to the FCKeditor module.
Comment #2
WorldFallz CreditAttribution: WorldFallz commentedJust an FYI-- I just found this, thought it might be worth a look:
Geshi Filter for FCKeditor: GeSHi Pro.
I'll post back after I give a try.
Comment #3
Grayside CreditAttribution: Grayside commentedThis looks pretty good. However, it works by applying the code-highlighting at the time you compose your post. It is stored as HTML.
That really locks you in to GeshiPro, FCKeditor, and the specific styles applied to the code at the time you compose it.
Comment #4
nicorac CreditAttribution: nicorac commentedThis works well, except for special HTML chars like ">".
Suppose you're writing some PHP code like this:
$a = array('key1' => 'value1');
If you swap from WYSIWYG to source view and back, all of your ">" will be replaced by "%gt;"
How to solve this?
Comment #5
JBravo CreditAttribution: JBravo commentedwwalc
Thanks, man. That is just what I need.
Comment #6
Jorrit CreditAttribution: Jorrit commentedIt seems to be solved.