Category: C#/Command-line
Last update: 2019-12-28Support: NANY 2020 thread

Version:Description: - December 2019Cleanup code, added this documentation, prepare for NANY 2020 release - November 2019Added enable/disable-lines-start/end processing - October 2019Working as intended - October 2019Initial development

Process SCSS (css preprocessing) @for loops to @each loops including only used classes.

During development we use many generated classes for 'pixel-perfect' alignment of page elements.
(The proprietary platform used doesn't allow for direct html or css tags to be applied on elements, only classes can be applied, and to override previous, platform-standard, css often !important needs to be added to the css.)
Both the template and the generated output are @include'd in the files proveded to the scss compiler, but those from the templated are disabled by using an @if that is defined in the template-output to be false on second evaluation. During development the template-output is a (nearly) empty file.

For a more elaborate description see the included readme file.


-? / --helpShow this help
-q / --quietSuppress output during processing
-v / --verboseShow more info during processing
-x / --extraverboseShow even more info during processing
-p / --pauseWait for a keypress after processing before closing the application
-i / --input (classesfile)Specify the inputfile with the list of classes (1 per line)
-t / --template (templatefile)Specify the templatefile to process
-o / --output (outputfile)Specify the outputfile, always overwritten
When no -i/-t/-o arguments are specified then (classesfile)/(templatefile)/(outputfile) are taken from non-option arguments specified, in this order.
These 3 file arguments are required.

Template markers:

---class (name)a classname or a regex specifying a range of classnames (regex needs to contain at least 1 '(' ).
---replace (what) (replacement)what line-prefix to replace with what replacement content. Only a single word/element is used for the prefix ('@for' in the example) and the rest of the line as the replacement ('@each $i in $$ {' ) where $$ is replaced by the range of postfix-values found matching the classname/regex.
---original (string)the content of the line replaced, is always overwritten by the processor.
---end (name)marks the end of the section to disable if no match for ---class is found. Needs to specify the exact same value as its matching ---class entry.
---enable-next-line [(n)] ---enable-next-lines [(n)]enables the next n lines (default = 1) (unconditional).
---disable-next-line [(n)] ---disable-next-lines [(n)]disables the next n lines (default = 1) (unconditional).
---enable-lines-startstart of a block to enable during processing (unconditional).
---enable-lines-endend of a block to enable during processing (unconditional).
---disable-lines-startstart of a block to disable during processing (unconditional).
---disable-lines-endend of a block to disable during processing (unconditional).

  • Version
  • 11.79 KB File Size
  • December 28, 2019 Release Date
  • n/a Creation Date
  • n/a Requirements