rm

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package rm contains logic for interacting with the Remarkable API for the purposes of reading and writing documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderRmToPng

func RenderRmToPng(src, dest string) error

RenderRmToPng renders a remarkable document to a PNG file.

Types

type Client

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

func New

func New(log *slog.Logger) (*Client, error)

New creates a new Client for interacting with the Remarkable API.

func (*Client) DownloadDocument

func (c *Client) DownloadDocument(doc *model.Document) (*Document, error)

DownloadDocument downloads a document from Remarkable and returns it.

func (*Client) ListDocuments

func (c *Client) ListDocuments() []*model.Node

ListDocuments returns a list of all documents on the Remarkable.

type Document

type Document struct {
	Path string
	Zip  *Zip
}

type Metadata

type Metadata struct {
	CreatedTime    string `json:"createdTime"`
	LastModified   string `json:"lastModified"`
	LastOpened     string `json:"lastOpened"`
	LastOpenedPage int    `json:"lastOpenedPage"`
	Parent         string `json:"parent"`
	Pinned         bool   `json:"pinned"`
	Type           string `json:"type"`
	VisibleName    string `json:"visibleName"`
}

type Page

type Page struct {
	// ID is the ID of the page.
	ID string

	// Path is the path to the page. This is the "<id>.rm" file.
	Path string

	// PNGPath is the path to the rendered PNG file. To set, call "Render"
	// on the page.
	PNGPath string
}

func (*Page) Render

func (p *Page) Render() error

Render populates the PNGPath field of the page by rendering the page to a PNG file.

type Zip

type Zip struct {
	// ID is the ID of the document contained in the zip file.
	ID string

	// Metadata is the contents of the "<id>.metadata" file.
	Metadata Metadata

	// Pages is a list of pages in the zip file.
	Pages []Page
}

Zip is a representation of the inside of a "rm" file version 6.

Jump to

Keyboard shortcuts

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