Subversion Repositories wimsdev

Rev

Rev 11176 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #!/usr/bin/perl
  2. ## create the file public_html/bases/sys/css_classes from the css of public_html/themes/standard
  3. ## use in documentation
  4. use warnings;
  5. use strict;
  6. #use Text::Balanced qw (extract_bracketed extract_tagged);
  7.  
  8. $/ = undef;
  9.  
  10. my $dir="public_html/themes/standard";
  11. my $outfile="public_html/bases/sys/css_classes" ;
  12. my $TEXT="generated by bin/css.pl - do not change by hand \n" ;
  13. for (glob("$dir/*.css")) {
  14.   $TEXT  .= "\n\n\n/*generated from file : $_ */\n" ;
  15.   open(IN, $_) ;
  16.   my $text = <IN>; close(IN);
  17.   $text =~ s/\n\t+//g ;
  18.   $text =~ s/\n}/}/g ;
  19.   $text =~ s/{[^{]+}/{ }/g ;
  20.   $text =~ s/{ }(.)/{ }\n$1/g ;
  21.   $TEXT .= "\n$text" ;
  22. }
  23.  
  24. out($outfile, $TEXT) ;
  25.  
  26.  
  27. sub out { my ($bloc, $text) = @_;
  28.   open  (OUT, ">$bloc") ;
  29.   print OUT $text ; close OUT;
  30. }