std.block.construct
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)line-restore
added in 4.0
(line-restore dom offset)restores a dom rep, adding body indentation
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 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)) => "
"
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"”
token-dimensions
added in 3.0
(token-dimensions tag string)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”