package DataProcessorPlugin;
-
-use strict;
-use warnings; no warnings qw(experimental::signatures);
-
-use feature qw(signatures);
-use Scalar::Util qw(looks_like_number);
-use Clone qw(clone);
+use PluginBase;
use Date::Manip;
-use Syntax::Keyword::Try;
-use Exception::Class ('PluginException');
-
use constant VERSION => '1.0';
sub new ($class, $plugin){
package DataProcessorWorldCitiesPlugin;
-
-use strict;
-use warnings; no warnings "once";
-
-use feature qw(signatures);
-use Scalar::Util qw(looks_like_number);
-
+use PluginBase;
# @Deprecated Plugin not needed anymore in script.
sub new ($class,$plugin){
return bless {}, $class
# It also from script provided values to convert as data to basic CNF value types. Which can be meta directives.
# This operate the premise of an column mapping functionality also, as a mapping via the CNF TREE instruction.
# For speed direct here direct array referencing in a modal automation algorithmic approach is used.
-# It implements also atomic's heavily like CNFData table header and CNFMeta for varios possible operations.
+# It implements also atomic's heavily like CNFData table header and CNFMeta for various possible operations.
###
package DatabaseCentralPlugin;
-
-use strict;
-use warnings; no warnings qw(experimental::signatures); no warnings 'once';
-
-use feature qw(signatures);
+use PluginBase;
+use Exception::Class ('DBCentralPluginException');
use Time::Piece;
use DBI;
-use Syntax::Keyword::Try;
-use Exception::Class ('DBCentralPluginException');
-use Clone qw(clone);
use Date::Manip;
-use Scalar::Util qw(looks_like_number);
require CNFDateTime;
require CNFMeta;
package GenericInstructionHandler;
-
-use strict;
-use warnings; no warnings qw(experimental::signatures);
-use feature qw(signatures);
+use PluginBase;
sub new {my ($class, $args) = @_;
bless $args, $class;
package HTMLIndexProcessorPlugin;
-
-use strict;
-use warnings;
-no warnings qw(experimental::signatures);
-use Syntax::Keyword::Try;
+use PluginBase;
use Exception::Class ('HTMLIndexProcessorPluginException');
-use feature qw(signatures);
-use Scalar::Util qw(looks_like_number);
-use Clone qw(clone);
+
use CGI;
use CGI::Session '-ip_match';
use constant VERSION => '1.0';
-our $TAB = ' 'x4;
sub new ($class, $plugin){
my $settings;
my $cgi_action = $cgi-> param('action');
my $cgi_doc = $cgi-> param('doc');
my $tree = $parser-> anon($property);
- die "Tree property '$property' is not available!" if(!$tree or ref($tree) ne 'CNFNode');
+ die "Tree property '$property' is not available! Parser <pre> ->\n".dumpParser($parser)."\n</pre>\n"
+ if(!$tree or ref($tree) ne 'CNFNode');
try{
}
$parser->data()->{$property} = \$buffer;
}catch($e){
- HTMLIndexProcessorPluginException->throw(error=>$e ,show_trace=>1);
+ HTMLIndexProcessorPluginException->throw(error=>$e, show_trace=>1);
}
}
-#
+
+sub dumpParser($parser){
+ my $ret = $parser ->writeOut();
+ $ret =~ s/</>/g;
+ $ret =~ s/>/</g;
+ return $ret
+}
+
+###
sub loadDocument($parser, $doc) {
my $slurp = do {
open my $fh, '<:encoding(UTF-8)', $doc or HTMLIndexProcessorPluginException->throw("Document not avaliable: $doc");
###
-# HTML converter Plugin from PerlCNF to HTML from TREE instucted properties.
+# HTML converter Plugin from PerlCNF to HTML from TREE instructed properties.
# Processing of these is placed in the data parsers data.
###
package HTMLProcessorPlugin;
-
-use strict;
-use warnings;
-use Syntax::Keyword::Try;
+use PluginBase;
use Exception::Class ('HTMLProcessorPluginException');
-use feature qw(signatures);
-use Scalar::Util qw(looks_like_number);
-use Clone qw(clone);
use constant VERSION => '1.0';
# Processing of these is placed in the data parsers data.
#
package MarkdownPlugin;
-
-use strict;
-use warnings;
-no warnings qw(experimental::signatures);
-use Syntax::Keyword::Try;
+use PluginBase;
use Exception::Class ('MarkdownPluginException');
-use feature qw(signatures);
-use Clone qw(clone);
##no critic ControlStructures::ProhibitMutatingListFunctions
use constant VERSION => '1.1';
-our $TAB = ' 'x4;
###
# Constances for CSS CNF tag parts. See end of this file for package internal provided defaults CSS.
$script = $item->{val};
$escaped = $item->{ins} eq 'ESCAPED'
}elsif($script !~ /\n/ and -e $script ){
- my $file = $parser->anon($property);
- $script = do {
+ my $file = $parser->anon($property);
+ $script = do {
open my $fh, '<:encoding(UTF-8)', $script or MarkdownPluginException->throw("File not available: $script");
local $/;
<$fh>;
- };
+ };
}
if($escaped){
$script =~ s/\\</</gs;
my @titles;my $code = 0; my ($tag, $class); my $pml_val = 0; my ($bqte, $bqte_nested,$bqte_tag);
$script =~ s/^\s*|\s*$//;
foreach my $ln(split(/\n/,$script)){
- $ln =~ s/\t/$TAB/gs; $lnc++;
+ $ln =~ s/\t/$PluginBase::TAB/gs; $lnc++;
if($ln =~ /(.*) `{3}(\w*)\s*(.*)`{3} (.*)/gx){
my $pret = ""; $pret = $1 if $1;
my $post = ""; $post = $4 if $4;
--- /dev/null
+package PluginBase;
+use v5.36;
+use strict;
+use warnings;
+use Syntax::Keyword::Try;
+use feature qw(signatures);
+use Scalar::Util qw(looks_like_number);
+use Clone qw(clone);
+use Module::Load;
+use Exception::Class ('PluginException');
+
+
+require Exporter;
+
+our $TAB = ' 'x4;
+our @ISA = qw(Exporter);
+our @EXPORT = qw($TAB);
+
+use Carp qw(confess);
+BEGIN {
+ $SIG{'__DIE__'} = sub { confess(@_) };
+}
+
+
+sub import {
+
+
+ feature->import(':5.36');
+ feature->import('signatures');
+ warnings->import;
+ warnings->unimport('once');
+ strict->import;
+ Syntax::Keyword::Try->import;
+ Module::Load->import;
+ Carp->import('confess');
+ Exception::Class->import('PluginException');
+
+
+ my $caller = caller(0);
+
+ do {
+ no strict 'refs';
+ *{"$caller\:\:clone"} = *{"Clone\:\:clone"};
+ *{"$caller\:\:looks_like_number"} = *{"Scalar\:\:Util\:\:looks_like_number"};
+ };
+
+
+}
+
+
+
+1;
+
+=begin copyright
+Programed by : Will Budić
+EContactHash : 990MWWLWM8C2MI8K (https://github.com/wbudic/EContactHash.md)
+Source : git clone git://lifelog.hopto.org/PerlCNF
+ : https://github.com/wbudic/PerlCNF.git
+Documentation : Specifications_For_CNF_ReadMe.md
+ This source file is copied and usually placed in a local directory, outside of its repository project.
+ So it could not be the actual or current version, can vary or has been modified for what ever purpose in another project.
+ Please leave source of origin in this file for future references.
+Open Source Code License -> https://github.com/wbudic/PerlCNF/blob/master/ISC_License.md
+=cut copyright
\ No newline at end of file
]row]
>>));
+
+
my $plugin = HTMLProcessorPlugin -> new({Language=>'English',DateFormat=>'AU'}) -> convert($parser, 'test1');
my $html = $parser->data()->{'test1'};
my $tree = $parser->anon('test1');