Skip to content

Commit

Permalink
Merge pull request #122 from Cerecero/patch-1
Browse files Browse the repository at this point in the history
Update Plugins 02 - Build a mind map plugin.md
  • Loading branch information
logseq-cldwalker committed May 8, 2024
2 parents 6ec6852 + 8edaf11 commit 2d01b41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/Plugins 02 - Build a mind map plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
```html
<script src="https://cdn.jsdelivr.net/npm/@logseq/libs/dist/lsplugin.user.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/regenerator-runtime"></script>
<script src="https://cdn.jsdelivr.net/npm/mind-elixir/dist/mind-elixir.js"></script
<script src="https://cdn.jsdelivr.net/npm/mind-elixir/dist/mind-elixir.js"></script>
```
- The `@logseq/libs` should be obvious. We will use async/await in our JavaScript, hence the regenerator-runtime is needed. Finally, we load the wonderful mind-elixir library to actually draw our mind map.
## Build the Map
Expand Down Expand Up @@ -86,4 +86,4 @@
- `logseq.Editor` includes APIs to interact with the Logseq editor and `getCurrentPageBlocksTree` is a powerful one to get back all the blocks of the current page as a tree structure. The tree of blocks is a fundamental data structure of Logseq, with which you can do many powerful things in your plugin.
- After we get back the blocks tree, we just walk the whole tree and use the elixir-mind APIs to build a connected mind map. The details are not relevant here and are therefore left out. Feel free to check the finished code. Also, load the plugin in your Logseq app and enjoy the beautiful mind map generating from your pages!
## Conclusion
- In this guide, we walk through building a simple but powerful mind map plugin for Logseq. While the plugin APIs are still work-in-progress, they can already do many powerful things. We invite you to hack them with your imagination. Feedbacks are super welcomed - we will improve the plugin APIs through listening to your voices!
- In this guide, we walk through building a simple but powerful mind map plugin for Logseq. While the plugin APIs are still work-in-progress, they can already do many powerful things. We invite you to hack them with your imagination. Feedbacks are super welcomed - we will improve the plugin APIs through listening to your voices!

0 comments on commit 2d01b41

Please sign in to comment.