foundweekends / knockoff   0.9.0

BSD 3-clause "New" or "Revised" License GitHub

A Markdown parser + object model in scala and scala.js

Scala versions: 3.x 2.13 2.12 2.11 2.10
Scala.js versions: 1.x 0.6
Scala Native versions: 0.4

Knockoff - Markdown in Scala

scaladoc Maven Central

This is a simple Markdown to object model to XHTML system.

import knockoff.DefaultDiscounter._

toXHTML(knockoff("""# My Markdown Content """))

You can use the blocks returned from the knockoff method to do useful things, like fetch the header:

val blocks = knockoff("""# My markdown""")
blocks.find( _.isInstanceOf[Header] ).map( toText ).getOrElse( "No header" )