scambier / obsidian-omnisearch

A search engine that "just works" for Obsidian. Supports OCR and PDF indexing.
GNU General Public License v3.0
1.18k stars 58 forks source link

[Feature request] Support Iconize Plugin #400

Open acrylicus opened 1 week ago

acrylicus commented 1 week ago

Is your feature request related to a problem? Please describe.

My job requires a lot of multicloud, unfortunately a lot of the terminology is shared across cloud providers (I.e. VPC in both GCP + AWS). So I use Iconize to keep track of things for quick-glance stuff, i.e. the AWS icon for VPC is very different to the GCP icon for VPC. Currently omnisearch does not include the icons

Describe the solution you'd like

To give you an idea, this is how I have my notes structured:

image

But in the search they all show up like this

image

Would be great if it looked like this

image

Describe alternatives you've considered

For now I just read the file path to work it out, which is fine, but having the actual icon show up would be great

Additional context

Screenshots above.

To be clear its not just VPC, there are lots of examples (i.e. AWS Privatelink, Azure Privatelink, IAM is used on all 3, Load balancers, KMS etc etc)

acrylicus commented 2 days ago

@scambier any chance you can weigh in on whether you think this is something you will put some time into? I can have a crack at it if not (though I am a shit coder lol)

scambier commented 2 days ago

Iconize has a work-in-progress API, which looks like it doesn't (yet?) have a function to get an icon from a path: see here and there.

It's certainly possible to do without it - basically replicate what Iconize is doing -, but I'd rather rely on a stable API.

acrylicus commented 2 days ago

Good spot @scambier - I will keep my eyes peeled for the release of the API. Looks to be coming soon from their most recent commit.

acrylicus commented 2 days ago

Hi @scambier - in lieu of the API can we not just use the data.json file in the plugin folder?

❯ cat data.json | head -40
{
  "settings": {
    "migrated": 6,
    "iconPacksPath": ".obsidian/icons",
    "fontSize": 16,
    "emojiStyle": "native",
    "iconColor": null,
    "recentlyUsedIcons": [
      "AwResAmazonVPCEndpoints48",
      "AwResAmazonVPCNetworkAccessAnalyzer48",
      "AwResAmazonVPCReachabilityAnalyzer48",
      "LiWheat",
      "LiCandyCane"
    ],
    "recentlyUsedIconsSize": 5,
    "rules": [],
    "extraMargin": {
      "top": 0,
      "right": 4,
      "bottom": 0,
      "left": 0
    },
    "iconInTabsEnabled": true,
    "iconInTitleEnabled": true,
    "iconInTitlePosition": "inline",
    "iconInFrontmatterEnabled": true,
    "iconInFrontmatterFieldName": "icon",
    "iconColorInFrontmatterFieldName": "iconColor",
    "iconsBackgroundCheckEnabled": true,
    "iconsInNotesEnabled": true,
    "iconsInLinksEnabled": true,
    "iconIdentifier": ":",
    "lucideIconPackType": "native",
    "debugMode": false
  },
  "Project Notes/Customers": "OcPersonFill16",
  "Tech Notes/GCP": "SiGooglecloud",
  "Tech Notes/Fortinet": "SiFortinet",
  "Tech Notes/Azure": "SiMicrosoftazure",
  "Tech Notes/AWS": "FabAws",
<...>
❯ cat data.json | tail -20
  "Tech Notes/AWS/Networking & Content Delivery/VPC/Reachability Analyzer.md": {
    "iconName": "AwResAmazonVPCReachabilityAnalyzer48"
  },
  "Tech Notes/AWS/Networking & Content Delivery/VPC/Network Access Analyzer.md": {
    "iconName": "AwResAmazonVPCNetworkAccessAnalyzer48"
  },
  "Tech Notes/AWS/Networking & Content Delivery/VPC/Endpoints": "AwResAmazonVPCEndpoints48",
  "Tech Notes/AWS/Networking & Content Delivery/VPC/Endpoints/Endpoints Overview.md": {
    "iconName": "AwResAmazonVPCEndpoints48"
  },
  "Tech Notes/AWS/Networking & Content Delivery/VPC/Endpoints/Gateway Endpoints.md": {
    "iconName": "AwResAmazonVPCEndpoints48"
  },
  "Tech Notes/AWS/Networking & Content Delivery/VPC/Endpoints/Interface Endpoints.md": {
    "iconName": "AwResAmazonVPCEndpoints48"
  }
}%
acrylicus commented 2 days ago

I have managed to get this working :)

image

I have created a pull request here https://github.com/scambier/obsidian-omnisearch/pull/405