source

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AudioMP3

func AudioMP3(src string) *element

AudioMP3 Creates an audio source element with MP3 type Example: source.AudioMP3("song.mp3") Renders: <source src="song.mp3" type="audio/mpeg" />

func AudioOgg

func AudioOgg(src string) *element

AudioOgg Creates an audio source element with Ogg type Example: source.AudioOgg("song.ogg") Renders: <source src="song.ogg" type="audio/ogg" />

func AudioWav

func AudioWav(src string) *element

AudioWav Creates an audio source element with WAV type Example: source.AudioWav("sound.wav") Renders: <source src="sound.wav" type="audio/wav" />

func ImageAVIF

func ImageAVIF(srcset string) *element

ImageAVIF Creates an image source element with AVIF type (for use in picture elements) Example: source.ImageAVIF("image.avif") Renders: <source type="image/avif" srcset="image.avif" />

func ImageWebP

func ImageWebP(srcset string) *element

ImageWebP Creates an image source element with WebP type (for use in picture elements) Example: source.ImageWebP("image.webp") Renders: <source type="image/webp" srcset="image.webp" />

func New

func New() *element

New Creates a new source element without any initial attributes. Example: source.New().Src("image.webp").Type("image/webp") Renders: <source src="image.webp" type="image/webp" />

func VideoMP4

func VideoMP4(src string) *element

VideoMP4 Creates a video source element with MP4 type Example: source.VideoMP4("movie.mp4") Renders: <source src="movie.mp4" type="video/mp4" />

func VideoOgg

func VideoOgg(src string) *element

VideoOgg Creates a video source element with Ogg type Example: source.VideoOgg("movie.ogv") Renders: <source src="movie.ogv" type="video/ogg" />

func VideoWebM

func VideoWebM(src string) *element

VideoWebM Creates a video source element with WebM type Example: source.VideoWebM("movie.webm") Renders: <source src="movie.webm" type="video/webm" />

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL