Maven plugin to generate HTML from Markdown

Writing documentation or user guide isn’t the most interesting part of the software project but it’s still needed to be done and important for the end users. There are many ways to achieve documentation but using Markdown is good way to make it easier. After that you just need to convert it to HTML and as I couldn’t find a suitable Maven plugin to do that nicely I wrote one myself: markdown-page-generator-plugin.

Software developers are a bit lazy to write good and up to date documentation and as I needed to write the API documentation for the web application as separate HTML pages I got to know the issue first hand. I like writing documents but typing the API documentation as static HTML wasn’t very effective or fun. Fortunately it was quite easy to do it with Markdown which allows you to write documentation using an easy-to-read, easy-to-write plain text format which you can then convert to HTML. After that the only problem was to enable easy HTML generation directly from Maven Lifecycle and thus was the “Markdown to HTML Page Generator Maven Plugin” developed.

Markdown to HTML Page Generator Maven Plugin

“Markdown to HTML Page Generator” is a simple Maven Plugin which reads the input directory for Markdown files with .md suffix and outputs HTML files to target directory. There are couple of configuration options to set the input/output directories and if you want to add header and footer files to make it structurally valid HTML. The plugin uses pegdown Markdown processor.

Source code

The plugin code can be found from GitHub: markdown-page-generator-plugin.


Check out the plugin’s GitHub page for configuration options.

Using the plugin could be easier but as it isn’t in Maven repository you have to e.g. add it as Maven project to same Eclipse workspace as your project and build it. After that add it as a plugin to your build and it’s run automatically when processing sources. You can also run it from command line with “mvn com.ruleoftech:markdown-page-generator-plugin:generate”.





5 responses to “Maven plugin to generate HTML from Markdown”

  1. web page Avatar

    Wһen I initially commented Ι clicked the “Notify me when new comments are added” checkbox and now each timе ɑ сomment іs addeԁ Ι get threе emails with tһе same commеnt.
    Is there any wway yoou сan remove people from that service?

    mу pate – [web page]( “web page”)

    1. Marko Avatar

      Subscriptions for both posts and comments are controlled by the subscriber themselves, so if you no longer want to receive notifications, you need to unsubscribe by yourself, either via the Unsubscribe link in a notification email, or else by visiting and entering the email address you used to subscribe.

  2. Benoît Avatar

    Just useful: the combination of Markdown and this Maven plugin is amazing!

  3. Marko Avatar

    I updated the readme and added license file to clear the issue. Easier to find than checking the pom file.

  4. Jason Baker Avatar

    Can you specify a license in the github readme?

Leave a Reply

Your email address will not be published. Required fields are marked *