mirror of
https://github.com/rooyca/obsidian-api-request.git
synced 2026-07-22 07:50:27 +00:00
Merge branch 'Rooyca:master' into master
This commit is contained in:
commit
fcf72913ba
6 changed files with 43 additions and 3 deletions
|
|
@ -128,6 +128,24 @@ show: {0-2-1} -> address -> city
|
|||
```
|
||||
~~~
|
||||
|
||||
You can access the last element using `{-1}`...
|
||||
|
||||
~~~markdown
|
||||
```req
|
||||
url:https://api.modrinth.com/v2/project/distanthorizons
|
||||
show: game_versions -> {-1}
|
||||
```
|
||||
~~~
|
||||
|
||||
... or get the length of the array using `{len}`.
|
||||
|
||||
~~~markdown
|
||||
```req
|
||||
url:https://api.modrinth.com/v2/project/distanthorizons
|
||||
show: game_versions -> {len}
|
||||
```
|
||||
~~~
|
||||
|
||||
To access multiple elements at the same time when using `{..}` use `&` to separate the keys and use `.` to access the values.
|
||||
|
||||
~~~markdown
|
||||
|
|
|
|||
|
|
@ -128,6 +128,24 @@ show: {0-2-1} -> address -> city
|
|||
```
|
||||
~~~
|
||||
|
||||
Puedes acceder al último elemento usando `{-1}`...
|
||||
|
||||
~~~markdown
|
||||
```req
|
||||
url:https://api.modrinth.com/v2/project/distanthorizons
|
||||
show: game_versions -> {-1}
|
||||
```
|
||||
~~~
|
||||
|
||||
... o obtener la cantidad de elementos usando `{len}`.
|
||||
|
||||
~~~markdown
|
||||
```req
|
||||
url:https://api.modrinth.com/v2/project/distanthorizons
|
||||
show: game_versions -> {len}
|
||||
```
|
||||
~~~
|
||||
|
||||
To access multiple elements at the same time when using `{..}` use `&` to separate the keys and use `.` to access the values.
|
||||
|
||||
~~~markdown
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "api-request",
|
||||
"name": "APIRequest",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.5",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Fetch data from APIs or other sources. Responses in JSON, MD or HTML directly in your notes.",
|
||||
"author": "rooyca",
|
||||
|
|
|
|||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "api-request",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "api-request",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.5",
|
||||
"description": "Fetch data from APIs or other sources. Responses in JSON, MD or HTML directly in your notes.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -337,6 +337,10 @@ export default class MainAPIR extends Plugin {
|
|||
} else {
|
||||
el.createEl("strong", { text: "Error: {..} used on non-array element" });
|
||||
}
|
||||
} else if (part == "{-1}") {
|
||||
result = current[current.length - 1]
|
||||
} else if (part == "{len}") {
|
||||
result = current.length.toString()
|
||||
} else if (part === "{gk}") {
|
||||
Object.keys(current).forEach((key) => {
|
||||
traverse(key, idx + 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue