MarkdownCodeWrapper

scala.build.internal.markdown.MarkdownCodeWrapper

A util for extraction and wrapping of code blocks in Markdown files.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class WrappedMarkdownCode(code: String, directives: ExtractedDirectives)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def apply(subPath: SubPath, markdown: PreprocessedMarkdown): (Option[WrappedMarkdownCode], Option[WrappedMarkdownCode], Option[WrappedMarkdownCode])

Extracts scala code blocks from Markdown snippets, divides them into 3 categories and wraps when necessary.

Extracts scala code blocks from Markdown snippets, divides them into 3 categories and wraps when necessary.

Value parameters

markdown

preprocessed Markdown code blocks

subPath

the project os.SubPath to the Markdown file

Attributes

Returns

a tuple of (Option(simple scala code blocks), Option(raw scala snippets code blocks), Option(test scala snippets code blocks))

Glues raw Scala snippets into a single file.

Glues raw Scala snippets into a single file.

Value parameters

snippets

a sequence of code blocks

Attributes

Returns

an option of the resulting code String

def wrapScalaCode(preprocessed: PreprocessedMarkdownCodeBlocks, wrapperName: String, pkg: Option[String]): Option[WrappedMarkdownCode]

Wraps plain scala snippets in relevant scope objects, forming a script-like wrapper.

Wraps plain scala snippets in relevant scope objects, forming a script-like wrapper.

Value parameters

pkg

package for the wrapper object

snippets

a sequence of code blocks

wrapperName

name for the wrapper object

Attributes

Returns

an option of the wrapped code String