mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
Compare commits
5 Commits
1.0.5-test
...
1.0.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1a92695d5 | ||
|
|
370e35182b | ||
|
|
634bbc2165 | ||
|
|
a2dd13049e | ||
|
|
a64c6e5335 |
31
README.md
31
README.md
@@ -1,22 +1,35 @@
|
||||
## Obsidian Excalidraw Plugin
|
||||
The Obsidian-Excalidraw plugin integrates [Excalidraw](https://excalidraw.com/), a feature rich sketching tool, into Obsidian. You can store and edit Excalidraw files in your vault and you can transclude drawings into your documents. For a showcase of Excalidraw features, please read my blog post [here](https://www.zsolt.blog/2021/03/showcasing-excalidraw.html).
|
||||
|
||||

|
||||

|
||||
|
||||
### Key features
|
||||
- The plugin adds 3 commands to the command palette. 1) To create a new drawing. 2) To find and edit existing drawings in your vault, and 3) to transclude a drawing into a document.
|
||||
- The plugin adds 3 commands to the command palette.
|
||||
- To create a new drawing.
|
||||
- To find and edit existing drawings in your vault, and
|
||||
- To embed (transclude) a drawing into a document.
|
||||
- You can also use the file explorer in your vault to open Excalidraw files.
|
||||
- You can set up a default folder for saving new drawings in Settings.
|
||||
- You can set up a Template by creating a drawing, customizing it the way you like it, and specifying the file as the template in settings.
|
||||
- The plugin saves drawings to your vault as a file with the .excalidraw file-extension.
|
||||
- You can set the size of embedded image using the [[image.excalidraw|100]] or [[image.excalidraw|100x100]] format.
|
||||
- Open settings to set up a default folder for new drawings.
|
||||
- Set up a Template by creating a drawing, customizing it the way you like it, and specifying the file as the template in settings.
|
||||
- The plugin saves drawings to your vault as a file with the *.excalidraw* file extension.
|
||||
- You can customize the size of embedded image using the [[image.excalidraw|100]] or [[image.excalidraw|100x100]] format.
|
||||
|
||||
### How to?
|
||||
- Add a library: Click [browse libraries](https://libraries.excalidraw.com/?target=_excalidraw&sort=default) in Excalidraw. Download the preferred library and close browser tab. Click Load library in Excalidraw-Obsidian to load your locally saved library.
|
||||
#### Part 1: Intro to Obsidian-Excalidraw - Start a new drawing (3:12)
|
||||
[](https://youtu.be/i-hIfY-Ecjg)
|
||||
#### Part 2: Intro to Obsidian-Excalidraw - Basic features (6:06)
|
||||
[](https://youtu.be/-dk7pvdl-H0)
|
||||
#### Part 3: Intro to Obsidian-Excalidraw - Advanced features (3:26)
|
||||
[](https://youtu.be/2cKlEwo8WU0)
|
||||
#### Part 4: Intro to Obsidian-Excalidraw - Setting up a template (1:45)
|
||||
[](https://youtu.be/oNPYZEpmuJ8)
|
||||
#### Part 5: Intro to Obsidian-Excalidraw - Stencil Library (3:16)
|
||||
[](https://youtu.be/rLx-9FvlzgI)
|
||||
#### Part 6: Intro to Obsidian-Excalidraw: Embedding drawings (2:08)
|
||||
[](https://youtu.be/JQeJ-Hh-xAI)
|
||||
|
||||
### Known issues
|
||||
- When inserting images from the library, sometimes these images appear out of view. You’ll need to select “scroll to view” at the bottom of the screen. This is a bug in Excalidraw. The Excalidraw development team has successfully reproduced the bug and promised to resolve it in the next update of Excalidraw.
|
||||
- On iPad: As you draw left to right it opens left sidebar. Draw right to left, opens right sidebar. Draw down, opens commands palette. So seems open is emulating the gestures, even when drawing towards the center. I have raised the problem with the Obsidian.md team, and Licat promised to resolve this issue in the next Obsidian release.
|
||||
- On iPad: As you draw left to right it opens left sidebar. Draw right to left, opens right sidebar. Draw down, opens commands palette. So seems open is emulating the gestures, even when drawing towards the center. I understand that the issue will be resolved in the next release of Obsidian mobile.
|
||||
|
||||
### Excalidraw in Obsidian
|
||||
https://user-images.githubusercontent.com/14358394/115386872-3fc8d180-a1da-11eb-9366-16d0e064932a.mp4
|
||||
|
||||
3
esbuild.config.json
Normal file
3
esbuild.config.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"minify": true
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.5",
|
||||
"minAppVersion": "0.11.13",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"author": "Zsolt Viczian",
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@excalidraw/excalidraw": "0.6.0",
|
||||
"aakansha-excalidraw": "0.7.0-ccp",
|
||||
"@excalidraw/excalidraw": "0.7.0",
|
||||
"react": "17.0.1",
|
||||
"react-dom": "17.0.1",
|
||||
"react-scripts": "4.0.1"
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import {
|
||||
TextFileView,
|
||||
WorkspaceLeaf,
|
||||
TFile,
|
||||
} from "obsidian";
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
//import Excalidraw, {exportToSvg} from "@excalidraw/excalidraw";
|
||||
import Excalidraw, {exportToSvg} from "@excalidraw/excalidraw";
|
||||
import { ExcalidrawElement } from "@excalidraw/excalidraw/types/element/types";
|
||||
import { AppState,LibraryItems } from "@excalidraw/excalidraw/types/types";
|
||||
import Excalidraw, {exportToSvg } from "aakansha-excalidraw";
|
||||
import {
|
||||
AppState,
|
||||
LibraryItems
|
||||
} from "@excalidraw/excalidraw/types/types";
|
||||
import {
|
||||
VIEW_TYPE_EXCALIDRAW,
|
||||
EXCALIDRAW_FILE_EXTENSION,
|
||||
@@ -16,7 +17,6 @@ import {
|
||||
EXCALIDRAW_LIB_HEADER,
|
||||
} from './constants';
|
||||
import ExcalidrawPlugin from './main';
|
||||
import { THEME_FILTER } from "@excalidraw/excalidraw/types/constants";
|
||||
|
||||
export default class ExcalidrawView extends TextFileView {
|
||||
private getScene: any;
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { App, FuzzySuggestModal, TFile, TFolder, normalizePath, Vault, TAbstractFile, Instruction } from "obsidian";
|
||||
import {
|
||||
App,
|
||||
FuzzySuggestModal,
|
||||
TFile
|
||||
} from "obsidian";
|
||||
import ExcalidrawPlugin from './main';
|
||||
import {EMPTY_MESSAGE,EXCALIDRAW_FILE_EXTENSION} from './constants';
|
||||
import {
|
||||
EMPTY_MESSAGE,
|
||||
EXCALIDRAW_FILE_EXTENSION
|
||||
} from './constants';
|
||||
|
||||
export enum openDialogAction {
|
||||
openFile,
|
||||
@@ -12,7 +19,6 @@ export class OpenFileDialog extends FuzzySuggestModal<TFile> {
|
||||
private plugin: ExcalidrawPlugin;
|
||||
private action: openDialogAction;
|
||||
|
||||
|
||||
constructor(app: App, plugin: ExcalidrawPlugin) {
|
||||
super(app);
|
||||
this.app = app;
|
||||
@@ -22,7 +28,6 @@ export class OpenFileDialog extends FuzzySuggestModal<TFile> {
|
||||
command: "Type name of drawing to select.",
|
||||
purpose: "",
|
||||
}]);
|
||||
|
||||
|
||||
this.inputEl.onkeyup = (e) => {
|
||||
if(e.key=="Enter" && this.action == openDialogAction.openFile) {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import {App, PluginSettingTab, Setting} from 'obsidian';
|
||||
import {
|
||||
App,
|
||||
PluginSettingTab,
|
||||
Setting
|
||||
} from 'obsidian';
|
||||
import type ExcalidrawPlugin from "./main";
|
||||
|
||||
export interface ExcalidrawSettings {
|
||||
@@ -9,8 +13,8 @@ export interface ExcalidrawSettings {
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: ExcalidrawSettings = {
|
||||
folder: 'excalidraw',
|
||||
templateFilePath: '',
|
||||
folder: 'Excalidraw',
|
||||
templateFilePath: 'Excalidraw/Template.excalidraw',
|
||||
width: '400',
|
||||
library: `{"type":"excalidrawlib","version":1,"library":[]}`,
|
||||
}
|
||||
@@ -32,7 +36,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
|
||||
.setName('Excalidraw folder')
|
||||
.setDesc('Default location for your Excalidraw drawings. Leaving this empty means drawings will be created in the Vault root.')
|
||||
.addText(text => text
|
||||
.setPlaceholder('excalidraw')
|
||||
.setPlaceholder('Excalidraw')
|
||||
.setValue(this.plugin.settings.folder)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.folder = value;
|
||||
@@ -45,7 +49,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
|
||||
'Note that Excalidraw files will have an extension of ".excalidraw" ' +
|
||||
'Assuming your template is in the default excalidraw folder, the setting would be: excalidraw/Template.excalidraw')
|
||||
.addText(text => text
|
||||
.setPlaceholder('excalidraw')
|
||||
.setPlaceholder('Excalidraw/Template.excalidraw')
|
||||
.setValue(this.plugin.settings.templateFilePath)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.templateFilePath = value;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
{
|
||||
"1.0.2": "0.11.13",
|
||||
"1.0.1": "0.11.13",
|
||||
"1.0.0": "0.11.13"
|
||||
"1.0.5": "0.11.13"
|
||||
}
|
||||
@@ -2156,10 +2156,10 @@
|
||||
"resolved" "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz"
|
||||
"version" "4.2.2"
|
||||
|
||||
"aakansha-excalidraw@0.7.0-ccp":
|
||||
"integrity" "sha512-/RQBh8x9WBmuwT2xebmQnktJlPkD58eLuc9D8wT4bL1X+mf4q5jK6TF4YxUUn2qbyvHVunHenz+N9Z6Az5bB/w=="
|
||||
"resolved" "https://registry.npmjs.org/aakansha-excalidraw/-/aakansha-excalidraw-0.7.0-ccp.tgz"
|
||||
"version" "0.7.0-ccp"
|
||||
"aakansha-excalidraw@0.7.0-draft":
|
||||
"integrity" "sha512-bafyy/qQES3E+uI7YHGuMzIh2kKlTKx+NYYpHwR5QhdAdDsA+Tru56Yglo+8cLCSDncN/KyEb1ffQlYJyBqQwA=="
|
||||
"resolved" "https://registry.npmjs.org/aakansha-excalidraw/-/aakansha-excalidraw-0.7.0-draft.tgz"
|
||||
"version" "0.7.0-draft"
|
||||
|
||||
"abab@^2.0.3", "abab@^2.0.5":
|
||||
"integrity" "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q=="
|
||||
|
||||
Reference in New Issue
Block a user