1. Matthias Nüßler
  2. pegdown-cli

Overview

HTTPS SSH

Introduction

pegdown is a pure Java library for clean and lightweight Markdown processing. It's implementation is based on a parboiled PEG parser and is therefore rather easy to understand and extend. pegdown-cli is a CLI tool to pegdown.

Installation

Download the JAR for latest version from the download page.
Additionally pegdown-cli requires JARs on the classpath:

  • args4j: v2.0.12 or better;
  • ASM: v3.3.1 or better (asm.jar, asm-analysis.jar, asm-tree.jar, asm-util.jar);
  • parboiled: v0.11.1 or better;
  • pegdown: v0.9.2 or better.

Using pegdown-cli

Example:

java -jar pegdown-cli.jar [ option flags ] [ source [ target ] ]

Option flags (see pegdown extentions):

  • -a or --abbreviations - support for abbreviations in the way of PHP Markdown Extra.
  • -l or --autolinks - enables plain (undelimited) autolinks the way Github-flavoured-Markdown implements them.
  • -w or --hardwraps - enables alternative handling of newlines, see Github-flavoured-Markdown.
  • -q or --quotes - beautifys single quotes, double quotes and double angle quotes (« and »).
  • -s or --smarts - beautifys apostrophes, ellipsises ("..." and ". . .") and dashes ("--" and "---").
  • -p or --smartypants - convenience extension enabling both, --smarts and --quotes, at once.
  • -t or --tables - enables support for tables similar to MultiMarkdown (which is in turn like the PHP Markdown Extra tables, but with colspan support).
  • --all - enable all available extensions.
  • --none - the default, standard markup mode without any extensions.
  • --no-blocks - suppresses HTML blocks.
  • --no-inline - suppresses inline HTML tags.
  • --no-html - suppresses HTML blocks as well as inline HTML tags.
  • --no-follow-links - attaches a rel="nofollow" attribute to all generated HTML links. Not implement yet!
  • --html5 - add the standard HTML5 prologue and epilogue. Not implement yet!
  • --xhtml5 - add the standard XHTML5 prologue and epilogue. Not implement yet!
  • --prelude filename - add the prelude from file to HTML output. Not implement yet!
  • --coda filename - add the coda from file to HTML output. Not implement yet!
  • --title text - add title to HTML header, use with html5 or prelude options. Not implement yet!

Optional parameters:

  • source - source filename. If the source filename is not given use standard input.
  • target - target filename. If the target filename is not given use standard output.