views

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

templ: version: v0.3.833

templ: version: v0.3.833

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPages

func AllPages(data OCRData) templ.Component

AllPages renders all pages in a single view

func Layout

func Layout(title string, pageIndex int, totalPages int) templ.Component

func Markdown

func Markdown(content string) templ.Component

Markdown renders markdown content

func Page

func Page(data OCRData, pageIndex int) templ.Component

Page renders a single page view

Types

type Image

type Image struct {
	BottomRightX int    `json:"bottom_right_x"`
	BottomRightY int    `json:"bottom_right_y"`
	ID           string `json:"id"`
	ImageBase64  string `json:"image_base64"`
	TopLeftX     int    `json:"top_left_x"`
	TopLeftY     int    `json:"top_left_y"`
}

Image represents an image within a page

type OCRData

type OCRData struct {
	Model     string     `json:"model"`
	Pages     []PageView `json:"pages"`
	UsageInfo struct {
		DocSizeBytes   int `json:"doc_size_bytes"`
		PagesProcessed int `json:"pages_processed"`
	} `json:"usage_info"`
}

OCRData represents the structure of the Mistral OCR JSON data

type PageView

type PageView struct {
	Dimensions struct {
		DPI    int `json:"dpi"`
		Height int `json:"height"`
		Width  int `json:"width"`
	} `json:"dimensions"`
	Images   []Image `json:"images"`
	Index    int     `json:"index"`
	Markdown string  `json:"markdown"`
}

Page represents a single page in the OCR document

Jump to

Keyboard shortcuts

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