-
-
20 Jun 2021 12:25:24 UTC
- Distribution: CSS-Struct
- Module version: 0.05
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (1074 / 0 / 0)
- Kwalitee
Bus factor: 1- 100.00% Coverage
- License: bsd
- Activity
24 month- Tools
- Download (31.82KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Class::Utils
- Error::Pure
- List::MoreUtils
- Readonly
- Scalar::Util
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
CSS::Struct::Output::Raw - Raw printing 'CSS::Struct' structure to CSS code.
SYNOPSIS
use CSS::Struct::Output::Raw; my $css = CSS::Struct::Output::Raw->new(%parameters); my $ret_or_undef = $css->flush($reset_flag); $css->put(@data); $css->reset;
METHODS
new
my $css = CSS::Struct::Output::Raw->new(%parameters);
Constructor.
Returns instance of object.
auto_flush
Auto flush flag. Default is 0.
comment_delimeters
Reference to array with begin and end comment delimeter. Default value is ['/*', '*/']. Possible values are: - ['/*', '*/'] - ['<!--', '-->'],
output_handler
Handler for print output strings. Must be a GLOB. Default is undef.
skip_bad_types
Flag, that means bad 'CSS::Struct' types skipping. Default value is 0.
skip_comments
Flag, that means comment skipping. Default value is 0.
flush
my $ret_or_undef = $css->flush($reset_flag);
Flush CSS structure in object. If defined 'output_handler' flush to its. Or return CSS. If enabled $reset_flag, then resets internal variables via reset method.
Returns CSS string or undef.
put
$css->put(@data);
Put CSS structure in format specified in CSS::Struct.
Returns undef.
reset
$css->reset;
Resets internal variables.
Returns undef.
ERRORS
From CSS::Struct::Output: Auto-flush can't use without output handler. Bad comment delimeters. Bad data. Bad number of arguments. ('CSS::Struct' structure array), Bad type of data. Cannot write to output handler. No opened selector. Output handler is bad file handler. Unknown parameter '%s'.
EXAMPLE
use strict; use warnings; use CSS::Struct::Output::Raw; my $css = CSS::Struct::Output::Raw->new( 'output_handler' => \*STDOUT, ); $css->put(['c', 'comment']); $css->put(['a', '@charset', 'utf-8']); $css->put(['s', 'selector#id']); $css->put(['s', 'div div']); $css->put(['s', '.class']); $css->put(['d', 'weight', '100px']); $css->put(['d', 'font-size', '10em']); $css->put(['e']); $css->put(['r', "\n"]); $css->flush; # Output: # /*comment*/@charset "utf-8";selector#id,div div,.class{weight:100px;font-size:10em;}
DEPENDENCIES
CSS::Struct::Output, Readonly.
SEE ALSO
- CSS::Struct
-
Struct oriented CSS manipulation.
- CSS::Struct::Output
-
Base class for CSS::Struct::Output::*.
- CSS::Struct::Output::Indent
-
Indent printing 'CSS::Struct' structure to CSS code.
AUTHOR
Michal Josef Špaček mailto:skim@cpan.org
LICENSE AND COPYRIGHT
© 2007-2021 Michal Josef Špaček
BSD 2-Clause License
VERSION
0.05
Module Install Instructions
To install CSS::Struct, copy and paste the appropriate command in to your terminal.
cpanm CSS::Struct
perl -MCPAN -e shell install CSS::Struct
For more information on module installation, please visit the detailed CPAN module installation guide.