Documentation ¶
Overview ¶
Package bearnotes provides tools to read Markdown files generated by the Bear app. It can also convert those files to a format suitable for Zettlr.
It handles notes, embedded images and file attachments.
Note: there are some Unicode normalization issues between the filenames in the filesystem and paths in the Markdown file. It is up to the caller to normalize strings when required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverNotes ¶
DiscoverNotes walk through recursively the Bear notes directory to find notes. It generates a tag configuration file, suitable for migration.
Types ¶
type File ¶
type File struct { Location string // The path to the file attachment Name string // The name of the file // contains filtered or unexported fields }
File represents a file attachment in a note.
type Image ¶
type Image struct { Location string // The path to the embedded image Description string // The alternative text for the image // contains filtered or unexported fields }
Image represents an embedded image in a note.
type Note ¶
type Note struct { Tags []Tag // All the tags Files []File // All the file attachments Images []Image // All the embedded images // contains filtered or unexported fields }
Note represents a Bear note with its tags, file attachments and embedded images.
type Tag ¶
type Tag struct { // The name of the tag (without the leading hashtag) Name string // contains filtered or unexported fields }
Tag represents a Bear tag (#foo)
type TagOptions ¶
type TagOptions struct { // When true, Ignore specifies that this tag is not relevant. // It can be useful when a tag is wrongly identified. Ignore bool `yaml:"ignore"` // HandlingStrategy specifies how notes will be saved on the filesystem // - same-folder: all notes having this tag are stored in the TargetDirectory // along with their embedded images and file attachments. // - one-note-per-folder: each note will get a sub-folder in the TargetDirectory // - "" (empty string): no handling specified for this tag HandlingStrategy string `yaml:"handling_strategy"` // TargetDirectory specifies where to store notes, along with their images and files TargetDirectory string `yaml:"target_directory"` // TargetTagName specifies the new tag name. Since Bear supports nested tags (#foo/bar) // but Zettlr does not, by default the target is the last component of the Bear tag (#bar). // // If TargetTagName is the empty string, the tag is removed from the note. TargetTagName string `yaml:"target_tag_name"` // contains filtered or unexported fields }
TagOptions specifies how to convert notes having this tag.
func NewTagOptions ¶
func NewTagOptions(tag Tag) TagOptions
NewTagOptions initializes a new TagOptions from a Tag object, with sane defaults and counter == 1