Skip to content

Commit

Permalink
Merge b085c12 into a74523d
Browse files Browse the repository at this point in the history
  • Loading branch information
gflohr committed Oct 17, 2023
2 parents a74523d + b085c12 commit aee783a
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 96 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci-quick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ jobs:
cd .. &&
perl -MFile::Path -e "exit not File::Path::rmtree('JavaScript-Duktape-XS')"
- name: 'Install Text::Markdown::Discount for MS-DOS'
if: matrix.os == 'windows-latest'
run: |
git clone https://github.com/gflohr/text-markdown-discount &&
cd text-markdown-discount &&
cpanm --notest --verbose . &&
cd .. &&
perl -MFile::Path -e "exit not File::Path::rmtree('text-markdown-discount')"
- name: 'Install other dependencies'
run: cpanm --notest --installdeps --verbose .

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ jobs:
cd .. &&
perl -MFile::Path -e "exit not File::Path::rmtree('JavaScript-Duktape-XS')"
- name: 'Install Text::Markdown::Discount for MS-DOS'
if: matrix.os == 'windows-latest'
run: |
git clone https://github.com/gflohr/text-markdown-discount &&
cd text-markdown-discount &&
cpanm --notest --verbose . &&
cd .. &&
perl -MFile::Path -e "exit not File::Path::rmtree('text-markdown-discount')"
- name: 'Installing other dependencies'
run: cpanm --notest --installdeps --verbose .

Expand Down
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* The name of the configuration file is now "_qgoda.yaml", "_qgoda.yml",
or "_qgoda.json"!
* Likewise, "_localconfig.*" is now "_localqgoda.*".
* Hoedown has been replaced with Markdown. Please update your config
files!
- Broken watch mode fixed (GitHub issue #108).
- Various improvements to the schema.
- Most recent schema is always available online at
Expand Down
5 changes: 4 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ lib/Qgoda/PluginUtils.pm
lib/Qgoda/PostProcessor.pm
lib/Qgoda/Processor.pm
lib/Qgoda/Processor/HTMLFilter.pm
lib/Qgoda/Processor/Hoedown.pm
lib/Qgoda/Processor/Markdown.pm
lib/Qgoda/Processor/Strip.pm
lib/Qgoda/Processor/TT2.pm
Expand Down Expand Up @@ -110,9 +109,11 @@ t/config-invalid.t
t/config-private-invalid.t
t/config-private-valid.t
t/config-round-trip.t
t/content-body.t
t/default-view.t
t/deptracker.t
t/encode_json.t
t/excerpt.t
t/flatten2hash.t
t/helpers.t
t/interpolate.t
Expand Down Expand Up @@ -142,10 +143,12 @@ t/tpq-include.t
t/tpq-links.t
t/tpq-listings.t
t/tpq-misc.t
t/tpq-qgoda-schema.t
t/tpq-related.t
t/tpq-sort-by.t
t/tpq-strftime.t
t/tpq-taxonomies.t
t/tpq-to-json.t
t/tpq-vmethods.t
t/tpq-xref.t
t/tt2-args-merge.t
Expand Down
4 changes: 2 additions & 2 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"AnyEvent::Filesys::Watcher" : "0",
"AnyEvent::Handle" : "0",
"AnyEvent::Loop" : "0",
"AnyEvent::Util" : "0",
"Archive::Extract" : "0",
"Cpanel::JSON::XS" : "0",
"Cwd" : "0",
Expand Down Expand Up @@ -87,8 +88,7 @@
"Template::Provider" : "0",
"Template::Stash" : "0",
"Term::ANSIColor" : "0",
"Text::Markdown" : "0",
"Text::Markdown::Hoedown" : "0",
"Text::Markdown::Discount" : "0",
"Text::Unidecode" : "0",
"Time::HiRes" : "0",
"URI" : "0",
Expand Down
4 changes: 2 additions & 2 deletions META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ requires:
AnyEvent::Filesys::Watcher: '0'
AnyEvent::Handle: '0'
AnyEvent::Loop: '0'
AnyEvent::Util: '0'
Archive::Extract: '0'
Cpanel::JSON::XS: '0'
Cwd: '0'
Expand Down Expand Up @@ -81,8 +82,7 @@ requires:
Template::Provider: '0'
Template::Stash: '0'
Term::ANSIColor: '0'
Text::Markdown: '0'
Text::Markdown::Hoedown: '0'
Text::Markdown::Discount: '0'
Text::Unidecode: '0'
Time::HiRes: '0'
URI: '0'
Expand Down
12 changes: 8 additions & 4 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ my %WriteMakefileArgs = (
"AnyEvent::Filesys::Watcher" => 0,
"AnyEvent::Handle" => 0,
"AnyEvent::Loop" => 0,
"AnyEvent::Util" => 0,
"Archive::Extract" => 0,
"Cpanel::JSON::XS" => 0,
"Cwd" => 0,
Expand Down Expand Up @@ -239,8 +240,7 @@ my %WriteMakefileArgs = (
"Template::Provider" => 0,
"Template::Stash" => 0,
"Term::ANSIColor" => 0,
"Text::Markdown" => 0,
"Text::Markdown::Hoedown" => 0,
"Text::Markdown::Discount" => 0,
"Text::Unidecode" => 0,
"Time::HiRes" => 0,
"URI" => 0,
Expand Down Expand Up @@ -281,6 +281,7 @@ my %FallbackPrereqs = (
"AnyEvent::Filesys::Watcher" => 0,
"AnyEvent::Handle" => 0,
"AnyEvent::Loop" => 0,
"AnyEvent::Util" => 0,
"Archive::Extract" => 0,
"Carp" => 0,
"Cpanel::JSON::XS" => 0,
Expand Down Expand Up @@ -340,8 +341,7 @@ my %FallbackPrereqs = (
"Template::Stash" => 0,
"Term::ANSIColor" => 0,
"Test::More" => 0,
"Text::Markdown" => 0,
"Text::Markdown::Hoedown" => 0,
"Text::Markdown::Discount" => 0,
"Text::Unidecode" => 0,
"Time::HiRes" => 0,
"Time::Local" => 0,
Expand Down Expand Up @@ -387,4 +387,8 @@ if ( $^O =~ /bsd/i ) {
$WriteMakefileArgs{PREREQ_PM}{'IO::KQueue'} = $FallbackPrereqs{'IO::KQueue'} = '0.34';
}

if ( $^O eq 'Win32' ) {
$WriteMakefileArgs{PREREQ_PM}{'Win32::Process'} = $FallbackPrereqs{'Win32::Process'} = '0';
}

WriteMakefile(%WriteMakefileArgs);
3 changes: 3 additions & 0 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ tag_format = %v
skip = ^Linux::Inotify2$
skip = ^Mac::FSEvents$
skip = ^IO::KQueue$
skip = ^Win32::Process$
[Prereqs]
perl = 5.018
URI::git = 0.02
Expand All @@ -71,6 +72,8 @@ Linux::Inotify2 = 1.22
Mac::FSEvents = 0.14
[OSPrereqs/~bsd]
IO::KQueue = 0.34
[OSPrereqs/Win32]
Win32::Process = 0
[MetaJSON]
[MinimumPerlFast]
[MetaResources]
Expand Down
18 changes: 3 additions & 15 deletions lib/Qgoda/Command/Markdown.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ use Qgoda::Util qw(read_file);

use base 'Qgoda::Command';

sub _getDefaults { processor => 'Markdown' }

sub _getOptionSpecs {
processor => 'processor=s'
}

sub _run {
my ($self, $args, $global_options, %options) = @_;

Expand All @@ -51,10 +45,10 @@ sub _run {
$global_options->{log_stderr} = 1;

my $q = Qgoda->new($global_options);
my ($processor) = $q->_getProcessors($options{processor});
my ($processor) = $q->_getProcessors('Markdown');
if (!$processor) {
die __x("error instantiating processor '{processor}'.\n",
processor => $options{processor});
processor => 'Markdown');
}

foreach my $arg (@$args) {
Expand Down Expand Up @@ -110,12 +104,6 @@ in use within Qgoda.
=over 4
=item -p, --processor=<processor>
Specify the Markdown processor to use, defaults to 'Markdown' which uses
L<Text::Markdown> for rendering. The other option is 'Hoedown' if
L<Text::Markdown::Hoedown> is installed.
=item -h --help
Show this help page and exit.
Expand All @@ -124,7 +112,7 @@ Show this help page and exit.
=head1 SEE ALSO
L<Text::Markdown>(3pm), L<Text::Markdown::Hoedown>(3pm), qgoda(1), perl(1)
L<Text::Markdown::Discount>(3pm), qgoda(1), perl(1)
=head1 QGODA
Expand Down
52 changes: 0 additions & 52 deletions lib/Qgoda/Processor/Hoedown.pm

This file was deleted.

6 changes: 5 additions & 1 deletion lib/Qgoda/Processor/Markdown.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ use strict;

use base qw(Qgoda::Processor);

use Text::Markdown qw(markdown);
use Text::Markdown::Discount qw(markdown);

BEGIN {
Text::Markdown::Discount::with_html5_tags();
}

sub new {
my ($class, %options) = @_;
Expand Down
2 changes: 0 additions & 2 deletions lib/Qgoda/Processor/Strip.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ use strict;

use base qw(Qgoda::Processor);

use Text::Markdown::Hoedown qw(markdown);

sub new {
my ($class, %options) = @_;

Expand Down
22 changes: 11 additions & 11 deletions t/tpq-anchor.t
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ like $anchor_en_content,
qr{<p>lexistsAnchorPost: <a href="/en/greeting/">English Greeting</a></p>},
'lexistsAnchorPost en';
like $anchor_en_content,
qr{<p>existsAnchor broken: </p>},
qr{<p>existsAnchor broken: *</p>},
'existsAnchor broken en';
like $anchor_en_content,
qr{<p>lexistsAnchor broken: </p>},
qr{<p>lexistsAnchor broken: *</p>},
'lexistsAnchor broken en';
like $anchor_en_content,
qr{<p>existsAnchorPost broken: </p>},
qr{<p>existsAnchorPost broken: *</p>},
'existsAnchorPost broken en';
like $anchor_en_content,
qr{<p>lexistsAnchorPost broken: </p>},
qr{<p>lexistsAnchorPost broken: *</p>},
'lexistsAnchorPost broken en';
like $anchor_en_content,
qr{<p>broken anchor: </p>},
qr{<p>broken anchor: *</p>},
'broken anchor en';
like $anchor_en_content,
qr{<p>ambiguous anchor: <a href="[^"]+">.+</p>},
Expand All @@ -182,7 +182,7 @@ like $anchor_en_content,
ok -e './_site/de/anchor/index.html';
my $anchor_de_content = read_file './_site/de/anchor/index.html';
Encode::_utf8_on($anchor_de_content);
like $anchor_de_content,
like $anchor_de_content,
qr{<p>anchor: <a href="/de/ueber/">Über diese Site</a></p>},
'anchor de';
like $anchor_de_content,
Expand All @@ -207,19 +207,19 @@ like $anchor_de_content,
qr{<p>lexistsAnchorPost: <a href="/de/begruessung/">Deutsche Begrüßung</a></p>},
'lexistsAnchorPost de';
like $anchor_de_content,
qr{<p>existsAnchor broken: </p>},
qr{<p>existsAnchor broken: *</p>},
'existsAnchor broken de';
like $anchor_de_content,
qr{<p>lexistsAnchor broken: </p>},
qr{<p>lexistsAnchor broken: *</p>},
'lexistsAnchor broken de';
like $anchor_de_content,
qr{<p>existsAnchorPost broken: </p>},
qr{<p>existsAnchorPost broken: *</p>},
'existsAnchorPost broken de';
like $anchor_de_content,
qr{<p>lexistsAnchorPost broken: </p>},
qr{<p>lexistsAnchorPost broken: *</p>},
'lexistsAnchorPost broken de';
like $anchor_de_content,
qr{<p>broken anchor: </p>},
qr{<p>broken anchor: *</p>},
'broken anchor de';
like $anchor_de_content,
qr{<p>ambiguous anchor: <a href="[^"]+">.+</p>},
Expand Down
4 changes: 2 additions & 2 deletions t/tpq-links.t
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ like $links_en_content, qr{<p>existsLink: /en/about/</p>}, 'existsLink';
like $links_en_content, qr{<p>existsLinkPost: /en/greeting/</p>}, 'existsLinkPost';
like $links_en_content, qr{<p>lexistsLink: /en/about/</p>}, 'lexistsLink';
like $links_en_content, qr{<p>lexistsLinkPost: /en/greeting/</p>}, 'lexistsLinkPost';
like $links_en_content, qr{<p>broken link: </p>}, 'broken link';
like $links_en_content, qr{<p>broken link: *</p>}, 'broken link';
like $links_en_content, qr{<p>ambiguous link: /en/[a-z]+/</p>}, 'ambiguous link';

ok -e './_site/de/links/index.html';
Expand All @@ -149,7 +149,7 @@ like $links_de_content, qr{<p>existsLink: /de/ueber/</p>}, 'existsLink';
like $links_de_content, qr{<p>existsLinkPost: /de/begruessung/</p>}, 'existsLinkPost';
like $links_de_content, qr{<p>lexistsLink: /de/ueber/</p>}, 'lexistsLink';
like $links_de_content, qr{<p>lexistsLinkPost: /de/begruessung/</p>}, 'lexistsLinkPost';
like $links_de_content, qr{<p>broken link: </p>}, 'broken link';
like $links_de_content, qr{<p>broken link:*</p>}, 'broken link';
like $links_de_content, qr{<p>ambiguous link: /de/[a-z]+/</p>}, 'ambiguous link';

$site->tearDown;
Expand Down
8 changes: 4 additions & 4 deletions t/tpq-xref.t
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ like $xref_en_content, qr{<p>existsXref: About This Site</p>}, 'existsXref en';
like $xref_en_content, qr{<p>lexistsXref: About This Site</p>}, 'lexistsXref en';
like $xref_en_content, qr{<p>existsXrefPost: English Greeting</p>}, 'existsXrefPost en';
like $xref_en_content, qr{<p>lexistsXrefPost: English Greeting</p>}, 'lexistsXrefPost en';
like $xref_en_content, qr{<p>broken xref: </p>}, 'broken xref en';
like $xref_en_content, qr{<p>non-existing xref: </p>}, 'non-existing xref en';
like $xref_en_content, qr{<p>broken xref: *</p>}, 'broken xref en';
like $xref_en_content, qr{<p>non-existing xref: *</p>}, 'non-existing xref en';
like $xref_en_content, qr{<p>ambiguous xref:[^<]+</p>}, 'ambiguous xref en';

ok -e './_site/de/xref/index.html';
Expand All @@ -149,12 +149,12 @@ like $xref_de_content, qr{<p>xref: Über diese Site</p>}, 'xref de';
like $xref_de_content, qr{<p>lxref: Über diese Site</p>}, 'lxref de';
like $xref_de_content, qr{<p>xrefPost: Deutsche Begrüßung</p>}, 'xrefPost de';
like $xref_de_content, qr{<p>lxrefPost: Deutsche Begrüßung</p>}, 'lxrefPost de';
like $xref_de_content, qr{<p>broken xref: </p>}, 'broken xref de';
like $xref_de_content, qr{<p>broken xref: *</p>}, 'broken xref de';
like $xref_de_content, qr{<p>existsXref: Über diese Site</p>}, 'existsXref de';
like $xref_de_content, qr{<p>lexistsXref: Über diese Site</p>}, 'lexistsXref de';
like $xref_de_content, qr{<p>existsXrefPost: Deutsche Begrüßung</p>}, 'existsXrefPost de';
like $xref_de_content, qr{<p>lexistsXrefPost: Deutsche Begrüßung</p>}, 'lexistsXrefPost de';
like $xref_de_content, qr{<p>non-existing xref: </p>}, 'non-existing xref de';
like $xref_de_content, qr{<p>non-existing xref: *</p>}, 'non-existing xref de';
like $xref_de_content, qr{<p>ambiguous xref:[^<]+</p>}, 'ambiguous xref de';

$site->tearDown;
Expand Down

0 comments on commit aee783a

Please sign in to comment.