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.
1. Where can I find full list of official [named_styles] properties? I can't find it in the manual. 2. Why it is not possible to define [styling] properties in color scheme files? 3. Have I to overwrite filetypes.common to make well converted color scheme? 4. Have I to overwrite all filetypes.* files to make them depend on filetypes.common (on better colorscheme/*.conf) file?
I don't entirely understand what is filetypes.common for and why it is not just a default color scheme in colorschemes/ subdirectory.
-- Maciej Ciemborowicz
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.
- 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.
- 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.
- 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.
- 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
Hi guys,
A few extra notes on Matthew's reply
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.
- 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.
But if you don't want to change the filetype files then look in those for what names they use and also look in filetypes.common for what names it defines. For languages that use named styles, you shouldn't invent new names otherwise the defaults won't work and we won't be able to share your work.
As the note in the documentation says, not all filetypes have been converted to use colorschemes yet, nobody using that language has cared enough, but feel free to submit patches if you do your favorite language.
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.
- 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.
Since [styling] sections have no name there is no way to refer to them from filetypes files, so they would be unusable.
- 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.
No, it provides the default colorscheme, don't change that.
- 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.
Yep, somebody has to do it, patches are welcome (tm)
BTW don't overwrite the files in the system directory, put your modified ones in the user config directory as described in the docs.
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.
Backwards compatibility, filetypes.common existed before colorschemes. If the name was changed then user setups would break on upgrading.
Cheers Lex
On 06.05.2011 00:39, Matthew Brush wrote:
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] https://github.com/codebrainz/geany-themes [2] https://github.com/codebrainz/geany/tree/colorscheme_fixup
Cheers, Matthew Brush
Thanks a lot for your explanation. Geany-themes looks very good, I forked your project few minutes ago. For conversion I will use Coloration[1] which already has a TextMate themes reader. The only thing I have to do is a Geany color schemes writer.
[1] https://github.com/ciembor/coloration
-- Maciej Ciemborowicz