Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kentnl/minecraft-sectionfilter
Strip/Process magical § characters from minecraft
https://github.com/kentnl/minecraft-sectionfilter
Last synced: 4 days ago
JSON representation
Strip/Process magical § characters from minecraft
- Host: GitHub
- URL: https://github.com/kentnl/minecraft-sectionfilter
- Owner: kentnl
- License: other
- Created: 2013-03-30T18:48:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-03-10T09:08:09.000Z (over 7 years ago)
- Last Synced: 2023-08-20T22:14:40.408Z (about 1 year ago)
- Language: Perl
- Size: 115 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Minecraft::SectionFilter - Strip/Process magical § characters from minecraft
# VERSION
version 0.003004
# SYNOPSIS
use Minecraft::SectionFilter;
while(<$some_stream_of_text>){
if( $ENV{MODE} eq 'STRIP' ) {
print(strip_sections($_))
}
else {
print(ansi_encode_sections($_));
}
}# FUNCTIONS
## translate\_sections
Parse a string into a series of elements;
my (@list) = translate_sections($string)
Resulting list will be a list of hashrefs, either:
{ type => text , content => "the string itself" }
or
{ type => section, section_code => $char }
## strip\_sections
Strip section codes from a string.
my $output = strip_sections( $input );
## ansi\_encode\_sections
Translate section codes to Term::ANSIColor color codes.
STDOUT->print( ansi_encode_sections( $minecraft_string ) );
# SEE ALSO
[Minecraft::RCON](https://metacpan.org/pod/Minecraft::RCON) which has a similar feature, except its not user-acessible/reusable.
# AUTHOR
Kent Fredric
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric .
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.