raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.18k stars 2.88k forks source link

[iA Writer] Feature request: Search results to show markdown preview ala Bear #12968

Open gacharles23 opened 2 months ago

gacharles23 commented 2 months ago

Extension

https://www.raycast.com/xvvhang/raycast-ia-writer

Description

Thank you for building this extension!

Is there any possibility that the search feature could be enhanced to function a bit more like the Bear extension search?

If so, that would be amazing! Thank you for the consideration.

raycast-bear-1 raycast-bear-2 raycast-bear-3

Who will benefit from this feature?

No response

Anything else?

No response

raycastbot commented 2 months ago

Thank you for opening this issue!

🔔 @xvvhang you might want to have a look.

💡 Author and Contributors commands The author and contributors of `xvvhang/raycast-ia-writer` can trigger bot actions by commenting: - `@raycastbot close this issue` Closes the issue. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopens the issue. - `@raycastbot assign me` Assigns yourself to the issue. - `@raycastbot good first issue` Adds the "Good first issue" label to the issue. - `@raycastbot keep this issue open` Make sure the issue won't go stale and will be kept open by the bot.
xvvhang commented 2 months ago

@gacharles23 Thanks for your feedback! The extension uses iA Writer's URL Schema to achieve search feature which is quite different from Bear's API (Bear uses a sqlite to store data so it's more functional). But I've have a look at iA Writer's documents and what we can do to make the extension more functional.😀

xvvhang commented 2 months ago

@gacharles23 iA Writer provides only two data commands: read or write a single file. There's no way to make it happen to search the library with URL commands. I'll find out if we could make it with other solutions like a light weight database or something else. @raycastbot keep this issue open

gacharles23 commented 2 months ago

Yeah, that's unfortunate. I suppose I was thinking that the function could work more like the Raycast inbuilt Search Files command. That command searches files by Name and Contents (or just Name) across all files and folders. And it displays a list of files on the left, and on the right a Preview section and a Metadata section.

The issues with the Search Files function are:

  1. You can't restrict it to a directory (e.g. the iA Writer iCloud path)
  2. It lists all filetypes, not just markdown
  3. The preview displays raw text, not nicely formatted markdown

So rather than trying to build something iA Writer specific that would be severely limited by the two URL commands offered, perhaps a more generic version can be built that simply reads markdown files in a given directory -- an enhanced version of Search Files.

I suppose such a plugin would probably be useful not just for iA Writer, but any app dealing with disk-based markdown notes (e.g. Panda, Obsidian, Typora, iA Writer, ...). Although the actions would likely need to be app specific (e.g. Open file in xyz). Hmm ... maybe not. Perhaps just an Open command, and the user can pre-decide which app opens .md files.

In any case, thank you for giving this consideration.

xvvhang commented 2 months ago

@gacharles23 Great idea. It would be the best if we could configure Raycast's search file command (filter file types and preview files). I just send a feedback to Raycast about it.