package Wiki::JSON;
use v5.16.3;
use strict;
use warnings;
use Moo;
use Data::Dumper;
use Const::Fast;
use Wiki::JSON::Parser;
use Wiki::JSON::HTML;
our $VERSION = "0.0.31";
const my $MAX_HX_SIZE
tions]';
}
my ( $self, $wiki_text, $options ) = @_;
$options //= {};
return Wiki::JSON::Parser->new->parse($wiki_text, $options);
}
sub pre_html {
my ($self, $wiki_text, $template
turn Wiki::JSON::HTML->new->pre_html_json($wiki_text, $template_callbacks);
}
1;
=encoding utf8
=head1 NAME
Wiki::JSON - Parse wiki-like articles to a data-structure transformable to JSON.
=head1
package Wiki::JSON::HTML;
use v5.16.3;
use strict;
use warnings;
use Moo;
use Mojo::Util qw/xml_escape/;
use Mojo::URL;
has _wiki_json => ( is => 'lazy' );
sub pre_html_json {
my ( $self, $wi
);
my $json =
$self->_wiki_json->parse( $wiki_text, { track_lines_for_errors => 1 } );
# print Data::Dumper::Dumper $json;
push @dom, @{ $self->_parse_output( $json, $template_
html_element('article');
return \@dom;
}
sub _build__wiki_json {
my $self = shift;
require Wiki::JSON;
return Wiki::JSON->new;
}
sub _open_html_element {
if ( @_ < 2 ) {
package Wiki::JSON::Contributing;
use v5.16.3;
use strict;
use warnings;
1;
=encoding utf8
=head1 WAYS TO CONTRIBUTE
=head2 REPORTING BUGS
If you think some behavior is undesired you can use the
Github repository L<https://github.com/sergiotarxz/Perl-Wiki-JSON> to report it
in the issues tab.
This should be enough, but if you really want to ensure I understand you ideally you could write in
se strict;
use warnings;
use lib 'lib';
use Test::Most;
use_ok 'Wiki::JSON';
{
my $parsed = Wiki::JSON->new->parse(
q(= This is a wiki title =
'''This is bold'''
''This is
package Wiki::JSON::Parser;
use v5.16.3;
use strict;
use warnings;
use Moo;
use Data::Dumper;
use Const::Fast;
const my $MAX_HX_SIZE => 6;
const my $EXTRA
coding utf8
=head1 NAME
Wiki::JSON - Parse wiki-like articles to a data-structure transformable to JSON.
=head1 SYNOPSIS
use Wiki::JSON;
my $structure = Wiki::JSON->new->parse(<<'EOF');
= This is
iki-JSON.git
=head2 USING AS A COMMAND
wiki2json file.wiki > output.json
=head1 INSTANCE METHODS
=head2 new
my $wiki_parser = Wiki::JSON->ne