Versions in this module Expand all Collapse all v0 v0.1.0 Jul 16, 2024 Changes in this version + var TemplateFuncMap = template.FuncMap + type ANSIRenderer struct + func NewRenderer(options Options) *ANSIRenderer + func (r *ANSIRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) + func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element + type BaseElement struct + Prefix string + Style StylePrimitive + Suffix string + Token string + func (e *BaseElement) Render(w io.Writer, ctx RenderContext) error + type BlockElement struct + Block *bytes.Buffer + Margin bool + Newline bool + Style StyleBlock + func (e *BlockElement) Finish(w io.Writer, ctx RenderContext) error + func (e *BlockElement) Render(w io.Writer, ctx RenderContext) error + type BlockStack []BlockElement + func (s *BlockStack) Len() int + func (s *BlockStack) Pop() + func (s *BlockStack) Push(e BlockElement) + func (s BlockStack) Current() BlockElement + func (s BlockStack) Indent() uint + func (s BlockStack) Margin() uint + func (s BlockStack) Parent() BlockElement + func (s BlockStack) Width(ctx RenderContext) uint + func (s BlockStack) With(child StylePrimitive) StylePrimitive + type Chroma struct + Background StylePrimitive + Comment StylePrimitive + CommentPreproc StylePrimitive + Error StylePrimitive + GenericDeleted StylePrimitive + GenericEmph StylePrimitive + GenericInserted StylePrimitive + GenericStrong StylePrimitive + GenericSubheading StylePrimitive + Keyword StylePrimitive + KeywordNamespace StylePrimitive + KeywordReserved StylePrimitive + KeywordType StylePrimitive + Literal StylePrimitive + LiteralDate StylePrimitive + LiteralNumber StylePrimitive + LiteralString StylePrimitive + LiteralStringEscape StylePrimitive + Name StylePrimitive + NameAttribute StylePrimitive + NameBuiltin StylePrimitive + NameClass StylePrimitive + NameConstant StylePrimitive + NameDecorator StylePrimitive + NameException StylePrimitive + NameFunction StylePrimitive + NameOther StylePrimitive + NameTag StylePrimitive + Operator StylePrimitive + Punctuation StylePrimitive + Text StylePrimitive + type CodeBlockElement struct + Code string + Language string + func (e *CodeBlockElement) Render(w io.Writer, ctx RenderContext) error + type Element struct + Entering string + Exiting string + Finisher ElementFinisher + Renderer ElementRenderer + type ElementFinisher interface + Finish func(w io.Writer, ctx RenderContext) error + type ElementRenderer interface + Render func(w io.Writer, ctx RenderContext) error + type HeadingElement struct + First bool + Level int + func (e *HeadingElement) Finish(w io.Writer, ctx RenderContext) error + func (e *HeadingElement) Render(w io.Writer, ctx RenderContext) error + type ImageElement struct + BaseURL string + Child ElementRenderer + Text string + URL string + func (e *ImageElement) Render(w io.Writer, ctx RenderContext) error + type ItemElement struct + Enumeration uint + IsOrdered bool + func (e *ItemElement) Render(w io.Writer, ctx RenderContext) error + type LinkElement struct + BaseURL string + Child ElementRenderer + Text string + URL string + func (e *LinkElement) Render(w io.Writer, ctx RenderContext) error + type MarginWriter struct + func NewMarginWriter(ctx RenderContext, w io.Writer, rules StyleBlock) *MarginWriter + func (w *MarginWriter) Write(b []byte) (int, error) + type Options struct + BaseURL string + ColorProfile termenv.Profile + PreserveNewLines bool + Styles StyleConfig + WordWrap int + type ParagraphElement struct + First bool + func (e *ParagraphElement) Finish(w io.Writer, ctx RenderContext) error + func (e *ParagraphElement) Render(w io.Writer, ctx RenderContext) error + type RenderContext struct + func NewRenderContext(options Options) RenderContext + func (ctx RenderContext) SanitizeHTML(s string, trimSpaces bool) string + type StyleBlock struct + Indent *uint + IndentToken *string + Margin *uint + type StyleCodeBlock struct + Chroma *Chroma + Theme string + type StyleConfig struct + BlockQuote StyleBlock + Code StyleBlock + CodeBlock StyleCodeBlock + DefinitionDescription StylePrimitive + DefinitionList StyleBlock + DefinitionTerm StylePrimitive + Document StyleBlock + Emph StylePrimitive + Enumeration StylePrimitive + H1 StyleBlock + H2 StyleBlock + H3 StyleBlock + H4 StyleBlock + H5 StyleBlock + H6 StyleBlock + HTMLBlock StyleBlock + HTMLSpan StyleBlock + Heading StyleBlock + HorizontalRule StylePrimitive + Image StylePrimitive + ImageText StylePrimitive + Item StylePrimitive + Link StylePrimitive + LinkText StylePrimitive + List StyleList + Paragraph StyleBlock + Strikethrough StylePrimitive + Strong StylePrimitive + Table StyleTable + Task StyleTask + Text StylePrimitive + type StyleList struct + LevelIndent uint + type StylePrimitive struct + BackgroundColor *string + Blink *bool + BlockPrefix string + BlockSuffix string + Bold *bool + Color *string + Conceal *bool + CrossedOut *bool + Faint *bool + Format string + Inverse *bool + Italic *bool + Lower *bool + Overlined *bool + Prefix string + Suffix string + Title *bool + Underline *bool + Upper *bool + type StyleTable struct + CenterSeparator *string + ColumnSeparator *string + RowSeparator *string + type StyleTask struct + Ticked string + Unticked string + type StyleWriter struct + func NewStyleWriter(ctx RenderContext, w io.Writer, rules StylePrimitive) *StyleWriter + func (w *StyleWriter) Close() error + func (w *StyleWriter) Write(b []byte) (int, error) + type TableCellElement struct + Head bool + Text string + func (e *TableCellElement) Render(w io.Writer, ctx RenderContext) error + type TableElement struct + func (e *TableElement) Finish(w io.Writer, ctx RenderContext) error + func (e *TableElement) Render(w io.Writer, ctx RenderContext) error + type TableHeadElement struct + func (e *TableHeadElement) Finish(w io.Writer, ctx RenderContext) error + type TableRowElement struct + func (e *TableRowElement) Finish(w io.Writer, ctx RenderContext) error + type TaskElement struct + Checked bool + func (e *TaskElement) Render(w io.Writer, ctx RenderContext) error