std.block.construct

*container-props*

dynamic

*tags*

dynamic

+formfeed+

+newline+

+return+

+space+

add-child

added in 3.0

(add-child container elem)

adds a child to a container block

(-> (block []) (add-child 1) (add-child 2) (str)) => “12

block

added in 3.0

(block elem)

creates a block

(base/block-info (block 1)) => {:type :token, :tag :long, :string “1”, :height 0, :width 1}

(str (block 1 (newline) (void) 2)) => “1\n 2

comment

added in 3.0

(comment s)

creates a comment block

(str (comment “;hello”)) => “;hello”

construct-children

added in 3.0

(construct-children form)

constructs the children

(mapv str (construct-children 1 (newline) (void) 2)) => “1” "
" “␣” “2”

construct-collection

multimethod

added in 3.0

constructs a collection

(str (construct-collection 1 2 (void) (void) 3)) => “1 2 3

container

added in 3.0

(container tag children)

creates a container

(str (container :list (void) (void))) => “( )”

container-checks

added in 3.0

(container-checks tag children props)

performs checks for the container

contents

added in 3.0

(contents block)

reads out the contents of a container

(contents (block 1 2 3)) => ’1 ␣ 2 ␣ 3

cursor

added in 3.0

(cursor)

creates a cursor for the navigator

(str (cursor)) => “|”

empty

added in 3.0

(empty)

constructs empty list

(str (empty)) => “()”

get-lines

added in 4.0

(get-lines block)

gets the lines for a block

indent-body

added in 4.0

(indent-body block offset)

indents the body given offset

line-restore

added in 4.0

(line-restore dom offset)

restores a dom rep, adding body indentation

line-split

added in 4.0

(line-split block)

splits a block collection into

line-width

added in 4.0

(line-width block)(line-width block offset)

get the width at the line which it finishes

max-width

added in 3.0

(max-width block)(max-width block offset)

gets the max width of given block, along with starting offset

newline

added in 3.0

(newline)

creates a newline

(str (newline)) => "
"

newline?

added in 4.0

(newline? block)

checks if a block is a newline

(newline? (newline)) => true

newlines

added in 3.0

(newlines n)

creates multiple newlines

(apply str (newlines 5)) => "




"

rep

added in 4.0

(rep block)

returns the clojure forms representation of the dsl

root

added in 3.0

(root children)

constructs a root block

space

added in 3.0

(space)

creates a space block

(str (space)) => “␣”

spaces

added in 3.0

(spaces n)

creates multiple space blocks

(apply str (spaces 5)) => “␣␣␣␣␣”

string-token

added in 3.0

(string-token form)

constructs a string token

(str (string-token “hello”)) => “"hello"”

(str (string-token “hello\nworld”)) => “"hello
world"”

tab

added in 3.0

(tab)

creates a tab

(str (tab)) => "\ "

tabs

added in 3.0

(tabs n)

creates multiple tabs

(apply str (tabs 5)) => "\ \ \ \ \ "

token

added in 3.0

(token form)

creates a token

(str (token ’abc)) => “abc”

token-dimensions

added in 3.0

(token-dimensions tag string)

returns the dimensions of the token

(token-dimensions :regexp “#"hello
world"”) => 15 0

(token-dimensions :regexp “#"hello\nworld"”) => 6 1

token-from-string

added in 3.0

(token-from-string string)(token-from-string string value value-string)

creates a token from a string input

(str (token-from-string “abc”)) => “abc”

uneval

added in 3.0

(uneval)

creates a hash-uneval block

(str (uneval)) => “#_”

void

added in 3.0

(void)(void ch)

creates a void block

(str (void)) => “␣”

void-lookup