module FrontMatter
Defined in:
front_matter.crClass Method Summary
-
.open(filename : String, skip_newlines : Bool = true, &block : String, IO::FileDescriptor -> Nil) : Nil
Opens the file named by filename.
-
.parse(io : IO, skip_newlines : Bool = true, &block : String, IO -> Nil) : Nil
Parses the
IOgiven as io. -
.parse(string : String, skip_newlines : Bool = true, &block : String, String -> Nil) : Nil
Parses the
Stringgiven as string.
Class Method Detail
Opens the file named by filename. Yields the frontmatter as a String and the
file descriptor positioned at the start of the content to the given block. If
the contents leading newlines are desired setting skip_newlines to false
will prevent it from being skipped.
Parses the IO given as io. Yields the frontmatter as a String and the
IO positioned at the start of the content to the given block. If
the contents leading newlines are desired setting skip_newlines to false
will prevent it from being skipped.
Note: The provided IO must support #.seek.
Parses the String given as string. Yields the frontmatter as a String
and the remaineder as a String to the given block. If the contents leading
newlines are desired setting skip_newlines to false will prevent it
from being skipped.
Note: This should not be used in most cases. It converts between String
and IO::Memory numerous times and is only included to make testing easier.