#!/usr/bin/perl
## create the file public_html/bases/sys/css_classes from the css of public_html/themes/standard
## use in documentation
use warnings;
use strict;
#use Text::Balanced qw (extract_bracketed extract_tagged);

my $dir="public_html/themes/_css";
my $outfile="public_html/bases/sys/css_classes";
my $TEXT=" ";###generated by bin/css.pl - do not change by hand \n;
my $file='utilities.css' ;
##$TEXT  .= "\n!!generated from file : $file\n";
my $text=treate_file("$dir/$file");
$TEXT .= "\n$text";
out($outfile, $TEXT) ;

sub treate_file { my ($file)=@_;
  my $test=0; my $text="";
  open(IN, $file) ;
  while(<IN>) {
    my $line = $_;
    next if !($line =~ /\/*\s*@/) ;
    $line =~ s,\/\*\s*@,,g ;
    $line =~ s,\*\/,,g ;
    $text .= $line ;
  }
  close(IN);
  $text
}
sub out { my ($bloc, $text) = @_;
  open  (OUT, ">$bloc") ;
  print OUT $text ; close OUT;
}
