![]() ![]() If not, an error is generated.NotePlan aims to help you better plan your day without wasting too much time creating events, to-do lists, formatting notes, and so on. If the command executes OK then dependency is passed. This includes an (optional?) one-line script that the author specifies to test whether the dependency is met or not. We also need an array of dependencies, now added in the sample above. (Particularly as I think I read that Apple have said they're going to stop shipping some language engines in macOS.) So I think (in time, anyway) we need a way to test whether language X version Y is installed, to warn the user, and to disable it if it isn't. Not least because I can easily foresee the case that a less experienced user tries a plugin that requires script language X version Y, but doesn't have it on their Mac. We need a mechanism to enable/disable plugins (common practice in other extensible systems). Q for EM: Is this right? Outputįurther lines of output are captured by NotePlan and used to insert at the current position, or replace the current selection (where there is one). NB: Plugin authors should assume the log files aren't visible to the plugin. ![]() log: "message" -> debug window, np-out.log.error: "message" -> a modal error dialog, debug window, np-error.log.When a script runs, by default the first of any output lines is treated as an error or log message, and will be copied to the relevant log, plus other output(s). NotePlan maintains two log files, in the ~/Library/Containers/co.noteplan.NotePlan3/Data/Documents/ folder: Does this even make sense? Is it possible? Logging Q for EM: This is the bit I'm least clear about. When the plugin is called it can assume its current working directory is in the plugin's folder. PLUGIN_DIR, the full filepath of the current Plugin's top-level folder.NOTES_DIR, the full filepath of the 'Notes' directory in the NotePlan data area.CALENDAR_DIR, the full filepath of the 'Calendar' directory in the NotePlan data area.The following environment variables will be set, which the plugin can look up: When a plugin is installed, it copies any plugin.preference item defaults into this file. This is the JSON file that stores the actual current Preference settings. Q for EM: Any others? I think we'll also need a way to pass an array of filenames.Īll are passed as an UTF-8 string with any double-quote marks escaped. Other possible parameter type identifiers: ![]() Q for EM: This feels a bit of a hack, but I can't think of a more elegant solution right now. Compare the second command which doesn't need a particular note to be specified. This indicates that it is expecting a filename to be passed for the plugin to process. "name": "tidy ", // short name to use in the command bar "description": "Tidy current note ", // longer command description to use "command": "ruby npTidy.rb -n. "mands": [ // array of commands minimum 1 "test_command": "gem spec json -local -version '>=2' " // cool command to do a specific ruby gem test :-) "description": "Ruby interpreter ", // human-readable desceription of the dependency "min_version": "2.4.0 ", // (optional) human-readable minimum version string "test_command": "ruby -version " // (optional) command to run on installation if it returns true then the dependency is met if not then warn user and disable. png file "thor": "Jonathan Clark ", // author name "plugin.url": "tbd ", // link to repository for the plugin "plugin.version": "0.0.1 ", // x.y.z plugin version "pendencies": [ // optional list of dependencies, and automated tests ", // longer description for plugin catalog "plugin.icon": " ", // optional. "plugin.name": "Tidy up NotePlan notes ", // short display name for plugin catalog "scription": "Delete multiple blank lines, empty todos and bullets, etc. "noteplan.minAppVersion": "3.0.16 ", // x.y.z version of NotePlan required "plugin.id": "jgclark.Tidy ", // author id.short name - to allow multiple plugins with similar names by different authors. The plugin is configured in this JSON file, which shouldn't change (for any given version of the plugin). other supporting files, libraries, graphics._script_file_ - the executable script file, in any suitable language, referred to in config.json.config.json - current configuration for the plugin.plugin.json - metadata about the plugin, including default configuration.The name is expected to the plugin.id below. The new files and folders are in bold the others are existing ones in NotePlan's data directory. (Potentially) by a shortcut registered by the plugin.By a command typed in the command bar (which can be triggered anywhere by ⌥⌘J).By a /command typed at the start of a line in editor mode.There are potentially four ways plugin functionality can be triggered: A work in progress by Eduard Metzger and Jonathan Clark, with support from the discord server community. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |