Core namespace for Logseq plugin API wrapper
Core namespace for Logseq plugin API wrapper
(before-unload! callback)
Register before unload handler
Register before unload handler
(get-user-configs!)
Get Logseq user configurations. Returns a promise that resolves to a map containing user configs like:
Get Logseq user configurations. Returns a promise that resolves to a map containing user configs like: - :preferred-language - User's preferred language - :preferred-date-format - User's preferred date format - :preferred-workflow - User's preferred workflow - :preferred-theme - User's preferred theme - :preferred-format - User's preferred format (markdown/org) And many other Logseq app configurations.
(on-settings-changed! callback)
Register settings change handler
Register settings change handler
(provide-model! model)
Provide a model object to Logseq
Provide a model object to Logseq
(provide-style! styles)
Provide CSS styles to Logseq
Provide CSS styles to Logseq
(provide-ui! ui)
Provide UI elements to Logseq
Provide UI elements to Logseq
(ready! callback)
(ready! model callback)
Initialize plugin and register model
Initialize plugin and register model
(register-command-palette! command)
Register a command in the Logseq command palette. The command configuration should include:
Register a command in the Logseq command palette. The command configuration should include: - :key - Unique identifier for the command - :label - Display label in the command palette - :keybinding - Optional keyboard shortcut (e.g. 'mod+shift+p') - :callback - Function to execute when command is triggered Example: {:key "plugin-command" :label "My Plugin Command" :keybinding "mod+shift+p" :callback #(js/console.log "Command executed!")}
(update-settings! settings)
Update plugin settings
Update plugin settings
(use-settings-schema! schema)
Define the settings schema for the plugin. The schema should be a map of setting keys to their configurations. Each configuration can include:
Define the settings schema for the plugin. The schema should be a map of setting keys to their configurations. Each configuration can include: - type: The type of setting (string, number, boolean, enum, etc.) - default: The default value - title: Display title for the setting - description: Description of what the setting does - enumChoices: For enum type, the possible choices Example: {:theme {:type :enum :default "light" :title "Theme" :description "Select the theme for the plugin" :enumChoices ["light" "dark"]}}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close