[Gambas-user] About syntax highlighting and copy/paste to OpenOffice

Rolf-Werner Eilert eilert-sprachen at ...221...
Fri Apr 1 08:30:54 CEST 2011


Am 31.03.2011 17:15, schrieb Demosthenes Koptsis:
> These days i tried some ways to make the Gambas3 code in an OO3 document
> be highlighted as in Gambas3 editor.
>
> 1) For this, i used many online web syntax highlighters such as
> http://pygments.org/
> http://pastebin.com/
> http://qbnz.com/highlighter/
>
> but when i copy the code from webpage OO does not make it "Paste
> Special" in document, i dont know why...!
>
> 2) also i found an addon for OO named COOoder
> the old page is
> http://extensions.services.openoffice.org/node/940
>
> but has no gambas support and the developer has no plans for any update
> recently.
>
> Although the COOoder addon is easily configurable.
> Someone can take the GeSHi gambas.php file and feed it at cli to script
> http://cgit.freedesktop.org/libreoffice/build/tree/extensions/coooder/php/from-geshi.php
>
> this will make a gambas.xml file which is the highlight for COOoder
> addon.
>
> (i edited the GeSHi gambas.php to gambas3.php for anyone who want it,
> although it is not complete yet)
>
> The gambas.xml then must be copied to path
> /home/user/.openoffice.org/3/user/uno_packages/cache/uno_packages/o36C8H_/coooder-1.1.2.oxt/config/org/openoffice/langs
>
> or similar... where OO addons exist.
>
> But unfortunately the COOoder may be has a bug.
> When reach a line with gambas3 comment stops the process of
> highlighting. (see screenshot)
>
> i sent an email to COOoder writer and i hope to help me or to fix the
> bug.
>
> -----------
>
> Do you know any other way to make highlight the code in OO for gambas
> code?
>
> Is it possible when i copy the code from gambas editor to keep meta-data
> for OO, so i can make a "Paste Special" ?
>
> of course the simple paste must keep use raw text.
>


Hm, this is just what I meant: When we had a tool which was resident 
within the IDE, it could easily have access to the editor's highlighting 
and many other things, thus enabling for easier highlighting than an 
external tool. Why re-invent the wheel?

I guess it's pretty easy to simply use the Gambas editor's highlighting 
capabilities by reading the code from it and evaluating the highlighting 
properties of the text. The editor is there in Gambas and can be easily 
read, so let me just make some trials...

Good idea though not to print directly but offer the option to paste the 
text into OO for further rendering. If I was an author of a book about 
Gambas, I'd love this... :-)

Regards

Rolf




More information about the User mailing list