Skip to content

Commit 5f588e3

Browse files
code updates
1 parent 7b9ca2f commit 5f588e3

20 files changed

+5589
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build.bat
2+
node_modules
3+
.vscode
4+
dist

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v23.3.0

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,65 @@
11
# circuit-sketcher-obsidian-plugin
22
A plugin for Obsidian to draw circuits on a canvas.
3+
4+
## Table of Contents
5+
6+
- [Features](#features)
7+
- [Installation](#installation)
8+
- [Usage](#usage)
9+
- [License](#license)
10+
11+
## Features
12+
13+
- Draw and edit circuit diagrams directly within Obsidian.
14+
- Save and load circuit designs.
15+
- Customizable library for circuit elements.
16+
- Responsive design with automatic resizing.
17+
18+
## Installation
19+
20+
1. Clone the repository:
21+
```sh
22+
git clone https://github.com/code-forge-temple/circuit-sketcher-obsidian-plugin.git
23+
```
24+
25+
2. Navigate to the project directory:
26+
```sh
27+
cd circuit-sketcher-obsidian-plugin
28+
```
29+
30+
3. Set the Node.js version:
31+
- For Unix-based systems:
32+
```sh
33+
nvm use
34+
```
35+
- For Windows:
36+
```sh
37+
nvm use $(cat .nvmrc)
38+
```
39+
40+
4. Install dependencies:
41+
```sh
42+
npm install
43+
```
44+
45+
5. Build the project:
46+
```sh
47+
npm run build
48+
```
49+
50+
## Usage
51+
52+
1. Copy the contents of the `./dist` folder (it contains the `circuit-sketcher` folder) into `<your Obsidian vault location>/.obsidian/plugins/`.
53+
2. Open Obsidian and go to `Settings``Community Plugins`. If you do not see `Circuit Sketcher`, press the `Installed plugins` refresh button, then activate the plugin.
54+
3. Use the ribbon icon or command palette to create a new circuit sketcher file.
55+
4. Start drawing your circuit on the canvas:
56+
- On the canvas, right-click to show the canvas menu, and select `Create Node`.
57+
- Right-click on the node to show the node menu, and select `Change Image` and select an image relevant to your circuit node.
58+
- Right-click on the node to show the node menu, and select `Add Port` and select the port location and type.
59+
- You can rename the circuit node label or port label by double-clicking on the label. The port or port label can also be deleted (right-click on the port to show the port menu and go from there).
60+
- After you are satisfied with your changes to the circuit node, and if you wish to save the circuit node to be able to reuse it in the current or a different `.circuit-sketcher` file, you can right-click on the circuit node and press `Save Node to Library` (this will update the root Obsidian vault `circuit-sketcher.lib` file).
61+
- You can reuse the node by right-clicking on the canvas and selecting `Add Node from Library`.
62+
- The connections between circuit nodes can be done by drag-and-dropping one port to the destination port (if it is a compatible port).
63+
64+
## License
65+
This project is licensed under the GNU General Public License v3.0. See the [LICENSE](LICENSE) file for more details.

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
import tseslintPlugin from "@typescript-eslint/eslint-plugin";
5+
import tseslintParser from "@typescript-eslint/parser";
6+
import reactHooks from "eslint-plugin-react-hooks";
7+
import reactRefresh from "eslint-plugin-react-refresh";
8+
9+
export default tseslint.config(
10+
{ ignores: ["dist"] },
11+
{
12+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
13+
files: ["**/*.{ts,tsx}"],
14+
languageOptions: {
15+
ecmaVersion: 2020,
16+
globals: globals.browser,
17+
parser: tseslintParser,
18+
},
19+
plugins: {
20+
"@typescript-eslint": tseslintPlugin,
21+
"react-hooks": reactHooks,
22+
"react-refresh": reactRefresh,
23+
},
24+
rules: {
25+
...reactHooks.configs.recommended.rules,
26+
"react-refresh/only-export-components": [
27+
"warn",
28+
{ allowConstantExport: true },
29+
],
30+
"max-len": ["error", { code: 250 }],
31+
indent: ["error", 4, { SwitchCase: 1 }],
32+
"@typescript-eslint/no-explicit-any": "off",
33+
"no-trailing-spaces": "error", // Disallow trailing spaces
34+
"no-multi-spaces": "error", // Disallow multiple spaces
35+
"no-irregular-whitespace": "error", // Disallow irregular whitespace
36+
"space-in-parens": ["error", "never"], // Enforce spacing inside parentheses
37+
"space-before-function-paren": ["error", "always"], // Enforce spacing before function parenthesis
38+
"comma-spacing": ["error", { before: false, after: true }], // Enforce spacing after commas
39+
"object-curly-spacing": ["error", "never"], // Enforce spacing inside curly braces
40+
},
41+
}
42+
);

manifest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": "circuit-sketcher",
3+
"name": "Circuit Sketcher",
4+
"version": "1.0.0",
5+
"minAppVersion": "0.15.0",
6+
"description": "A plugin for Obsidian to draw circuits on a canvas, based on circuit-sketcher-core.",
7+
"author": "Code Forge Temple",
8+
"authorUrl": "https://github.com/code-forge-temple",
9+
"isDesktopOnly": true
10+
}

0 commit comments

Comments
 (0)