FencePlugin

pamflet.FencePlugin
See theFencePlugin companion object
trait FencePlugin extends PartialFunction[(Option[String], String, Position, ListBuffer[Block]), Block]

A FencePlugin must implement the following methods:

  1. def isDefinedAt(language: Option[String]): Boolean
  2. def toBlock(language: Option[String], content: String, position: Position, list: ListBuffer[Block]): Block
  3. def blockToXHTML: PartialFunction[Block, xml.Node]

First, you have to declare what "language" your FencePlugin supports with isDefinedAt. Next, in toBlock evaluate the incoming content and store them in a custom case class that extends Block. Finally, in blockToXHTML turn your custom case class into an xml Node.

Attributes

Companion:
object
Graph
Supertypes
trait PartialFunction[(Option[String], String, Position, ListBuffer[Block]), Block]
trait ((Option[String], String, Position, ListBuffer[Block])) => Block
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def blockToXHTML: PartialFunction[Block, Node]
def isDefinedAt(language: Option[String]): Boolean
def toBlock(language: Option[String], content: String, position: Position, list: ListBuffer[Block]): Block

Concrete methods

override def apply(x: (Option[String], String, Position, ListBuffer[Block])): Block

Attributes

Definition Classes
Function1
override def isDefinedAt(x: (Option[String], String, Position, ListBuffer[Block])): Boolean

Attributes

Definition Classes
PartialFunction
def onBeginLanguage(): Unit
def onBeginPage(): Unit

Inherited methods

def andThen[C](k: PartialFunction[Block, C]): PartialFunction[A, C]

Attributes

Inherited from:
PartialFunction
override def andThen[C](k: Block => C): PartialFunction[A, C]

Attributes

Definition Classes
PartialFunction -> Function1
Inherited from:
PartialFunction
def applyOrElse[A1 <: (Option[String], String, Position, ListBuffer[Block]), B1 >: Block](x: A1, default: A1 => B1): B1

Attributes

Inherited from:
PartialFunction
def compose[R](k: PartialFunction[R, (Option[String], String, Position, ListBuffer[Block])]): PartialFunction[R, B]

Attributes

Inherited from:
PartialFunction
def compose[A](g: A => (Option[String], String, Position, ListBuffer[Block])): A => R

Attributes

Inherited from:
Function1
def elementWise: ElementWiseExtractor[A, B]

Attributes

Inherited from:
PartialFunction
def lift: A => Option[B]

Attributes

Inherited from:
PartialFunction
def orElse[A1 <: (Option[String], String, Position, ListBuffer[Block]), B1 >: Block](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]

Attributes

Inherited from:
PartialFunction
def runWith[U](action: Block => U): A => Boolean

Attributes

Inherited from:
PartialFunction
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1
def unapply(a: (Option[String], String, Position, ListBuffer[Block])): Option[B]

Attributes

Inherited from:
PartialFunction