files

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RMFileInfo

type RMFileInfo struct {
	*RmFS                     // embedded rm filesystem
	Version            int    // version from metadata
	VisibleName        string // visibleName from metadata (used in reMarkable interface)
	LastModified       time.Time
	OriginalPageCount  int
	PageCount          int
	Pages              []RMPage
	Orientation        string
	RedirectionPageMap []int // page insertion info

	Debugging bool
	// contains filtered or unexported fields
}

RMFileInfo is a struct defining the collected metadata about a PDF from the reMarkable file collection

func RMFiler

func RMFiler(inputpath string, template string) (RMFileInfo, error)

RMFiler collects information from the reMarkable files associated with the uuid of interest.

Either a pdf at <path/uuid.pdf> is expected, or a single A4 page template. If a template is not explictly provided an embedded A4 template is used. This is managed by fs.go

The uuid (identified by its filepath plus <uuid>), is used to collect information from the .metadata and .content files. It then collects layer information for each associated .rm file in a directory named by the uuid of the pdf.

func (*RMFileInfo) Debug

func (r *RMFileInfo) Debug(d string)

Debug prints a message if the debugging switch is on

func (*RMFileInfo) InsertedPages added in v0.0.3

func (r *RMFileInfo) InsertedPages() string

InsertedPages is a public export of the embedded insertedPages human readable page numbers func

func (*RMFileInfo) PageIterate added in v0.0.3

func (r *RMFileInfo) PageIterate() (pageNo, pdfPageNo int, inserted, isTemplate bool, reader *io.ReadSeeker)

PageIterate iterates over pages using the rmfile iterator which provides a page number and the pdf to use (either the annotated pdf or the template). For annotated pdfs with inserted pages one might receive the following output from the iterator:

pageno | pdfPage | inserted | template | -------+---------+----------+---------------+ 0 | 0 | no | annotated.pdf | 1 | 0 | yes | template.pdf | 2 | 1 | no | annotated.pdf |

This function returns 0-indexed pdf pages

Returning an io.ReadSeeker from an fs.File is described by Ian Lance Taylor at https://github.com/golang/go/issues/44175#issuecomment-775545730

type RMPage

type RMPage struct {
	PageNo     int
	Identifier string   // the uuid used to identify the RM file
	Exists     bool     // file exists on disk
	LayerNames []string // layer names by implicit index
	// contains filtered or unexported fields
}

RMPage is a struct defining metadata about each .rm file associated with the PDF described in an RMFileInfo. Note that while the .content file records page UUIDs for each page of the original PDF, .rm and the related file are only made for those pages which have marks

func (*RMPage) RMFile added in v0.1.4

func (r *RMPage) RMFile() fs.File

RMFile returns the fs.File pointing to the .rm file

func (*RMPage) RMFilePath added in v0.1.4

func (r *RMPage) RMFilePath() string

RMFilePath returns the .rm file path

func (RMPage) String added in v0.1.4

func (r RMPage) String() string

String returns a terse string version of rmFileDesc

type RmFS added in v0.1.4

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

RmFS represents a remarkable file system of files

func NewDirRmFS added in v0.1.4

func NewDirRmFS(path, basename, tplPath string) (*RmFS, error)

NewDirRmFS mounts an RmFS from a Directory from which the needed files are selected using a filter

func NewZipRmFS added in v0.1.4

func NewZipRmFS(zipPath, tplPath string) (*RmFS, error)

NewZipRmFS mounts an RmFS from a zip file

func (*RmFS) Check added in v0.1.5

func (rf *RmFS) Check() error

Check checks if the Scan has collected some files

func (*RmFS) IdentifyPDF added in v0.1.4

func (rf *RmFS) IdentifyPDF(isTpl bool) string

IdentifyPDF shows the pdf path in use

func (*RmFS) Scan added in v0.1.4

func (rf *RmFS) Scan() error

Scan scans for the files of interest and stores the metadata and rm lines information in the RmFS struct

func (*RmFS) String added in v0.1.4

func (rf *RmFS) String() string

String provides a string reprentation of an RmFS filesystem

Jump to

Keyboard shortcuts

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