Skip to content

Commit 7f8a361

Browse files
authored
Add settings, styling (#29)
* improvement: rewrite/refactor of the modal, more efficient preview * feat(settings): added dummy settings * mostly styling plugin + bugs * all styles apply, bug in function-plot ('after:draw' isnt fired the first time) * + forgot to stage * improvement: Add dummy save button, move build output to . * feat: styling is applied now * fix(version-bump.mjs): remove `../` * fix(ci.yml): fix upload path, trigger * fix(ci.yml): correct upload path
1 parent d6f5ab6 commit 7f8a361

19 files changed

Lines changed: 587 additions & 489 deletions

.github/integrity-check.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { readFileSync } from 'fs'
2+
3+
// read files
4+
let package_ = JSON.parse(readFileSync("package.json", "utf8"));
5+
let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
6+
7+
if (package_.dependencies.obsidian != manifest.minAppVersion) {
8+
console.log("ERROR: obsidian version mismatch");
9+
process.exit(1);
10+
}

.github/workflows/ci.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@ name: CI
22

33
on:
44
push:
5-
pull_request:
5+
branches:
6+
- "**"
67

78
jobs:
89
build:
10+
name: Build ⚙️
911
runs-on: ubuntu-latest
10-
if: github.ref_type == 'branch'
1112
steps:
1213
- uses: actions/checkout@v2
1314

1415
- name: install dependencies
1516
run: yarn install
1617

1718
- name: set development version
18-
run: node version-bump.mjs "dev-$(git rev-parse --short HEAD)"
19+
run: node .github/version-bump.mjs "dev-$(git rev-parse --short HEAD)"
1920

2021
- name: build
2122
run: yarn build
@@ -24,6 +25,19 @@ jobs:
2425
uses: actions/upload-artifact@v3.1.0
2526
with:
2627
name: dist
27-
path: dist/
28+
path: |
29+
manifest.json
30+
main.js
31+
32+
test:
33+
runs-on: ubuntu-latest
34+
name: Test 🧪
35+
steps:
36+
- uses: actions/checkout@v2
37+
38+
- name: test
39+
run: node .github/integrity-check.mjs
40+
41+
2842

2943

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: yarn install
2727

2828
- name: Run version-bump
29-
run: node version-bump.mjs ${{ github.event.release.tag_name }}
29+
run: node .github/version-bump.mjs ${{ github.event.release.tag_name }}
3030

3131
- name: Commit and push changes
3232
run: |
@@ -44,4 +44,4 @@ jobs:
4444
uses: AButler/upload-release-assets@v2.0
4545
with:
4646
repo-token: ${{ github.token }}
47-
files: "dist/main.js;dist/manifest.json"
47+
files: "main.js;manifest.json"

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node_modules/
22
yarn-error.log
3-
dist/
4-
copy.bat
3+
main.js
4+
data.json

manifest.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"id": "obsidian-functionplot",
3-
"name": "Obsidian Functionplot",
4-
"minAppVersion": "0.11.13",
5-
"description": "A plugin for displaying mathematical graphs in obsidian.md.",
6-
"author": "leonhma",
7-
"authorUrl": "https://github.com/leonhma",
8-
"isDesktopOnly": false,
9-
"version": "1.1.1"
10-
}
2+
"id": "obsidian-functionplot",
3+
"name": "Obsidian Functionplot",
4+
"minAppVersion": "0.12.2",
5+
"description": "A plugin for displaying mathematical graphs in obsidian.md.",
6+
"author": "leonhma",
7+
"authorUrl": "https://github.com/leonhma",
8+
"isDesktopOnly": false,
9+
"version": "1.1.0"
10+
}

package.json

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
{
2-
"name": "obsidian-functionplot",
3-
"version": "1.1.1",
4-
"description": "A plugin for displaying mathematical functions in obsidian.md.",
5-
"repository": "https://github.com/leonhma/obsidian-functionplot",
6-
"author": "leonhma",
7-
"license": "MIT",
8-
"private": true,
9-
"scripts": {
10-
"build": "webpack"
11-
},
12-
"devDependencies": {
13-
"copy-webpack-plugin": "^11.0.0",
14-
"sass": "^1.54.4",
15-
"sass-loader": "^13.0.2",
16-
"ts-loader": "^9.3.1",
17-
"typescript": "^4.7.4",
18-
"webpack": "^5.74.0",
19-
"webpack-cli": "^4.10.0"
20-
},
21-
"dependencies": {
22-
"function-plot": "^1.22.9-0",
23-
"obsidian": "^0.11.13"
24-
}
25-
}
2+
"name": "obsidian-functionplot",
3+
"version": "1.1.1",
4+
"description": "A plugin for displaying mathematical functions in obsidian.md.",
5+
"repository": "https://github.com/leonhma/obsidian-functionplot",
6+
"author": "leonhma",
7+
"license": "MIT",
8+
"private": true,
9+
"scripts": {
10+
"build": "webpack"
11+
},
12+
"devDependencies": {
13+
"sass": "^1.54.4",
14+
"sass-loader": "^13.0.2",
15+
"ts-loader": "^9.3.1",
16+
"typescript": "^4.7.4",
17+
"webpack": "^5.74.0",
18+
"webpack-cli": "^4.10.0"
19+
},
20+
"dependencies": {
21+
"function-plot": "^1.22.9-0",
22+
"obsidian": "0.12.2"
23+
}
24+
}

src/PlotFunctionModal.ts

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)