Doc

zio.blocks.docs.Doc
See theDoc companion object
final case class Doc(blocks: Chunk[Block], metadata: Map[String, String] = ...) extends Product, Serializable

A GitHub Flavored Markdown document.

Represents a complete GFM document as a sequence of block elements. Documents can be created by parsing markdown strings or constructed programmatically.

Value parameters

blocks

The sequence of block elements in the document

metadata

Optional metadata (reserved for future use)

Attributes

Example
 import zio.blocks.docs._ import zio.blocks.chunk.Chunk
// Parse from string val doc = Parser.parse("# Hello World")
// Construct programmatically val doc2 = Doc(Chunk( Heading(HeadingLevel.H1,
Chunk(Text("Hello World"))) )) 
Companion
object
Source
Doc.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def ++(other: Doc): Doc

Concatenate two documents.

Concatenate two documents.

Combines blocks from both documents and merges metadata. On key conflict, right metadata wins.

Value parameters

other

The document to concatenate

Attributes

Returns

A new document with combined blocks and merged metadata

Source
Doc.scala
override def equals(obj: Any): Boolean

Override equals to use normalized comparison.

Override equals to use normalized comparison.

Two documents are equal if their normalized forms are equal.

Attributes

Definition Classes
Equals -> Any
Source
Doc.scala
override def hashCode(): Int

Override hashCode to be consistent with equals.

Override hashCode to be consistent with equals.

Hash code is based on normalized form.

Attributes

Definition Classes
Any
Source
Doc.scala
def normalize: Doc

Normalize this document to canonical form.

Normalize this document to canonical form.

Merges adjacent Text nodes, removes empty blocks, and recursively normalizes nested structures.

Attributes

Returns

A normalized copy of this document

Source
Doc.scala
def toHtml: String

Attributes

Source
Doc.scala
def toHtmlFragment: String

Attributes

Source
Doc.scala
override def toString: String

Render this document as GitHub Flavored Markdown.

Render this document as GitHub Flavored Markdown.

Attributes

Returns

GFM markdown string representation

Definition Classes
Any
Source
Doc.scala
def toTerminal: String

Attributes

Source
Doc.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala