Two small enhancements that could make evaluated code blocks more useful:
feat: Enhance sci eval-string and clojure code eval-result by darwis059 · Pull Request #7287 · logseq/logseq · GitHub opens the ability to create buttons that call the Logseq API, which is awesome. It would be even more awesome if:
- There was a way to hide the code, so you could create UI elements without having to look at the source code for them. For instance, perhaps the results appear above the code with the option to hide the code by collapsing it.
selectelements. This would allow creating dynamic queries that can be parameterized using user selections. Currently, a
selectelement created using Hiccup won’t work because clicking on it will enter edit mode for the code block.
^:hiccup [:select [:option "one"] [:option "two"]]
Try interacting with the select and you will instead enter edit mode.