Skip to content

martijndwars/markdown-gradle-plugin

Repository files navigation

Markdown Gradle Plugin

A Gradle plugin to compile Markdown to HTML and PDF. This plugin is a wrapper around:

Build Status Gradle Plugin Portal

Plugins

Applying this plugin implicitly applies the base plugin to your project.

Tasks

This plugin adds the following tasks:

  • compileMarkdownToHtml: Compile a Markdown file to a HTML file.
  • compileHtmlToPdf: Compile a HTML file to a PDF file.
  • compileMarkdownToPdf: Compile a Markdown file to a PDF file (uses above tasks internally).

Example

plugins {
    id 'nl.martijndwars.markdown' version '0.2.0'
    id 'maven-publish'
}

group = 'org.example'
version = '1.2.3'
description = 'Simple example'

repositories {
    jcenter()
}

compileMarkdownToHtml {
    inputFile = file("text.md")
}

compileHtmlToPdf {
    outputFile = file("$buildDir/text.pdf")
}

compileHtmlToPdf.inputFile = compileMarkdownToHtml.outputFile
compileMarkdownToHtml.outputFile = file("$buildDir/text.html")

task textZip(type: Zip) {
    destinationDirectory = file("$buildDir/dist")

    from compileHtmlToPdf.outputFile
}

publishing {
    publications {
        simple(MavenPublication) {
            artifact textZip
        }
    }
}

About

A plugin that converts Markdown to HTML and HTML to PDF.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages