revealjs

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 19 Imported by: 0

README

go-revealjs

Derived from revealjs-docker. Work in progress.

Documentation

Index

Constants

View Source
const (
	FileNameConfig        = "config.yml"
	FileNameIndexHTMLTmpl = "index.html.tmpl"
	FileNameIndexHTML     = "index.html"
	DirNameSlides         = "slides"
	DirNameAssets         = "assets"
)

Variables

View Source
var PresetNames = []string{"default", "demo"}

Functions

func IsHTML added in v0.0.5

func IsHTML(path string) bool

func IsMarkdown added in v0.0.3

func IsMarkdown(path string) bool

Types

type BoolProperty added in v0.0.5

type BoolProperty struct {
}

func (*BoolProperty) ToString added in v0.0.5

func (p *BoolProperty) ToString(v interface{}) (string, error)

type Config

type Config struct {
	Slides          []string               `yaml:"slides"`
	Title           string                 `yaml:"title"`
	Theme           string                 `yaml:"theme"`
	RevealJS        map[string]interface{} `yaml:"revealjs"`
	InternalPlugins []interface{}          `yaml:"plugins"`
}

func LoadConfigFile

func LoadConfigFile(reader io.Reader) (*Config, error)

func LoadConfigFromMarkdown added in v0.0.5

func LoadConfigFromMarkdown(content string) (*Config, error)

func (*Config) OverrideWith added in v0.0.3

func (c *Config) OverrideWith(other *Config)

func (*Config) Plugins

func (c *Config) Plugins() []Plugin

func (*Config) RevealJSConfig

func (c *Config) RevealJSConfig() (map[string]string, error)

type GenerateOptions

type GenerateOptions struct {
	Force                bool
	GenerateConfig       bool
	GenerateHTMLTemplate bool
}

type HTMLGeneratorParams

type HTMLGeneratorParams struct {
	HotReload bool
	Revision  *string
}

type JSONProperty added in v0.0.5

type JSONProperty struct {
}

func (*JSONProperty) ToString added in v0.0.5

func (p *JSONProperty) ToString(v interface{}) (string, error)

type Markdown added in v0.0.3

type Markdown struct {
	// contains filtered or unexported fields
}

func NewMarkdown added in v0.0.3

func NewMarkdown(content string) *Markdown

func (*Markdown) WithoutYAMLHeader added in v0.0.3

func (m *Markdown) WithoutYAMLHeader() string

func (*Markdown) YAMLHeader added in v0.0.3

func (m *Markdown) YAMLHeader() (map[string]interface{}, error)

type NumberProperty added in v0.0.5

type NumberProperty struct {
}

func (*NumberProperty) ToString added in v0.0.5

func (p *NumberProperty) ToString(v interface{}) (string, error)

type Plugin

type Plugin struct {
	Name string `yaml:"name"`
	Src  string `yaml:"src"`
}

type Preset

type Preset struct {
	// contains filtered or unexported fields
}

Preset is a collection of files that are used to generate an initial Reveal.js presentation.

func NewDefaultPreset

func NewDefaultPreset() *Preset

func NewPreset

func NewPreset(name string) (*Preset, error)

func (*Preset) Generate

func (f *Preset) Generate(dest string, options *GenerateOptions) error

type Property added in v0.0.5

type Property interface {
	ToString(v interface{}) (string, error)
}

type RevealJS

type RevealJS struct {
	EmbedHTML     bool
	EmbedMarkdown bool
	// contains filtered or unexported fields
}

func NewRevealJS

func NewRevealJS(dataDirectory string) (*RevealJS, error)

func (*RevealJS) Build

func (r *RevealJS) Build(dst string) error

func (*RevealJS) DataDirectory

func (r *RevealJS) DataDirectory() string

func (*RevealJS) FileSystem added in v0.0.3

func (r *RevealJS) FileSystem() fs.FS

func (*RevealJS) GenerateIndexHTML added in v0.0.3

func (r *RevealJS) GenerateIndexHTML(w io.Writer, params *HTMLGeneratorParams) error

func (*RevealJS) ReloadConfig added in v0.0.3

func (r *RevealJS) ReloadConfig() error

type Revision

type Revision struct {
	Value string
}

type Server added in v0.0.3

type Server struct {
	// contains filtered or unexported fields
}

func NewServer added in v0.0.3

func NewServer(port int, revealJS *RevealJS) *Server

func (*Server) Start added in v0.0.3

func (s *Server) Start() error

type SlideResourceFS added in v0.0.5

type SlideResourceFS struct {
	// contains filtered or unexported fields
}

SlideResourceFS is a file system that provides slides and assets. - *.md - *.html - slides/*.md - slides/*.html - assets/**/* - config.yml - index.html.tmpl

func NewSlideResourceFS added in v0.0.5

func NewSlideResourceFS(fs fs.FS) *SlideResourceFS

func (*SlideResourceFS) Open added in v0.0.5

func (s *SlideResourceFS) Open(name string) (fs.File, error)

func (*SlideResourceFS) ReadDir added in v0.0.5

func (f *SlideResourceFS) ReadDir(name string) ([]fs.DirEntry, error)

type StringProperty added in v0.0.5

type StringProperty struct {
	// contains filtered or unexported fields
}

func (*StringProperty) ToString added in v0.0.5

func (p *StringProperty) ToString(v interface{}) (string, error)

type Watcher

type Watcher struct {
	Revision *Revision
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(dataDirectory string, onUpdate func()) (*Watcher, error)

func (*Watcher) Start

func (w *Watcher) Start()

Directories

Path Synopsis
cmd
test

Jump to

Keyboard shortcuts

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