Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/charmbracelet/glamour
/ functions
Functions
282 in github.com/charmbracelet/glamour
⨍
Functions
282
◇
Types & classes
53
↓ 1 callers
Function
Render
Render initializes a new TermRenderer and renders a markdown with a specific style.
glamour.go:44
↓ 1 callers
Method
SanitizeHTML
SanitizeHTML sanitizes HTML content.
ansi/context.go:58
↓ 1 callers
Function
WithBaseURL
WithBaseURL sets a TermRenderer's base URL.
glamour.go:102
↓ 1 callers
Function
WithChromaFormatter
WithChromaFormatter sets a TermRenderer's chroma formatter used for code blocks.
glamour.go:228
↓ 1 callers
Function
WithEmoji
WithEmoji sets a TermRenderer's emoji rendering.
glamour.go:220
↓ 1 callers
Function
WithPreservedNewLines
WithPreservedNewLines preserves newlines from being replaced.
glamour.go:202
↓ 1 callers
Method
Write
(b []byte)
glamour.go:324
↓ 1 callers
Function
cascadeStyles
(s ...StyleBlock)
ansi/style.go:140
↓ 1 callers
Function
chromaStyle
(style StylePrimitive)
ansi/codeblock.go:28
↓ 1 callers
Method
collectLinksAndImages
(ctx RenderContext)
ansi/table_links.go:122
↓ 1 callers
Method
displayImage
displayImage queues the graphics protocol sequences that display the image at url, if this element references an image and the configured protocol can
ansi/image.go:297
↓ 1 callers
Function
drawSVGTexts
drawSVGTexts draws the SVG's text runs over the rasterized image. originX and originY are the viewBox's origin and sx and sy the scale from viewBox un
ansi/svg.go:572
↓ 1 callers
Function
encodeKittyPlaceholders
encodeKittyPlaceholders encodes the image for display via Kitty graphics Unicode placeholders. The returned sequences carry the out-of-band transmit a
ansi/image.go:466
↓ 1 callers
Function
fitsDisplayBox
fitsDisplayBox reports whether an image of the given dimensions can be displayed in cols x rows cells without downscaling.
ansi/image.go:559
↓ 1 callers
Function
formatSVGOpacity
(op float64)
ansi/svg.go:800
↓ 1 callers
Function
formatToken
(format string, token string)
ansi/baseelement.go:24
↓ 1 callers
Method
graphicsSequence
graphicsSequence loads the image and returns the encoded graphics protocol sequences. Encoded sequences are cached so repeated renders of the same ima
ansi/image.go:350
↓ 1 callers
Function
highlight
highlight writes code to w, colored with style. It chooses the lexer and the formatter as quick.Highlight does, but takes the style itself rather than
ansi/codeblock.go:154
↓ 1 callers
Function
inSSHSession
inSSHSession reports whether this process runs inside an SSH session, i.e. whether the terminal runs on another machine. The terminal cannot read loca
ansi/image.go:655
↓ 1 callers
Function
isChild
(node ast.Node)
ansi/renderer.go:221
↓ 1 callers
Function
isInsideTable
(node ast.Node)
ansi/table_links.go:183
↓ 1 callers
Function
isLocalImage
isLocalImage reports whether url points to a local file rather than a remote resource or inline data.
ansi/image.go:647
↓ 1 callers
Function
isSVGURL
8 MP isSVGURL reports whether the image URL points at an SVG document by its file extension or data URI media type. SVG documents named otherwise are
ansi/svg.go:51
↓ 1 callers
Function
linkWithSuffix
(tl tableLink, list []tableLink)
ansi/table_links.go:229
↓ 1 callers
Function
mixedDoc
(n int)
render_bench_test.go:17
↓ 1 callers
Function
newImageCaches
newImageCaches returns an empty set of image caches.
ansi/image.go:107
↓ 1 callers
Function
newWrapCloser
(w *bytes.Buffer)
ansi/margin_test.go:40
↓ 1 callers
Function
noiseImage
noiseImage returns a random noise image, which doesn't compress well, so its encoded size is dominated by its dimensions.
ansi/image_test.go:832
↓ 1 callers
Function
normalizeSVGColor
normalizeSVGColor rewrites the rgba() colors of one property (fill or stroke) of a start tag, see [normalizeSVGColors]. An existing opacity for the pr
ansi/svg.go:652
↓ 1 callers
Function
parseHTMLImages
parseHTMLImages extracts <img> tags from HTML and returns an ImageElement for each one found. Returns nil if no images are found.
ansi/image.go:992
↓ 1 callers
Function
parseSVGHexColor
parseSVGHexColor parses the hex digits h of an SVG color s: #rgb, #rgba, #rrggbb, or #rrggbbaa.
ansi/svg.go:355
↓ 1 callers
Function
parseSVGOpacity
parseSVGOpacity parses an opacity value, treating invalid ones as opaque.
ansi/svg.go:792
↓ 1 callers
Function
parseSVGRGBA
parseSVGRGBA splits an rgba() color into an rgb() color and its alpha.
ansi/svg.go:770
↓ 1 callers
Function
placeholderGrid
placeholderGrid returns a cols x rows grid of Kitty graphics Unicode placeholders for the image with the given ID. Each line of the grid carries the i
ansi/image.go:571
↓ 1 callers
Method
point
point applies the transformation to (x, y).
ansi/svg.go:452
↓ 1 callers
Method
printTableLinks
(ctx RenderContext)
ansi/table_links.go:36
↓ 1 callers
Function
proseDoc
(paragraphs int)
render_bench_test.go:9
↓ 1 callers
Function
rasterizeSVG
rasterizeSVG rasterizes the SVG document at up to maxW x maxH pixels, preserving the aspect ratio; vectors scale cleanly, so the image is rasterized a
ansi/svg.go:167
↓ 1 callers
Function
readImageConfig
(ctx RenderContext, url string)
ansi/image.go:762
↓ 1 callers
Method
remoteImageNotLoadedNote
remoteImageNotLoadedNote returns the note to render after the URL of a remote image that was not loaded because loading remote images is disabled (see
ansi/image.go:337
↓ 1 callers
Method
renderHrefPart
(w io.Writer, ctx RenderContext, link string)
ansi/link.go:86
↓ 1 callers
Method
renderTextPart
(w io.Writer, ctx RenderContext, inline bool)
ansi/link.go:46
↓ 1 callers
Function
reserveRows
reserveRows appends one newline per row the image occupies so the terminal reserves vertical space for it. Without this, the terminal draws the image
ansi/image.go:602
↓ 1 callers
Method
resetPen
()
ansi/margin.go:163
↓ 1 callers
Method
restorePen
()
ansi/margin.go:174
↓ 1 callers
Function
run
()
internal/generate-style-json/main.go:28
↓ 1 callers
Method
scale
scale returns the absolute scale of the transformation, used to scale the font size.
ansi/svg.go:458
↓ 1 callers
Method
setBorders
(ctx RenderContext)
ansi/table.go:106
↓ 1 callers
Method
setStyles
(ctx RenderContext)
ansi/table.go:75
↓ 1 callers
Method
shouldPrintTableLinks
(ctx RenderContext)
ansi/table_links.go:112
↓ 1 callers
Function
svgApplyAttributes
svgApplyAttributes returns the style for an element, inheriting from the given style.
ansi/svg.go:297
↓ 1 callers
Function
svgAttr
svgAttr returns the value of a start tag's attribute.
ansi/svg.go:725
↓ 1 callers
Function
svgAttrFloat
svgAttrFloat returns the element's attribute parsed as a float.
ansi/svg.go:343
↓ 1 callers
Function
svgAttributes
svgAttributes returns the element's attributes, including the ones packed into the style attribute.
ansi/svg.go:278
↓ 1 callers
Function
svgDecl
svgDecl returns the value of a style declaration.
ansi/svg.go:753
↓ 1 callers
Function
svgFloats
svgFloats parses a list of space- or comma-separated floats.
ansi/svg.go:503
↓ 1 callers
Function
svgFonts
()
ansi/svg.go:525
↓ 1 callers
Function
svgMeasure
svgMeasure returns the width of the text at the given size, in pixels.
ansi/svg.go:560
↓ 1 callers
Function
svgParseTransform
svgParseTransform parses a transform attribute. translate, scale and matrix are supported; other functions are ignored.
ansi/svg.go:467
↓ 1 callers
Function
svgPathTokens
svgPathTokens splits SVG path data into its commands and arguments.
ansi/svg.go:870
↓ 1 callers
Function
svgScale
(x, y float64)
ansi/svg.go:437
↓ 1 callers
Function
svgSetAttr
svgSetAttr sets the value of a start tag's attribute, adding it if needed.
ansi/svg.go:731
↓ 1 callers
Function
svgSetDecl
svgSetDecl sets the value of a style declaration, adding it if needed.
ansi/svg.go:759
↓ 1 callers
Function
svgTagName
svgTagName returns the element name of a start tag.
ansi/svg.go:702
↓ 1 callers
Function
svgTranslate
(x, y float64)
ansi/svg.go:435
↓ 1 callers
Function
writeStyleJSON
(filename string, styleConfig *ansi.StyleConfig)
internal/generate-style-json/main.go:13
↓ 1 callers
Function
writeTestSVG
writeTestSVG writes an SVG document to a temporary file and returns its path.
ansi/svg_test.go:356
Function
BenchmarkRenderMixed
(b *testing.B)
render_bench_test.go:45
Function
BenchmarkRenderProse
(b *testing.B)
render_bench_test.go:39
Method
Close
Close closes the [PaddingWriter].
ansi/margin.go:135
Method
Close
()
ansi/margin_test.go:46
Function
ExampleASCIIStyleConfig
()
glamour_test.go:326
Method
Finish
Finish finishes rendering a ParagraphElement.
ansi/paragraph.go:37
Method
Finish
Finish finishes rendering a TableElement.
ansi/table.go:127
Method
Finish
Finish finishes rendering a TableRowElement.
ansi/table.go:154
Method
Finish
Finish finishes rendering a TableHeadElement.
ansi/table.go:165
Method
Finish
Finish finishes rendering a HeadingElement.
ansi/heading.go:62
Method
Finish
Finish finishes rendering a BlockElement.
ansi/blockelement.go:32
Function
FuzzData
(f *testing.F)
glamour_test.go:211
Method
GraphicsCommands
GraphicsCommands returns the out-of-band graphics protocol sequences (image transmission and placement commands) collected during the last render. It
glamour.go:367
Method
Read
(b []byte)
glamour.go:313
Method
RegisterFuncs
RegisterFuncs implements NodeRenderer.RegisterFuncs.
ansi/renderer.go:115
Method
Render
Render renders a CodeSpanElement.
ansi/codespan.go:12
Method
Render
Render renders an ImageElement.
ansi/image.go:231
Method
Render
Render writes a space.
ansi/image.go:1033
Method
Render
Render renders all child elements.
ansi/image.go:1042
Method
Render
Render renders a ParagraphElement.
ansi/paragraph.go:18
Method
Render
Render renders a TableElement.
ansi/table.go:38
Method
Render
Render renders a TableCellElement.
ansi/table.go:176
Method
Render
Render renders a LinkElement.
ansi/link.go:26
Method
Render
Render renders a CodeBlockElement.
ansi/codeblock.go:63
Method
Render
Render renders a TaskElement.
ansi/task.go:13
Method
Render
Render renders a EmphasisElement.
ansi/emphasis.go:15
Method
Render
Render renders an ItemElement.
ansi/listitem.go:15
Method
Render
Render renders a HeadingElement.
ansi/heading.go:27
Method
Render
Render renders a BlockElement.
ansi/blockelement.go:22
Function
RenderWithEnvironmentConfig
RenderWithEnvironmentConfig initializes a new TermRenderer and renders a markdown with a specific style defined by the GLAMOUR_STYLE environment varia
glamour.go:51
Method
StyleOverrideRender
StyleOverrideRender renders a EmphasisElement with a given style.
ansi/emphasis.go:25
Method
StyleOverrideRender
StyleOverrideRender renders a BaseElement with an overridden style.
ansi/baseelement.go:102
Function
TestCapitalization
(t *testing.T)
glamour_test.go:189
← previous
next →
101–200 of 282, ranked by callers