Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit e9ef9eb

Browse files
authored
Add refresh command (#4)
1 parent 9c4e263 commit e9ef9eb

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "emera",
33
"name": "Emera",
4-
"version": "1.4.1",
4+
"version": "1.4.2",
55
"minAppVersion": "1.6.5",
66
"description": "Enables you to use custom React components and inline JavaScript, kinda like MDX.",
77
"author": "OlegWock",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-emera",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"description": "MDX for Obsidian. Kinda.",
55
"main": "main.js",
66
"scripts": {

src/plugin.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { App, MarkdownView, Plugin, PluginManifest } from 'obsidian';
1+
import { App, MarkdownView, Notice, Plugin, PluginManifest } from 'obsidian';
22
import { SettingTab } from './settings';
33
import { loadUserModule } from './bundler';
44
import { EMERA_ROOT_SCOPE } from './consts';
@@ -64,6 +64,15 @@ export class EmeraPlugin extends Plugin {
6464
this.resolveComponentsLoaded();
6565
this.refreshEditors();
6666
});
67+
68+
this.addCommand({
69+
id: 'refresh',
70+
name: 'Refresh user module',
71+
callback: async () => {
72+
await this.refreshUserModule();
73+
new Notice('User module was reloaded.');
74+
},
75+
});
6776
}
6877

6978
refreshEditors = () => {

0 commit comments

Comments
 (0)