Macros for generating Logseq API wrapper functions
Macros for generating Logseq API wrapper functions
(deflogseq-api ns-kw)
Define wrapper functions for Logseq API methods. Takes a namespace keyword (e.g. :Editor) and a vector of method names. Generates wrapper functions for all provided methods in the namespace.
For each method, generates a ClojureScript wrapper function that:
Example: (deflogseq-api :Editor ["removeBlock" "insertBlock"])
Generates functions remove-block! and insert-block! that wrap the corresponding methods from logseq.Editor namespace.
Define wrapper functions for Logseq API methods. Takes a namespace keyword (e.g. :Editor) and a vector of method names. Generates wrapper functions for all provided methods in the namespace. For each method, generates a ClojureScript wrapper function that: - Has a kebab-case name with ! suffix (e.g. removeBlock -> remove-block!) - Automatically converts between JS and CLJS data structures - Handles promises appropriately by converting results to CLJS data - Includes detailed documentation Example: (deflogseq-api :Editor ["removeBlock" "insertBlock"]) Generates functions remove-block! and insert-block! that wrap the corresponding methods from logseq.Editor namespace.
(discover-methods ns-kw)
Discover all methods in a Logseq namespace at compile time. Returns a vector of method names as strings.
Example: (discover-methods :Editor) => ["removeBlock" "insertBlock" ...]
Discover all methods in a Logseq namespace at compile time. Returns a vector of method names as strings. Example: (discover-methods :Editor) => ["removeBlock" "insertBlock" ...]
Methods for the :Editor namespace
Methods for the :Editor namespace
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close