revealjs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format struct{}

Format implements format.Format for reveal.js HTML presentations.

func (Format) DeckTitle added in v0.3.0

func (Format) DeckTitle(d format.Deck) string

DeckTitle returns the contents of the HTML <title> element, or "" if the deck has no title.

func (Format) DefaultFile

func (Format) DefaultFile() string

DefaultFile returns the default presentation filename for reveal.js.

func (Format) ExtractTitle

func (Format) ExtractTitle(s format.Slide) string

ExtractTitle returns the title from slide content. It tries, in order: <h1>, <h2>, the section's data-menu-title (reveal.js menu plugin convention), aria-label, and the global title attribute. <br> tags inside headings are treated as spaces.

func (Format) NewSlide

func (Format) NewSlide(title string) format.Slide

NewSlide returns a new slide with an h1 heading for the given title.

func (Format) Parse

func (Format) Parse(data []byte) format.Deck

Parse splits a reveal.js HTML file into its deck metadata (the full HTML shell with a sentinel where slides go) and individual slides.

func (Format) PostScaffoldCmd

func (Format) PostScaffoldCmd() []string

PostScaffoldCmd returns nil since the CDN-based template needs no install step.

func (Format) RenameDeck

func (Format) RenameDeck(d format.Deck, name string) format.Deck

RenameDeck returns a copy of the deck with the <title> element updated.

func (Format) RenameSlide

func (Format) RenameSlide(s format.Slide, name string) format.Slide

RenameSlide returns a copy of the slide with its title changed to name.

func (Format) Render

func (Format) Render(d format.Deck) []byte

Render reconstructs a valid reveal.js HTML file from its parts.

func (Format) RenderSlide

func (Format) RenderSlide(s format.Slide) string

RenderSlide outputs a single slide as a reveal.js <section>.

func (Format) Scaffold

func (Format) Scaffold(title, slug string) []format.ScaffoldFile

Scaffold returns the list of files and directories needed for a new reveal.js presentation.

Jump to

Keyboard shortcuts

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