Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamRiddell committed Aug 23, 2023
0 parents commit e9aebb0
Show file tree
Hide file tree
Showing 68 changed files with 14,200 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
tab_width = 4
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
main.js
31 changes: 31 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": {
"node": true
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "none"
}
],
"@typescript-eslint/ban-ts-comment": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [LiamRiddell]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ['https://www.buymeacoffee.com/liamriddell']
83 changes: 83 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build obsidian plugin

on:
push:
tags:
- "*"

env:
PLUGIN_NAME: obsidian-solve

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm i
# WILL NOT WORK YET
# - name: Build Ohm Bundles
# run: npm run ohm
- name: Build Project
id: build
run: |
npm run build
mkdir ${{ env.PLUGIN_NAME }}
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
ls
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload zip file
id: upload-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PLUGIN_NAME }}.zip
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
asset_content_type: application/zip
- name: Upload main.js
id: upload-main
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./main.js
asset_name: main.js
asset_content_type: text/javascript
- name: Upload manifest.json
id: upload-manifest
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./manifest.json
asset_name: manifest.json
asset_content_type: application/json
- name: Upload styles.css
id: upload-css
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./styles.css
asset_name: styles.css
asset_content_type: text/css
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Intellij
*.iml
.idea

# npm
node_modules

# Don't include the compiled main.js file in the repo.
# They should be uploaded to GitHub releases instead.
main.js

# Exclude sourcemaps
*.map

# obsidian
data.json

# Exclude macOS Finder (System Explorer) View States
.DS_Store
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tag-version-prefix=""
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tabWidth": 4,
"useTabs": true,
"semi": true,
"bracketSameLine": false,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "always"
}
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"orta.vscode-jest"
]
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"request": "launch",
"args": [
"test",
"--",
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"runtimeExecutable": "npm"
}
]
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"prettier.configPath": "",
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"javascript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "non-relative",
"jest.jestCommandLine": "npm run test --",
"jest.rootPath": "."
}
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<img src="internal/banner_beta.png" width="100%" />

<p align="center">
<img width="900px" src="internal/screenshot.png"/>
</p>

## Obsidian Solve

![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/LiamRiddell/obsidian-solve?style=for-the-badge&sort=semver)

An unobtrusive Obsidian plugin that quietly processes equations and patterns in real time, inspired by [NoteMaster's Smart Mode](https://github.com/LiamRiddell/NoteMaster#introducing-smart-mode). With solid engineering at its core, Solve enhances note-taking without relying on ChatGPT. For instance, effortlessly calculates date expressions (e.g., 'Now + 20 days'), performs arithmetic (e.g., '10 + 5'), and more features are coming soon.

### Arithmetic Brilliance 💡

Unveil the magic of arithmetic with Solve, where simplicity meets precision. Brace yourself for seamless calculations that redefine your note-taking.

| You Express | Solve Delivers |
| ------------------ | -------------- |
| 10 + 20 / 200 \* 4 | 10.40 |
| 50 / 2 | 25.00 |
| 50 divide by 2 | 25.00 |

### Dynamic Date Mastery 📅

Step into the realm of dates with Solve, where time manipulation is at your fingertips. Experience dates like never before.

| You Express | Solve Delivers |
| --------------------- | --------------------------------- |
| days since 01/01/2023 | 233 days |
| 01/01/2023 + 20 days | Sat Jan 21 2023 00:00:00 GMT+0000 |
| 01/01/2023 - 2 months | Tue Nov 01 2022 00:00:00 GMT+0000 |

But wait, there's more! Visit [our documentation](https://github.com/LiamRiddell/obsidian-solve/wiki) for an extensive list of patterns that Solve can seamlessly recognize. It's time to embrace the future of note-taking precision. 📚✨

## Embark on a Feature-Rich Journey 🚀🌟

Our feature list is a testament to the dynamic capabilities we offer to enhance your note-taking experience. Let's take a glimpse into what awaits:

- **Arithmetic Enrichment:** Navigate through the realms of basic arithmetic, explore intricate mathematical functions, and traverse the vectors' landscape. An upcoming addition to this family is the captivating realm of Hex arithmetic.

- **Datetime Delve (Alpha):** Dive into the world of time manipulation with our Datetime feature, currently in its alpha stage. Explore this exciting capability and stay tuned for its evolution.

- **Percentages on the Horizon:** The horizon shines with the promise of percentage calculations, coming soon to further elevate your analytical prowess.

- **Units of Measurement (Coming Soon):** Prepare to unravel the mysteries of units of measurement as we bring this functionality to Solve in the near future.

- **Community Collaboration:** Engage in collaborative innovation with our Community Provider Support. Join forces with fellow creators to extend Solve's potential.

- **Aesthetic Harmony:** Immerse yourself in the harmony of aesthetics with theming support through the Obsidian [Style Settings Plugin](https://github.com/mgmeyers/obsidian-style-settings/) by [@mgmeyers](https://github.com/mgmeyers). Your notes, your style.

Obsidian Solve is a canvas of endless possibilities. As we continue to evolve, we eagerly await your requests to shape the future functionalities of this powerful plugin. Come, explore, and shape the future with us! 🌟🔮

## Effortless Installation Magic ✨

Embarking on your Obsidian Solve journey is as enchanting as it is rewarding. Get ready to experience installation in a whole new light.

### Automated Elegance

Why settle for the mundane when you can bask in automated brilliance? Our **recommended** approach to installation is a seamless experience you won't want to miss:

- Head to the community plugins browser within Obsidian.
- Search for "Obsidian Solve."
- Click "Install." Feel the thrill as your journey unfolds effortlessly.

### Manual Marvel

For those who relish a touch of manual marvel, we've got you covered:

- Delve into your plugin adventure by copying over `main.js`, `styles.css`, and `manifest.json` to your vault. Find your vault at `VaultFolder/.obsidian/plugins/your-plugin-id/`.
- Revel in the satisfaction of crafting your journey step by step.

Choose your path, embark on your voyage, and embrace the enchantment that is Obsidian Solve! 🪄📜

## Gratitude Galore 🙌

A colossal shoutout to the forces that fuel our innovation! We extend our heartfelt appreciation to the brilliance behind:

- [Ohm-js](https://ohmjs.org/): The backbone of our precision, powering the magic of parsing and calculations. Your genius propels us forward.
- [Obsidian MD](https://obsidian.md/): The nurturing ground that breathes life into our vision, elevating it to new heights.

Join us in raising a virtual toast to these pillars of progress! 🥂🌟

## Embrace the Legacy 🌟

As we bid farewell, a tale of revival and innovation lingers in the air. Obsidian Solve emerged from the ashes of a fading concept known as NoteMaster Smart Mode, rekindled by the remarkable canvas that is Obsidian. A fusion of past and present, it's a journey that evokes passion and purpose.

**Gratitude Unbound 🙏**

To each user, feedback bearer, and contributor: our hearts overflow with appreciation. Your dedication fuels our drive, guiding us toward excellence. The praise and critiques alike, they shape our evolution.

**Forge Ahead Together 🚀**

In this collaborative odyssey, we beckon you to consider supporting us. Your contribution isn't just about finance; it's a gesture that breathes life into dreams. With your backing, Obsidian Solve can flourish, realizing its full potential.

As we part ways for now, remember that every note, every calculation, and every moment of interaction is a testament to the power of innovation and community. Until we meet again on this adventurous road, keep soaring, keep calculating, and keep embracing the boundless future of note-taking. 📝✨
42 changes: 42 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import builtins from "builtin-modules";
import esbuild from "esbuild";
import process from "process";

const prod = process.argv[2] === "production";

const context = await esbuild.context({
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins,
],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "main.js",
drop: prod ? ["console", "debugger"] : [],
minifySyntax: prod ? true : false,
minify: prod ? true : false,
});

if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}
Binary file added internal/banner_beta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added internal/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e9aebb0

Please sign in to comment.