Patterns of transformation CSS for EasyNeatly

1. What is a patterns? about Accurate cascade style scheets «Easy Neatly»

The pattern or patterns is usual file, ini format.
In it(him) the micro-templates and set-up of transformation are described.
Some templates can be stored in one of ini the file.
Each template of transformation is selected in separate section With the name [Transform<#ID>], where and <#ID> unique number. The quantity of patterns (sections) in one file is not limited.

2. Where the patterns are stored? about Accurate cascade style scheets «Easy Neatly»

The files of patterns i.e. files, format ini are stored in subdirectory Patterns, located in a directory of the installation of the program. The base file of patterns default.ini here is stored. The transformations --easy and --neatly boot from the default.ini file and use of section 2 and 1 accordingly.

You also can create and to combine ini files of templates in this directory, and to call EaseNeatly so, to use them. Quantity ini of files beyond all bounds, and they can have any names.

If you will create the file with patterns of transformations, for example MyTransform.ini, with section [Transform1], you can it use by a command:

#easyneatly.exe --file=style.css –-pattern=MyTransform –-indexpattern=1
3. What is a Micro-Templates? about Accurate cascade style scheets «Easy Neatly»

Micro-Templates are lines, which will be inserted into certain places CSS of a code. You can use special & sequences of numerals for replacement in these lines. The Micro-Templates are used in parameters of patterns - see below.

Micro-Templates Applicability
&NONE; Empty place or nothing
&SPACE; One Space
&TAB; [09] HORISONTAL TABULATION (TAB)
&CR; [0D] – CARRIAGE RETURN (CR)
&LF; [0A] – LINE FEED (LF) (End of line Unix)
&CRLF; [0D+0A] (End of line Windows)
4. How to edit a pattern? about Accurate cascade style scheets «Easy Neatly»
[Transform1]

// - This parameter anything does not influence - //
// - It is simple a title of a Pattern - //
Transform_Name = Neatly




//////////////////////////////////////////
// Set-up of processing of the comments //
//////////////////////////////////////////


// - This parameter indicates - //
// - Whether it is necessary to insert the special-comments - //
// - Devidings CSS file on semantic section - //
// - Receives values yes | no - //
make_sections_comments = yes


// - The following parameters - //
// - It is comments - //
// - Devidings CSS file on semantic section - //
// - Lines with application of Micro-Templates - //
Section_Rules = /* -===- &CRLF;RULES&CRLF; -===- */&CRLF;

Section_Main = /* -===- &CRLF;MAIN&CRLF; -===- */&CRLF;
Section_Hacks = /* -===- &CRLF;HACKS&CRLF; -===- */&CRLF;

Section_Links = /* -===- &CRLF;LINKS&CRLF; -===- */&CRLF;
Section_Layout = /* -===- &CRLF;LAYOUT&CRLF; -===- */&CRLF;

Section_Grids = /* -===- &CRLF;GRIDS&CRLF; -===- */&CRLF;
Section_Common = /* -===- &CRLF;COMMON&CRLF; -===- */&CRLF;

Section_Colors = /* -===- &CRLF;COLORS&CRLF; -===- */&CRLF;


// - The following parameters - //
// - Describe as to make out the other comments - //
// - Opening of the comment - //
sections_comment_open = /*&CRLF;

// - Character set puted before the text of the comment - //
sections_comment_before_text = &CRLF;
// - Character set puted the ambassador of the text of the comment - //
sections_comment_after_text = &CRLF;
// - Closing of the comment - //
sections_comment_close = */&CRLF;


// - Whether to save the comments, relating Rules, (@rules) - //
// - Accepts values yes | no - //
save_rule_comments = yes


// - The following parameters - //
// - Describe how to make out comments concerning Rules - //
// - To similarly other comments - //

rule_comment_open = /*&CRLF;
rule_comment_before_text = &CRLF;
rule_comment_after_text = &CRLF;
rule_comment_close = */&CRLF;


// - Whether to keep comments concerning Selectors? (Selectors) - //
// - Accepts values yes | no - //
save_selector_comments = yes


// - The following parameters - //
// - Describe how to make out comments concerning Selectors - //
// - To similarly other comments - //

selector_comment_open = /*&CRLF;
selector_comment_before_text = &CRLF;
selector_comment_after_text = &CRLF;
selector_comment_close = */&CRLF;


// - Whether to keep comments concerning Properties of Rules? (@rules) - //
// - Accepts values yes | no - //
save_rule_property_comments = yes


// - The following parameters - //
// - Describe how to make out comments concerning Properties of Rules - //
// - To similarly other comments - //

rule_property_comment_open = /*
rule_property_comment_before_text = &SPACE;
rule_property_comment_after_text = &SPACE;
rule_property_comment_close = */


// - Whether to keep comments concerning Properties of Selectors? (Selectors) - //
// - Accepts values yes | no - //
save_selector_property_comments = yes


// - The following parameters - //
// - Describe how to make out comments concerning Properties of Selectors - //
// - To similarly other comments - //

selector_property_comment_open = /*
selector_property_comment_before_text = &SPACE;
selector_property_comment_after_text = &SPACE;
selector_property_comment_close = */


////////////////////////////////////////////////////////////////////
// Options of processing of rules of classes and their properties //
////////////////////////////////////////////////////////////////////


// - Symbols after a rule name - //
rule_after_name = &SPACE;


// - Symbols after an opening bracket of a rule - //
// - @rulename {<HERE> - //
rule_after_open = &CRLF;


// - Symbols after a closing bracket of a rule - // 
// - @rulename {...}<HERE> - //
rule_after_close = &CRLF;&CRLF;


// - Symbols before a name of property of a rule - //
// - @rulename {...   <HERE>property:value  ...} - //

rule_property_name_before = &TAB;


// - Symbols after a name of property of a rule - //
// - @rulename {...   property<HERE>:value  ...} - //
rule_property_name_after = &NONE;



// - Whether to remove Symbols after an opening bracket - //
// - And before the first property of rule here so - //
// - @rulename {<&NONE;>property:value  ...} - //
rule_property_value_first_stick = no


// - Whether to close last property of a rule - //
// - Before a closing bracket a semicolon ; - //
// - that - no //
// - @rulename {... property:value<&NONE;>} - //
// - or that - yes //
// - @rulename {... property:value<;>} - //
rule_property_value_last_close = yes


// - To remove superfluous blanks in JS injections CSS - //
rule_property_value_JS_remove_spaces = yes


// - Symbols before value of property of a rule - //
// - @rulename {...   property:<HERE>value  ...} - //
rule_property_value_before = &SPACE;


// - Symbols after value of property of a rule - //
// - @rulename {...   property:value<HERE>  ...} - //
rule_property_value_after = &NONE;


// - Symbols after closing of value of property of a rule - //
// - @rulename {...   property:value;<HERE> ... other-property:other-value ...} - //

rule_property_close = &CRLF;


// - Symbols of tabulation for a space in front of selectors - //
// - If in a code only one rule Media_Screen    - //
selector_in_media_rule_alone_Before = &NONE;


// - Symbols of tabulation for a space in front of selectors - //
// - If in a code it is a lot of rules
// - screen - //
// - print - //
// - e.t.c. - //
selector_in_media_rule_notalone_Before = &TAB;


// - Symbols dividing names of selectors having the general body - //
// - BODY<HERE>TD<HERE>H1 {...} - //
selector_names_divider = ,&SPACE;&CRLF;


// - Symbols after a name of selectors - //
// - BODY, TD, H1<HERE>{...} - //
selector_after_name = &SPACE;


// - Symbols after an opening bracket of selectors - //
// - BODY, TD, H1 {<HERE>...} - //
selector_after_open = &CRLF;


// - Symbols after a closing bracket of selectors - //
// - BODY, TD, H1 {...}<HERE> - //
selector_after_close = &CRLF;&CRLF;


// - Symbols before a name of property of the selector - //
// - BODY, TD, H1 {...  <HERE>property:value ...} - //
selector_property_name_before = &TAB;


// - Symbols after a name of property of the selector - //
// - BODY, TD, H1 {...  property<HERE>:value ...} - //
selector_property_name_after = &NONE;


// - Whether to remove Symbols after an opening bracket - //
// - And before the first property of the selector here so - //
// - BODY, TD, H1 {<&NONE;>property:value  ...} - //
selector_property_value_first_stick = no


// - Whether to close last property of the selector - //
// - Before a closing bracket a semicolon ; - //
// - that - no //
// - BODY, TD, H1 {... property:value<&NONE;>} - //
// - or that - yes //
// - BODY, TD, H1 {... property:value<;>} - //
selector_property_value_last_close = yes


// - To remove superfluous blanks in JS injections CSS - //
selector_property_value_JS_remove_spaces = yes


// - Symbols before value of property of the selector - //
// - @rulename {...   property:<HERE>value  ...} - //
selector_property_value_before = &SPACE;


// - Symbols after value of property of the selector - //
// - @rulename {...   property:value<HERE>  ...} - //
selector_property_value_after = &NONE;


// - Symbols after closing of value of property of the selector - //
// - @rulename {...   property:value;<HERE> ... other-
selector_property_close = &CRLF;


//////////////////////////////////
// Options of height of letters //
//////////////////////////////////

// - Such elements as, ID, classes, TAGS and colours 
// - submit to rules of change of the register. 
// - Uncontrollable comments, and names of rules they 
// - at present are there are in own register without 
// - changes, names of properties and value of properties, 
// - except colours, are translated in the bottom register 
// - and too do not cope from a template.

// - SELF | LOWER | UPPER                      - //
// - SELF : To leave height of letters without changes - //
// - LOWER : To translate in the lower case    - //
// - UPPER : To translate in the upper case    - //


// - Height of Letters of the Name of the selector for the identifier - //
// - #test { ... } - //
Letter_Case_ID = SELF


// - Height of Letters of the Name of the selector for a class - //
// - .test { ... } - //
Letter_Case_Class = SELF


// - Height of Letters of the Name of the selector for a tag - //
// - B, I, U { ... } - //
Letter_Case_Tag = UPPER


// - Height of Letters of Colours - //
// - color: #ABCDEF; - //
Letter_Case_Colors = UPPER


// - Admissible Percent of Coincidence of Colour - //
// - From initial at quantization - //
// - If the percent of coincidence below this parametre, - //
// - colour is not transformed - //
Color_Loss_Precision_Transform_Quality = 100
5. How the quality of quantization is determined? about Accurate cascade style scheets «Easy Neatly»

Now we will talk from last parametre of a pattern

// - Admissible Percent of Coincidence of Colour - //
Color_Loss_Precision_Transform_Quality = 100

Some parameter of rejection of current colour from, quantized, here is meant At which the quantized colour is rather close to a pre-image and the quantization will be produced, I.e. the colour of a format #RRGGBB will be transformed into colour of a format #RGB. If the residual of current and quantized colour will appear more specific threshold, The colour remain not quantized, i.e. long 7 numerals of a format #RRGGBB.

It is a little words, how the given gear works. Let`s take for an example two ideal - quantized of colour on one axis, For example red #AA and #BB. If to devide a section between these colours, That will be received 18 points, including this colour.

#AA, #AB, #AC, #AD, #AE, #AF, #B0, #B1, #B2,
#B3, #B4, #B5, #B6, #B7, #B8, #B9, #BA, #BB

From colour #BB up on a dial there is a colour #CC. And between #BB and #СС also 18 points including them. At an interpolation - quantization of colour the imperfect colour is transformed to that, which ideal from, It will defend is not more white than on 8 points on a colour axis. I.e. for example colour #AF, Will be transformed into colour #AA. And #B3 in colour #BB. Let`s name these 8 points as a maximum radius of acquisition Ideal colour.

And now as applied parameter of a template of quantization, assigning quality. So here this parameter sets a controlled radius of acquisition of colour in percentage From maximum, for example 75%. If the colour will leave for limits of this radius of acquisition, It will not be quantized, as we consider, that such quantized colour too Is not similar to a pre-image and we leave it, "as is", i.e. by ourselves.

In the file of templates the numeral of % for this parameter does not need to be indicated.