Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Dancer2 Module for Generating HTML from markdown

by 1nickt (Abbot)
on Nov 05, 2018 at 13:46 UTC ( #1225264=note: print w/replies, xml ) Need Help??


in reply to Dancer2 Module for Generating HTML from markdown

Hi, Dancer2 is written with Moo. Part of the impetus for creating Dancer was that Catalyst has too heavy a dependency list, including Moose. Why on earth would you introduce Moose as a dependency in a Dancer2 plugin?


The way forward always starts with a minimal test.
  • Comment on Re: Dancer2 Module for Generating HTML from markdown

Replies are listed 'Best First'.
Re^2: Dancer2 Module for Generating HTML from markdown
by nysus (Vicar) on Nov 05, 2018 at 21:28 UTC

    OK, I dug harder into the Text::Markdown::Hoedown module which uses XS to load some C module that converts markdown to HTML. I was able to figure out how to get it to work with with "fenced" code (code surrounded by a pair to triplet backticks), which is what the GitHub markdown dialect recognizes. I'll release the next version of the module without Markdent, no Moose required.

    Now I can get complaints from people who only like pure perl modules. :)

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

      For those interested, back of the envelope calculations in my head say the Hoedown module converts about 5 times faster than Markdent based on my page load times on uncached content.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

      "Now I can get complaints from people who only like pure perl modules."

      Nah, just from those who don't like having to install Dist::Zilla and a thousand plugins for installation ;)

      ps. I'm not knocking Dist::Zilla, I just personally find that it adds a ton of bloat to more-often-than-not a very small distribution.

        Hi Steve, I think you are suffering from (and spreading) the common misunderstanding that Dist::Zilla is distributed with the distributions it is used to build. Dist::Zilla is simply a distribution-building and -packaging tool, designed for CPAN, and the distributions it builds are simply conformant CPAN distros. No bloat whatsoever, unless you count a dist.ini file that's sometimes left in the distro.

        Here's the entire MANIFEST from Dancer2::Logger::LogAny, which is packaged and distributed with Dist::Zilla:

        # This file was automatically generated by Dist::Zilla::Plugin::Manife +st v6.010. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README.md cpanfile example/README example/app.pl example/config.yml lib/Dancer2/Logger/LogAny.pm t/00-load.t t/config.yml t/logger.t xt/pod-coverage.t
        Installers of this module have no need of Dist::Zilla or its dependencies. (And note that the source repo only has two extra files, a couple of .ini config files.

        (What you may be recalling is the pain a developer can feel when wanting to contribute to a distribution that is packaged with Dist::Zilla, when you have to have it installed to see that your changes lead to a correct build.)

        Hope this helps!



        The way forward always starts with a minimal test.

        You can only pry Dist::Zilla from my cold, dead hands.

        $PM = "Perl Monk's";
        $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
        $nysus = $PM . ' ' . $MCF;
        Click here if you love Perl Monks

Re^2: Dancer2 Module for Generating HTML from markdown
by nysus (Vicar) on Nov 05, 2018 at 15:35 UTC

    The module uses Markdent to parse the markdown files which requires Moose. Converted files are cached so Moose is only called when a file is updated so there is no real performance hit. Although it will require more dependencies, of course. I looked at other options other than Markdent but couldn't find one that supported the GitHub dialect of markdown out of the box.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1225264]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2020-05-31 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (175 votes). Check out past polls.

    Notices?