mark-when / obsidian-plugin

Markwhen obsidian plugin
MIT License
84 stars 3 forks source link

Curious about why .mw instead of .md #6

Open terrychenzw opened 2 months ago

terrychenzw commented 2 months ago

Appreciate your work for bringing this great tool into Obsidian!

It is powerful tool and simple-to-use. I really like it.

I am very curious about why .mw instead of .md?

In Obsidian, .md can be manipulated by lots of plugins. So i think .md is better then .mw.

brimwats commented 2 months ago

Because Markwhen is a seperate thing; it uses .mw files; it probably predates obsidian?

more: https://markwhen.com

terrychenzw commented 2 months ago

As a Obsidian user, I am looking for a timeline plugin for planning and scheduling for a long time. So when you bring markwhen into Obsidian, I really like it and I think it is the best solution for my needs. So I really appreciate your great work on this.

I think .md is more acceptable than .mv in Obsidian(I mean the file format). As we see the most popular and successful community plugin in Obsidian, Excalidraw. Excalidraw is a power sketching tool first and then brought into Obsidian by Zsolt Viczián. The file format of excalidraw file in Obsidian is .md instead of .excalidraw(the original file format of excalidraw file). Using .md can get a lot of features from Obsidian and many other community plugins.

How to parse .md files as excalidraw in Obsidian? The answer is frontmatter. As we see all excalidraw files in obisidian with below frontmatter.

---
excalidraw-plugin: parsed
---

The other popular plugins use the similar way.

kanban plugin:

---
kanban-plugin: basic
---

markmind plugin:

---

mindmap-plugin: basic
---

Above plugins are using .md as the file format in Obsidian.

Markwhen plugin has enormous potential to be popular in Obsidian. So I highly recommond you guys to consider using .md as the file format for markwhen files. (export .mw for using outside Obsidian just like what excalidraw plugin did)

Again, thanks for your great work!

saeedesmaili commented 1 month ago

On a related note, neither the title nor the content of the .mw files are returned in the obsidian search results (same with Omnisearch plugin, no results when I search for a note I created with mark-when plugin). I wonder if it is because Obsidian doesn't recognize them as notes, but as files. On the other hand, when searching for the notes created by excalidraw, I can find them using Omnisearch plugin, probably because the notes are stored as .md files behind the scene:

image
ulasfo commented 1 month ago

On a related note, neither the title nor the content of the .mw files are returned in the obsidian search results (same with Omnisearch plugin, no results when I search for a note I created with mark-when plugin). I wonder if it is because Obsidian doesn't recognize them as notes, but as files. On the other hand, when searching for the notes created by excalidraw, I can find them using Omnisearch plugin, probably because the notes are stored as .md files behind the scene: image

Well if you were to check the omnisearch plugin you can see that the file population is done via "this.app.vault.getFiles" with an added filter

https://github.com/scambier/obsidian-omnisearch/blob/f6b63537c237d1119f8665e5b12ea6a17b3d447e/src/main.ts#L209-L220

I have checked if the obsidian detects the .mw files same way using the following

files = Array.from(app.vault.getFiles())
files.forEach(file => {if(file.name.split('.').slice(-1)[0].contains('mw')){console.log(file)}})

and getting the confirmation I checked the code over omnisearch for the filter behaviour the and it leads to the following:

https://github.com/scambier/obsidian-omnisearch/blob/f6b63537c237d1119f8665e5b12ea6a17b3d447e/src/notes-indexer.ts#L40-L42

resim

Red marks are unintended, so the solution is either enabling "index paths of unsupported files" which will index paths of any and all files without looking at the extensions, while this will index the path of .mw files, the content will not be indexed and paths of files with other extensions such as .mp4, .jpg etc. will be indexed which might be an unwanted side effect

or adding mw to the additional TEXT files to index.

https://github.com/scambier/obsidian-omnisearch/blob/f6b63537c237d1119f8665e5b12ea6a17b3d447e/src/cache-manager.ts#L111C1-L116C6

with the second option above check will turn true, which will read the contents and upload to the cache

ulasfo commented 1 month ago

I have confirmed that adding mw to the additional TEXT files to index column and reloading the omnisearch plugin does indeed index the contents of the mw files.

I have created a mw file with some content as follows

resim

and with web api turned on I have queried file from web which turned up

resim