dominiclet / obsidian-note-definitions

Obsidian plugin for seamless viewing of personal definitions
MIT License
79 stars 4 forks source link

Specify in a note which definitions to use #45

Closed jwir3 closed 3 months ago

jwir3 commented 3 months ago

There are times when I'm using a very technical set of terms, such as when writing notes about Computer Graphics topics, that have general words used in a very specific way. For example, intensity is a word that has a very specific meaning in Computer Graphics.

It would be nice if I could add specific tags to definition files such that any notes with those tags would use that definition file, and notes without those tags would ignore definitions in that file.

dominiclet commented 3 months ago

That's a good idea, I'll look into implementing that

TjeerdA commented 3 months ago

Thanks! One more small enhancement: Now we have to click to get rid of the pop-up. Now, I use the definition quite a lot I notice that that is suboptimal, especially with many terms on a page. It is better to remove the pop-up after leaving the defined word with the cursor. Is that possible?

dominiclet commented 3 months ago

@TjeerdA yes that's possible, I actually started with that implementation, but found it rather annoying that the popover closes the second my mouse leaves the word. I could add an option for that. I'll create another issue to track this.

TjeerdA commented 3 months ago

:-)

Sent with Sparkhttps://sparkmailapp.com/source?from=signature On Jun 28, 2024 at 14:51 +0200, dominiclet @.***>, wrote:

@TjeerdAhttps://github.com/TjeerdA yes that's possible, I actually started with that implementation, but found it rather annoying that the popover closes the second my mouse leaves the word. I could add an option for that. I'll create another issue to track this.

— Reply to this email directly, view it on GitHubhttps://github.com/dominiclet/obsidian-note-definitions/issues/45#issuecomment-2196836623, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD4AECNFYBSCIFI3JAO4GO3ZJVL5RAVCNFSM6AAAAABJOK3KQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJWHAZTMNRSGM. You are receiving this because you were mentioned.Message ID: @.***>

dominiclet commented 3 months ago

@jwir3 I've just released this feature in 0.17.0, implemented by way of specifying the definition file paths in the properties of the note. Details can be found in the updated README, which I copy here for easy reference:

Definition context

TLDR: "Context" is synonymous with a definition file. By specifying a context, you specify that you want to use specific definition file(s) to source your definitions for the current note.

Definition context refers to the repository of definitions that are available for the currently active note. By default, all notes have no context (you can think of this as being globally-scoped). This means that your newly-created notes will always have access to the combination of all definitions defined in your definition files.

This behaviour can be overridden by specifying the "context" of your note. Each definition file that you have is taken to be a separate context (hence your definitions should be structured accordingly). Once context(s) are declared for a note, it will only retrieve definitions from the specified contexts. You can think of this as having a local scope for the note. The note now sees only a limited subset of all your definitions.

Usage

To easily add context to your note:

  1. Use the Add definition context command
  2. Search and select your desired context

You can do this multiple times to add multiple contexts.

How it works

Add definition context adds to the properties of your note. Specifically, it adds to the def-context property, which is a List type containing a list of file paths corresponding to the selected definition files. In source, it will look something like this:

---
def-context:
    - definitions/def1.md
    - definitions/def2.md
---

You can edit your properties directly, although for convenience, it is recommended to use the Add definition context command to add contexts as it is easy to get file paths wrong.

Removing contexts

To remove contexts, simply remove the file path from the def-context property. Or if you want to remove all contexts, you can delete the def-context property altogether.

TjeerdA commented 3 months ago

Super, this makes the plugin a lot better!

Best,

Tjeerd

Sent with Sparkhttps://sparkmailapp.com/source?from=signature On Jun 30, 2024 at 09:38 +0200, dominiclet @.***>, wrote:

@jwir3https://github.com/jwir3 I've just released this feature in 0.17.0, implemented by way of specifying the definition file paths in the properties of the note. Details can be found in the updated README, which I copy here for easy reference:

Definition context

TLDR: "Context" is synonymous with a definition file. By specifying a context, you specify that you want to use specific definition file(s) to source your definitions for the current note.

Definition context refers to the repository of definitions that are available for the currently active note. By default, all notes have no context (you can think of this as being globally-scoped). This means that your newly-created notes will always have access to the combination of all definitions defined in your definition files.

This behaviour can be overridden by specifying the "context" of your note. Each definition file that you have is taken to be a separate context (hence your definitions should be structured accordingly). Once context(s) are declared for a note, it will only retrieve definitions from the specified contexts. You can think of this as having a local scope for the note. The note now sees only a limited subset of all your definitions.

Usage

To easily add context to your note:

  1. Use the Add definition context command
  2. Search and select your desired context

You can do this multiple times to add multiple contexts.

How it works

Add definition context adds to the properties of your note. Specifically, it adds to the def-context property, which is a List type containing a list of file paths corresponding to the selected definition files. In source, it will look something like this:


def-context:

You can edit your properties directly, although for convenience, it is recommended to use the Add definition context command to add contexts as it is easy to get file paths wrong.

Removing contexts

To remove contexts, simply remove the file path from the def-context property. Or if you want to remove all contexts, you can delete the def-context property altogether.

— Reply to this email directly, view it on GitHubhttps://github.com/dominiclet/obsidian-note-definitions/issues/45#issuecomment-2198467290, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD4AECN5GOXOJVQDYG3GFY3ZJ6YYPAVCNFSM6AAAAABJOK3KQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGQ3DOMRZGA. You are receiving this because you were mentioned.Message ID: @.***>

dominiclet commented 2 months ago

Thanks! One more small enhancement: Now we have to click to get rid of the pop-up. Now, I use the definition quite a lot I notice that that is suboptimal, especially with many terms on a page. It is better to remove the pop-up after leaving the defined word with the cursor. Is that possible?

@TjeerdA just an update, this has been implemented in 0.20.0

jwir3 commented 2 months ago

Thanks! I appreciate it. I'm going to install it right now.

TjeerdA commented 2 months ago

Super. I've seen the results. Works better for me now.

I some times have a corrupt definition file. It is easy to restore with an extra or so. I'll inform you when I can reproduce it reliably (if it still occurs).

Best,

Tjeerd

Sent with Sparkhttps://sparkmailapp.com/source?from=signature On Jul 7, 2024 at 18:55 +0200, Scott Johnson @.***>, wrote:

Thanks! I appreciate it. I'm going to install it right now.

— Reply to this email directly, view it on GitHubhttps://github.com/dominiclet/obsidian-note-definitions/issues/45#issuecomment-2212507790, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD4AECJPDP734IMB4C7266DZLFXHZAVCNFSM6AAAAABJOK3KQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJSGUYDONZZGA. You are receiving this because you were mentioned.Message ID: @.***>