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

Demosthenes Koptsis demosthenesk at ...626...
Fri Apr 1 14:16:12 CEST 2011


On Fri, 2011-04-01 at 08:30 +0200, Rolf-Werner Eilert wrote:
> 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
> 
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself; 
> WebMatrix provides all the features you need to develop and 
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

Yes actually i am writing a book for Gambas3 and i realy like an addon
or a capability to paste to OO highlight code for the book with the
colors of Gambas3 editor.

For now until now i did not find a solution to this.

I have started to learn OO Basic in order to make a small (or big) macro
which will highlight selected text from OO document.

The macro will work for Gambas3 code.

i saw this working for php so i will try to learn from it and make it
work for Gambas3 code.

until then wish me good luck!








-- 
Regards,
Demosthenes





More information about the User mailing list