joplin-plugin-math-mode 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Caleb John
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # Math Mode
2
+ A plugin for inputting and evaluating math in markdown code blocks. It's built on top of the excellent [mathjs](https://mathjs.org/), meaning it can be used to perform symbolic calculation, vector math and can even handle units!
3
+
4
+ So what can it do? It's better to demonstrate with an example.
5
+
6
+ ![Screenshot of using math mode to plan a road trip](https://github.com/CalebJohn/joplin-math-mode/blob/main/examples/euro_trip.png)
7
+
8
+
9
+ Try some of these!
10
+
11
+ = derivative('x^2 + x', 'x')
12
+
13
+ = 5cm + 0.2 m in inch
14
+
15
+ = i^2
16
+
17
+ = 10.15 USD to CAD
18
+
19
+ ```math
20
+ M = [1, 3; 4, 6]
21
+
22
+ size(M)
23
+ transpose(M)
24
+ diag(M)
25
+ det(M)
26
+ ```
27
+
28
+ ```math
29
+ combinations(6, 3)
30
+ permutations(6, 3)
31
+ ```
32
+
33
+ View all examples in [the examples folder](https://github.com/CalebJohn/joplin-math-mode/blob/main/examples). If you have an example of your own, please consider adding it to the examples directory, or sending it my way to have added. Thanks!
34
+
35
+ Plus [many more functions](https://mathjs.org/docs/reference/functions.html) provided by mathjs.
36
+
37
+
38
+ # Installation
39
+ - Go to `Tools -> Options -> Plugins`
40
+ - Search for "Math Mode" in the search box
41
+ - Click Install and restart Joplin
42
+
43
+ # Configuration
44
+ Math Mode supports a small number of settings that can be adjusted by placing a "config line" inside a math block. The defaults can be changed under Tools -> Options -> Math Mode (Preferences on MacOS). The supported settings are (defaults listed first):
45
+
46
+ ```math
47
+ global: no | yes
48
+ simplify: no | yes
49
+ bignumber: no | yes
50
+ displaytotal: no | yes
51
+ hide: no | expression | result
52
+ verbose: yes | no
53
+ inline: yes | no
54
+ notation: auto | exponential | engineering | fixed
55
+ precision: Any number between 0 and 16
56
+ align: left | right
57
+ ```
58
+
59
+ Where
60
+ `global` determines if the following settings (within the same block) will apply to all the following blocks (and code lines).
61
+
62
+ `simplify` will direct the math engine to simplify rather than solve expressions. This does not work with most expressions so use with caution.
63
+
64
+ `bignumber` will us the mathjs [`BigNumber`](https://mathjs.org/docs/datatypes/bignumbers.html) with 128 bit precision. `bignumber` and `simplify` are incompatible.
65
+
66
+ `displaytotal` rather than showing the result of a line, showing the running total of the block.
67
+
68
+ `hide` will hide either a math expression or result.
69
+
70
+ `verbose` determines if just the result of the expression should be shown, or the variable name as well.
71
+
72
+ `inline` should the result be placed on the same line as the expression, or below.
73
+
74
+ `notation` passed to the [mathjs format function](https://mathjs.org/docs/reference/functions/format.html#where), this is the numerical format to use for results.
75
+
76
+ `precision` the number of decimal places to show, 0 to show all. See [mathjs docs](https://mathjs.org/docs/reference/functions/format.html).
77
+
78
+ `align` place the result on the left or right of the editor window.
79
+
80
+ # Roadmap
81
+ ### TODO
82
+ - [ ] Add a markdown-It renderer plugin to get the output on both views
83
+ - [x] Add syntax or a method for sum calculations
84
+ - [x] Add configuration to settings menu
85
+
86
+ ### Ideas
87
+ There is no plan to implement any of these ideas, but there might be eventually.
88
+ - [ ] Support input in latex format (and maybe in $...$)
89
+ - Maybe also support just saving math into a latex format (this is easier with mathjs)
90
+ - [ ] Fix math mode greedily highlighting after \`\`\`math (probably need a custom mode)
91
+
92
+
93
+ ---
94
+
95
+
96
+ Inspired by [literate-calc-mode](https://github.com/sulami/literate-calc-mode.el) for emacs by [sulami](https://github.com/sulami)
97
+
98
+ Thanks to the European Central Bank for [providing daily exchange rates](https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html)
99
+
100
+ This project uses icons (without modification) which are provided free under the [CC BY 4.0 License](https://fontawesome.com/license/free) by the Font Awesome project.
@@ -0,0 +1,29 @@
1
+ # Basic
2
+ ## Road Trip
3
+ An example of using the calculations while planning. A basic plugin using simple arithmetic across multiple code blocks.
4
+ ![example of planning a road trip](./road_trip.png)
5
+
6
+ ## Monthly Budget
7
+ An example showing the usage of the `total` variable. Any continuous block of calculations will be added together into a `total`. This example also demonstrates the `displaytotal` config option.
8
+ ![example of a monthly budget](./monthly_budget.png)
9
+
10
+ ## What I Owe Mom
11
+ Another `total` example that demonstrates the explicit addition and summation syntax for the `total` variable.
12
+ ![example of splitting bills](./what_i_owe_mom.png)
13
+
14
+ ## Euro Trip
15
+ Example that demonstrates the use of currency conversion. Also uses the `total` variable to sum up the daily cost of a trip.
16
+ ![example of foreign trip planning]('./euro_trip.png)
17
+
18
+
19
+ # Advanced
20
+ ## Burger
21
+ An example of a recipe with a configurable number of portions, demonstrating unit handling and some settings.
22
+ ![burger recipe with math blocks](./burger.png)
23
+
24
+ ## Compound Interest
25
+ An example that uses math to demonstrate the power of compound interest. This example demonstrates some of the more advanced features of mathjs.
26
+ ![compound interest calculations](./compound_interest.png)
27
+
28
+
29
+
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "joplin-plugin-math-mode",
3
+ "version": "0.5.3",
4
+ "homepage": "https://github.com/CalebJohn/joplin-math-mode",
5
+ "description": "",
6
+ "scripts": {
7
+ "dist": "webpack --joplin-plugin-config buildMain && webpack --joplin-plugin-config buildExtraScripts && webpack --joplin-plugin-config createArchive",
8
+ "prepare": "npm run dist",
9
+ "update": "npm install -g generator-joplin && yo joplin --update"
10
+ },
11
+ "keywords": [
12
+ "joplin-plugin",
13
+ "calculator",
14
+ "mathjs"
15
+ ],
16
+ "license": "MIT",
17
+ "devDependencies": {
18
+ "@types/node": "^14.0.14",
19
+ "chalk": "^4.1.0",
20
+ "copy-webpack-plugin": "^6.1.0",
21
+ "fs-extra": "^9.0.1",
22
+ "glob": "^7.1.6",
23
+ "on-build-webpack": "^0.1.0",
24
+ "tar": "^6.0.5",
25
+ "ts-loader": "^7.0.5",
26
+ "typescript": "^3.9.3",
27
+ "webpack": "^4.43.0",
28
+ "webpack-cli": "^3.3.11",
29
+ "yargs": "^16.2.0"
30
+ },
31
+ "dependencies": {
32
+ "mathjs": "^8.1.1"
33
+ }
34
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "extraScripts": [
3
+ "mathMode.ts",
4
+ "exchangeRate.ts"
5
+ ]
6
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "id": "plugin.calebjohn.MathMode",
4
+ "app_min_version": "1.8",
5
+ "version": "0.5.3",
6
+ "name": "Math Mode",
7
+ "description": "Turn your notes into a powerful calculator with inline math.",
8
+ "author": "Caleb John",
9
+ "homepage_url": "https://github.com/CalebJohn/joplin-math-mode#readme",
10
+ "repository_url": "https://github.com/CalebJohn/joplin-math-mode",
11
+ "keywords": [
12
+ "calculator",
13
+ "math",
14
+ "mathjs"
15
+ ],
16
+ "_publish_hash": "sha256:4b790d5e91c44a3a2739e63711b2ecd6a74ae0943fcfddfe3382d450fc9ce1be",
17
+ "_publish_commit": "main:fc3e1fe29428081143e85b7e41127a66f772bd3e"
18
+ }