Names: Icon, Color, Tone, Side, Method, Command, Zone, Event
Where notesy's API takes one of a fixed set of names (an icon of notesy's,
a theme color, a button's tone), a script gives an enum instead of text, so
a name that's wrong doesn't compile, and an editor that knows Rune can
offer the rest. They're at the top of notesy:
rustuse notesy::{commands, status, view, Color, Command, Icon, Side, Tone};
pub fn ready() {
let row = view::row(Icon::ArrowRight, "Record the demo video");
row.color = Color::Accent;
let button = view::button("Sync now");
button.tone = Tone::Primary;
let sync = status::add("sync");
sync.set(#{ text: "Synced", icon: Icon::Check, side: Side::Left, color: Color::Success });
commands::run(Command::ToggleSidebar);
}
| Enum | For | Some of them |
|---|---|---|
Icon |
notesy's own icons, wherever an icon is named | Icon::Check, Icon::File, Icon::Folder, Icon::Tag, Icon::Calendar, Icon::Clock, Icon::Link, Icon::Pin, Icon::Bulb, Icon::Alert, Icon::Info, Icon::ArrowRight, Icon::Plugin, and the formatting bar's own Icon::Bold, Icon::Italic, Icon::Heading, Icon::BulletList, Icon::Table … |
Color |
a theme's colors, wherever a color is named | Color::Accent, Color::Success, Color::Warning, Color::Danger, Color::Text, Color::TextMuted, Color::TextFaint, Color::Heading, Color::Link, Color::Tag, Color::CalloutTip … |
Tone |
a button's, or a pill's | Tone::Plain, Tone::Soft, Tone::Primary, Tone::Danger, Tone::Tag |
Side |
a status item's, and which way a hover card opens (card_at) |
Side::Left, Side::Right, Side::Above, Side::Below |
Method |
a request's (notesy::net) |
Method::Get, Method::Post, Method::Put, Method::Patch, Method::Delete, Method::Head, Method::Options |
Command |
notesy's own commands, for commands::run |
Command::NewNote, Command::OpenToday, Command::ToggleSidebar, Command::CommandPalette, Command::Bold … |
Zone |
places in notesy's window a plugin can hang something in, for zones::add (notesy::zones) |
Zone::NoteMenu, Zone::EditorMenu, Zone::TitlebarLeft, Zone::BoardTray, Zone::DrawingTray, Zone::NotesHeading … |
Event |
what events::on takes, and every event's kind (notesy::events) |
Event::NoteSaved, Event::AnyNote … |
KeySource |
where a key went (key.source, notesy::events) |
KeySource::Editor, KeySource::Board, KeySource::Palette … |
Key |
which key it was (key.which, with keys.which, notesy::events) |
Key::A, Key::Num7, Key::Escape, Key::ArrowUp, Key::F5, Key::ShiftLeft … |
Every variant is notesy's name for it written in CamelCase: the icon
arrow-right is Icon::ArrowRight, the color text_muted is
Color::TextMuted, the command tabs.close_others is
Command::CloseOtherTabs (the Keybindings page lists every command).
What the plugin names itself stays text: its own icons ("chart"), its
own colors, its settings' and store's keys, its commands' and panels' keys.
Text for notesy's names still works too, checked as the script runs.
Every page
- Overview
- plugin.toml: Every field of plugin.toml
- Permissions: What a plugin can ask for, when notesy asks, and what changes it
- Scripts: How a script runs: its lifecycle, events, limits and errors
- Packing and installing: Making, checking, signing, packing and installing
- notesy::log: Lines for its log on the Plugins page
- notesy::events: Hearing what happens, and every event
- notesy::commands: Adding commands, and running notesy's
- notesy::store: Keeping its own data
- notesy::settings: Reading its settings
- notesy::secrets: Keys and tokens, in the system keychain
- notesy::notes: Reading and changing the vault's notes
- notesy::editor: The note in front
- notesy::templates: What templates fill in, and functions of its own for them
- notesy::files: A folder of its own
- notesy::links: Opening pages in the browser, naming links after their pages
- notesy::clipboard: Copying and pasting
- notesy::view: What panels, tabs and sections show
- notesy::sections: Sidebar sections
- notesy::hidden: Hiding notes, files and folders from the tree
- notesy::status: Status bar items
- notesy::tools: Buttons in the formatting bar
- notesy::notices: Notices
- notesy::dialogs: Asking in a dialog, notesy's kinds or its own
- notesy::wizards: Pages one after another, like a setup
- notesy::boards: Boards' cards and arrows, and kinds of card of its own
- notesy::blocks: Drawing its fenced blocks
- notesy::icons: Drawing its own icons
- notesy::net: Requests to the sites it names
- notesy::ipc: Talking to a program on this computer
- notesy::accounts: Signing in to a service
- notesy::json: Reading and writing JSON
- notesy::toml: Reading and writing TOML
- notesy::yaml: Reading and writing YAML, and a note's front matter
- notesy::time: Now, written in the user's time zone, dates read, how long ago
- notesy::math: Trigonometry and the like, for drawing
- Names: Icon, Color, Tone, Side, Method, Command, Zone, Event: Notesy's names as enums
- notesy::preview: Its own screens for notesy preview
- notesy::perf: Timing its own work
- notesy::drawings: Drawings' shapes, and buttons in their tool strip
- notesy::sound: Playing sounds, and making them as it runs
- notesy::tex: Math macros for every note's formulas
- notesy::views: Side panels, tabs of its own, and its part of the tree's hover cards
- notesy::zones: Notesy's own places — its menus, its bars and its headings