PrettyDoc
Documentation for PrettyDoc.
PrettyDoc.comma
PrettyDoc.defaultRenderOptions
PrettyDoc.empty
PrettyDoc.space
PrettyDoc.Doc
PrettyDoc.RenderOptions
PrettyDoc.align
PrettyDoc.angle
PrettyDoc.brace
PrettyDoc.bracket
PrettyDoc.breakable
PrettyDoc.indent
PrettyDoc.listof
PrettyDoc.parens
PrettyDoc.pretty
PrettyDoc.seg
PrettyDoc.seplistof
PrettyDoc.vsep
PrettyDoc.comma
— ConstantA document representing a single comma.
PrettyDoc.defaultRenderOptions
— ConstantA default set of rendering options.
PrettyDoc.empty
— ConstantA empty document.
PrettyDoc.space
— ConstantA document object representing a single whitespace.
PrettyDoc.Doc
— TypeCombinatorial documentation objects, which has the following constructors:
Doc_Concat(left::Doc, right::Doc)
Concatenates two documents,and the line is not broken.Doc_VSep(elements::Vector{Doc})
Concatenates a vector of documents with the line separator"\n"
.Doc_Align(document::Doc)
Aligns the document using the current indentation.Doc_Indent(delta::Int, document::Doc)
Locally indents the document bydelta
spaces.Doc_Segment(segment::String)
A segment of text.- Doc_Breakable(document::Doc) Inidicating the end of the document is breakable.
- Doc_Empty Do nothing.
PrettyDoc.RenderOptions
— TypeRendering options
PrettyDoc.align
— MethodAlign the document using the current indentation.
PrettyDoc.angle
— MethodWrap a document with left and right angle brackets.
PrettyDoc.brace
— MethodWrap a document with left and right braces.
PrettyDoc.bracket
— MethodWrap a document with left and right brackets.
PrettyDoc.breakable
— MethodMake the document breakable at its beginning.
PrettyDoc.indent
— MethodIndent a document by delta
spaces. Negative delta
s are allowed.
P.S: You might use doc >> 2
or doc << 2
to indent document objects.
PrettyDoc.listof
— FunctionCreate a document that represents a list of elements. No separator.
PrettyDoc.parens
— MethodWrap a document with left and right parentheses.
PrettyDoc.pretty
— MethodUsing repr(o)
to create a document from an object.
PrettyDoc.seg
— MethodMaking a document from a string. Note that including line ending characters can cause ugly pretty printing.
PrettyDoc.seplistof
— Functionseplistof(separator, elements)
Create a document that represents a list of elements, separated by the given separator.
PrettyDoc.vsep
— FunctionConcatenates a vector of documents with the line separator " "
.