My tool is ready!
https://github.com/gingerbeardman/Priiprocess
The goals were:
* Easier theme creation
* Easier theme editing
* Easier theme management
* Smaller themes
* Modular themes
It does this by introducing:
* Variables
* Includes
The result is kind of like a cross between INI and CSS.
You can define a single
.color_heading and then use it in many places. To change the colour of all those elements, simply change the single definition and you're done!
To show that the tool works, I have deconstructed
Rhapsodii 2.0 which in the process became a more organised theme. By reusing definitions for common positions and reusable elements I was able to consolidate and improve consistency. Thanks for your kind support
@Hakaisha!
As an example, every title has the same code:
Code:
[ABOUT/TITLE]
color=#FFFFFFFF
effect_scale_x=1
effect_scale_y=0
effect_x=0
effect_y=-200
font_line_height=0
font_size=0
font_weight=0
height=60
width=600
x=20
y=15
We can replace this with the names of (unshown) user definitions, which is easier to read/write but still repetitive:
Code:
[ABOUT/TITLE]
.white
.fixed_scale_x
.zero_scale_y
.fixed_left
.from_off_top
.no_line_height
.no_font_size
.no_font_weight
.title_height
.title_width
.title_x
.title_y
And by go further by using a single include:
Code:
[ABOUT/TITLE]
.title
[PLUGIN/TITLE]
.title
The best results would come from building a theme from a scratch with the tool in mind, as my deconstruction of Rhapsodii 2.0 could be optimised further still. Compared to my last manually edited Rhapsodii.ini the results of this tool are a more consistent theme, with some 250+ small changes due to the increased consistency.
The tool is less than 100 lines of PHP code. It could easily be ported to Python or even C (if WFL wanted to add support for this type of theme format).
It spits out a .prii.ini file (all includes merged into one file but still with variables) and the final .ini (incudes merged with all variables replaced).
Let's call this a first test vision, to get feedback. If it's something people would use then I will create my own thread for it.
Thanks for your time and, as always, have fun!