You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While you are offering a great list of usefull snippets via the predefined snippets, I enjoy managing my snippets in files. The good thing: That is possible in your add-on via the "load snippets from file" switch. Now to my issue:
I enjoy managing those snippets in the same app in which I use them, so in this case obsidian. Thus, I keep them in a markdown file. Which means: The layout of those is a bit annoying. Ideally, what I would like to do is to have my file simply in the format
1. ```js
2. // my snippets in here
3. ```
So via a js-code block which contains the snippets.
I think this should not be much work, since it only requires to wrap a reggex around the file to obtain the layout you presumably are using?
A great imporvement in the snippet file management would be (in my opinion -- surely there are other opinions) to allow for multiple snippet files and also to offer an option to link snippet files in the file properties (instead of just the global settings). For example, a header as
---
snippets: ["[[Link to snippet file 1]]" , "[[Link to snippet file 2]]"]
---
could tell the add on based on which files to compose the snippet data base to actually use. (I think this could even be done by allowing a number of snippet files, each is globally loaded by the global settings, and the preamble merely deals as a "tag" in the snippets DB which snippets are active in the current file)
I hope not to overwhelm with this lengthy message and hope that some of my thoughts trigger your interest! And that you don't read this for the gizillions time now 😄
Cheers and thanks again for the great add on!
Drom
PS: As a little cherry on top I am less sure how easy or not the following is: To structure the snippets not only in one massive code block, but to have multiple code blocks that are also placed in different sections of an md file. This would make organization simpler, like having a file
01. # My Snippets
02. ## General
03. ```js
04. // some snippets
05. ```
06. ## More Specific Snippets
07. ```js
08. // some snippets
09. ```
10. ## etc
I guess this should still be feasible by a check, that first checks whether its an md file containing code blocks and conditioned on this then extracts all code blocks (via a simple reggex) and then merges their contents (merge issues due to inconsistencies will be the problem of the user).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey and many thanks for a great add-on!
While you are offering a great list of usefull snippets via the predefined snippets, I enjoy managing my snippets in files. The good thing: That is possible in your add-on via the "load snippets from file" switch. Now to my issue:
I enjoy managing those snippets in the same app in which I use them, so in this case obsidian. Thus, I keep them in a markdown file. Which means: The layout of those is a bit annoying. Ideally, what I would like to do is to have my file simply in the format
So via a js-code block which contains the snippets.
I think this should not be much work, since it only requires to wrap a reggex around the file to obtain the layout you presumably are using?
A great imporvement in the snippet file management would be (in my opinion -- surely there are other opinions) to allow for multiple snippet files and also to offer an option to link snippet files in the file properties (instead of just the global settings). For example, a header as
could tell the add on based on which files to compose the snippet data base to actually use. (I think this could even be done by allowing a number of snippet files, each is globally loaded by the global settings, and the preamble merely deals as a "tag" in the snippets DB which snippets are active in the current file)
I hope not to overwhelm with this lengthy message and hope that some of my thoughts trigger your interest! And that you don't read this for the gizillions time now 😄
Cheers and thanks again for the great add on!
Drom
PS:
As a little cherry on top I am less sure how easy or not the following is: To structure the snippets not only in one massive code block, but to have multiple code blocks that are also placed in different sections of an md file. This would make organization simpler, like having a file
I guess this should still be feasible by a check, that first checks whether its an md file containing code blocks and conditioned on this then extracts all code blocks (via a simple reggex) and then merges their contents (merge issues due to inconsistencies will be the problem of the user).
Beta Was this translation helpful? Give feedback.
All reactions