Skip to content

Instantly share code, notes, and snippets.

@kwakwaversal
Last active September 18, 2017 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwakwaversal/b85ebbb8ca831fee300b5da140d05362 to your computer and use it in GitHub Desktop.
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
#!/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