Shortcuts CRUD for an organic JSON database #83
Teggui
started this conversation in
Shortcut-files and shortcuts
Replies: 1 comment
-
example: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's exactly as indicated in the title. These shortcuts will help you manage a extensive knowledge base in JSON format and update and reuse it from anywhere in the vault.
First of all, I want to thank jon-heard for this Obsidian plugin, obsidian-inline-scripts, because it's wonderful. It gave me the opportunity to work on something I've needed for a long time and enhances my study and learning.
On the other hand, I would like to apologize for two things: the code is in Spanish because I'm a Spanish speaker, and I know that using English is better for collaboration, but I'm already burnt out. I also apologize for any bad practices in the JavaScript code because I'm a C# developer, and it's a bit tedious for me.
An example of what I built with these shortcuts:
__
^sfile setup$
__
pathMyData = "D:\GDrive\NotasObsidian\MisNotas\MisNotas\Scripts\miData.json";
__
Setup this shortcut-file
__
post ([^ ]+) (.+)$
__
__
Guarda y reemplaza el valor de una clave de json
$1 clave, $valor
__
get ([^ ]+)$
__
__
Recupera valor de una clave json
$1 = clave
__
get ([^ ]+) ([^ ]+)$
__
__
Recupera valores en un rango ejemplo: c.1 - c.3 => retorna valores de c1, c2, c3.
también puede recorrer c.1.1 - c.2.1 => retorna valores de c1.1, c.1.2 , c2.1
$1 = clave desde $2 = clave hasta
__
put ([^ ]+) (.+)$
__
__
Appendea texto en una clave o la crea
$1 clave $2 valor
__
del ([^ ]+)$
__
__
Elimina clave
$1 clave
__
move ([^ ]+) ([^ ]+)$
__
__
Mueve la clave1 a la clave2
$1 clave origen
$2 clave destino
__
copy ([^ ]+) ([^ ]+)$
__
__
Copia la clave1 a la clave2
$1 clave origen
$2 clave destino
Beta Was this translation helpful? Give feedback.
All reactions