Last active
September 18, 2017 14:25
-
-
Save kwakwaversal/b85ebbb8ca831fee300b5da140d05362 to your computer and use it in GitHub Desktop.
Mojolicious one-liner. Ideal for checking the POD for your Perl apps or libraries. Starts a web server with `/perldoc` links for all of the files in the `lib` folder relative to your current `pwd`. #mojo #perl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Mojolicious one-liner. Ideal for checking the POD for your Perl apps or | |
# libraries. | |
# | |
# Starts a web server with `/perldoc` links for all of the files in the `lib` | |
# folder relative to your current `pwd`. | |
# | |
# The POD documentation for the linked file will only display if it's included | |
# in the file. If it isn't, it will redirect to `metacpan.org` to try and find | |
# the POD there. | |
perl -Ilib -Mojo -E 'plugin "PODRenderer"; a( "/" => { inline => qq!%= app->home->child("lib")->list_tree({hidden => 1})->sort->map(sub { link_to \$_->to_rel("lib") => url_for("perldocmodule" => {module => \$_->to_rel("lib")->dirname . "/" . \$_->basename(".pm") }) })->join("<br>")! } )->start' daemon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment