gitanimate

package
v0.0.0-...-6620cce Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FrameRate     = 10
	FFmpegPath    = "ffmpeg"
	FFmpegPreset  = "veryslow"
	MaxFrameCount = 1000
	FrameFormat   = "frame_%04d.png"
)

Variables

View Source
var (
	Logger   = log.NewWithOptions(os.Stderr, log.Options{})
	LangExts = map[string]string{
		"f90":  "fortran",
		"f?":   "fortran",
		"c":    "c",
		"cpp":  "cpp",
		"py":   "python",
		"sh":   "bash",
		"js":   "javascript",
		"html": "html",
		"css":  "css",
		"java": "java",
		"rs":   "rust",
		"go":   "go",
		"md":   "markdown",
	}
)

Functions

func AnimateDiff

func AnimateDiff(params *AnimateDiffParams) error

Types

type AnimState

type AnimState struct {
	OpIndex        int
	CharIndex      int
	Diffs          []diffmatchpatch.Diff
	Lang           string
	Filename       string
	UpdateProgress func(tea.Msg) (tea.Model, tea.Cmd)
}

type AnimateDiffParams

type AnimateDiffParams struct {
	Diffs          []diffmatchpatch.Diff
	PrevContent    string
	Filename       string
	Params         *AnimateParams
	UpdateProgress func(tea.Msg) (tea.Model, tea.Cmd)
	ShowWindow     bool
	Pos            int
	Total          int
}

type AnimateParams

type AnimateParams struct {
	Output        string
	Font          string
	Theme         string
	MinDelay      float32
	MaxDelay      float32
	Width         int32
	Height        int32
	DisableRandom bool
}

type CommitFile

type CommitFile struct {
	FileName       string
	CurrentContent string
	PrevContent    string
}

type GitWrap

type GitWrap interface {
	GetFiles() ([]*CommitFile, error)
	PopCommit() (string, error)
	CurrCommit() string
}

type GitWrapper

type GitWrapper struct {
	Commits []*object.Commit
	Idx     int
	Repo    *git.Repository
}

func NewGitWrapper

func NewGitWrapper(repoPath, start, end string) (*GitWrapper, error)

func (*GitWrapper) CurrCommit

func (g *GitWrapper) CurrCommit() string

func (*GitWrapper) GetFiles

func (g *GitWrapper) GetFiles() ([]*CommitFile, error)

func (*GitWrapper) PopCommit

func (g *GitWrapper) PopCommit() (string, error)

Jump to

Keyboard shortcuts

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