[Geany-devel] Textmate color schemes convertion

Matthew Brush mbrush at xxxxx
Thu May 5 22:39:41 UTC 2011


On 05/05/11 07:40, Maciej Ciemborowicz (publiczny adres) wrote:
> Hi. I'm going to write Textmate color schemes to Geany color schemes
> converter. But I have doubts about how to do that properly.
> Documentation says, that I should place them in colorschemes/*.conf
> files. But as I see, filetype definitions have hardcoded colors. I don't
> want to generate schemes for all filetypes becouse it is... redundant. I
> want to write one color scheme and figure on filetypes.* which SHOULD
> depend on it (at least official versions). The second problem is, that I
> can place in colorschemes/*.conf only [named_styles] section, not
> [styling] section, which is in filetypes.common.

I think you'll find it more pleasant to work with the setup used in 
geany-themes[1].  It's fixes all the problems you're having, would make 
writing a converter much easier (I started one for Gedit->Geany themes), 
and it will likely be incorporated into Geany[2] proper in the near 
future.  If you do write a Textmate->Geany color scheme converter using 
the named styles geany-themes is using, I would *really* like to add it 
to the project, and also use it to create a bunch more themes.  There's 
a little explanation in the README in the repository, but you should be 
able to figure it out by poking around in the directories there.  Feel 
free to contact me if you have any questions.

Still, I will try and answer your questions below to help it make sense.

>
> 1. Where can I find full list of official [named_styles] properties? I
> can't find it in the manual.

You pick the names as you desire.

If you're familiar with CSS/HTML, it might be easier to use an example.

Where in CSS you would do:

   .my_named_style { some coloring/bold/etc... }

In a colorschemes *.conf file, you would do:

   [named_styles]
   my_named_style=fgcolor;bgcolor;bold;italic

And where in a X/HTML file you would do:

   <div name="comment" class="my_named_style">...

In the filetypes.* files you would do:

   [styles]
   comment=my_named_style

I hope that makes sense.

> 2. Why it is not possible to define [styling] properties in color scheme
> files?

You make the [styling] keys in the filedefs use (point to) the named 
style keys in your [named_styles] section in your colorscheme *.conf files.

> 3. Have I to overwrite filetypes.common to make well converted color scheme?

Some of the non-language specific styles are in filetypes.common, like 
the color of the line numbers margin, fold margins, caret/cursor, etc.

> 4. Have I to overwrite all filetypes.* files to make them depend on
> filetypes.common (on better colorscheme/*.conf) file?

Technically, yes, but I think it's because no one ever got around to 
finishing the named styles stuff in all of the filedefs.

>
> I don't entirely understand what is filetypes.common for and why it is
> not just a default color scheme in colorschemes/ subdirectory.

Like I said above, it has editor styles in it that aren't 
language-specific, also, the [named_styles] section in filetypes.common 
is what's used for the "Default" theme/named styles for filedefs 
supporting it.

[1] https://github.com/codebrainz/geany-themes
[2] https://github.com/codebrainz/geany/tree/colorscheme_fixup

Cheers,
Matthew Brush



More information about the Devel mailing list