Documentation
¶
Overview ¶
Package htmlimages rewrites <img> tags in HTML content into resized-preview links (with PhotoSwipe captions), using an imagestyle.ResizeService.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentProcessor ¶
type ContentProcessor struct {
// contains filtered or unexported fields
}
ContentProcessor rewrites content images into preview links.
func NewContentProcessor ¶
func NewContentProcessor(resizeService *imagestyle.ResizeService) *ContentProcessor
NewContentProcessor - a ContentProcessor making the previews with resizeService.
func (*ContentProcessor) Forget ¶
func (cp *ContentProcessor) Forget()
Forget drops the rewritten texts kept: the previews they link to were deleted.
func (*ContentProcessor) ProcessImages ¶
func (cp *ContentProcessor) ProcessImages(htmlContent string) string
ProcessImages replaces local <img> tags in htmlContent with resized previews wrapped in PhotoSwipe links. Unparseable HTML is returned as is. The result is kept for the same text, unless an image of it failed (its store unreachable, say: the next view tries again).
func (*ContentProcessor) SetLightbox ¶
func (cp *ContentProcessor) SetLightbox(fn LightboxFunc)
SetLightbox makes the links open what fn gives of an original (a large copy of it) instead of the original. Set it before the first text is rewritten.