For O_O, I’m super excited to be working on a plugin for Obsidian.
My plugin is called Stenography-Obsidian, and it basically links the Stenography API with Obsidian.
Features:
- highlight any code in Obsidian
- press the Stenography button
- the API will replace the code block with a simple English explanation/docstring of what the code does and it guesses the language the code block is written in as well (see demo below)
Learnings:
- the plugin starter boilerplate is awesome
- getting selected text from the Obsidian editor is a breeze!
const editor = this.app.workspace.getActiveViewOfType(MarkdownView)?.editor;
const selectedText = editor.getSelection(); // Get selected text
-
fetch
is built in (I got stuck in an axios hole for a while, but @shabegom helped me get unstuck, thank you!)
Github: