I just checked and, yes, IndexRawMarkdownSource
is enabled on both Macs. Bug?
Iâm still running into this issue (and another related issue, which Iâll detail below). @BLUEFROG, any insight / updates on whether this is a bug?
The related issue is that, for some reason I havenât been able to discern, it seems that front-matter attributes (which correctly indexed by turning on enabling IndexRawMarkdownSource
) seem to âdisappearâ over time. From time to time I will search for notes based on the notetype
front-matter attribute and find that not all notes are showing up. That is, if I have 5 notes which all have notetype=ABC
, searching for notes with notetype = ABC returns only 3, say.
Does editing the files fix this issue? Do you edit them with DEVONthink To Go or external editors too?
No, editing doesnât seem to fix the issue. To be honest, though, I havenât spent much time trying to reproduce the issue. I will see if I can reproduce the issue with a test database tonight and will post here any "lessons learnedâ
I use Typora to edit all my notes.
As an aside: It would be super useful (to me, at least) if I were able to display front-matter attributes as columns in the various search and other âlistâ views. Not sure how practical this is from an implementation standpoint, but DT already has the various front-matter attributes âon handâ (since it is indexing them) and so, he said hopefully, might it be possible to allow front-matter attributes to be exposed similar to âcustom metadataâ?
A quick test shows the answer to the question âDoes editing the files fix this issue?â is âYesâ.
Below is a screenshot showing all notes on SwiftUI, where all notes that have the blue SwiftUI icon have front-matter attribute notetype: code/swiftui
.
Searching for all notes with search text notetype:code/swiftui*
returns only two results:
The second result (Convert SVG to inline CSS form) doesnât have notetype: code/swiftui
but instead has notetype: code/css
. Seems the âfront-matter indexing getting lostâ issue is more widespread than Iâd thought. And it has incorrectly indexed the note with notetype: code/css
as matching notetype: code/swiftui
.
After editing two files (All SwiftUI property wrappers edited within DT, and Options for custom navigation in SwiftUI edited within Typora), both files now correctly show up in a search for notetype:code/swiftui
.
Rebuilding the database works, but is a temporary solution as the âdecayâ slowly returns. And, rebuilding the database is not ideal (for me, at least) since the DB UUID changes, which breaks a number of Keyboard Maestro macros that move notes (and which which refer to the DB UUID). This is a small annoyance (since the UUID is defined in a single place in KM), though, and can âworkâ for now.
Further background on my setup:
- DT version: v3.9.6 Pro Edition
- Two Macs:
- 16" MacBook Pro M1 Max (Apple Silicon), 32GB RAM
- 27" iMac 5K 2019 (Intel), 96GB RAM
- macOS: Sonoma 14.5 on both Macs
Maybe the hidden preference wasnât enabled in case of older notes?
The search syntax is invalid, nodetype
is not a valid prefix. Try "nodetype code css"
instead.
Currently, this is not possible nor planned. Why donât you actually use custom metadata as that is supported for displaying as columns?
search text
notetype:code/swiftui*
In addition to the previous comments, the frontmatter is not actual metadata; itâs just text. So the proper search in your case would be text:"notetype: code/swiftui"
.
@BLUEFROG Thanks for correcting my mindunderstanding of searching for indexed front-matter attribs⌠I will use the pattern text:"notetype: code/swiftui"
in future.
I have code which I use to parse my notes which is able to extract notetype
(et al) from Markdown notes, and will see if I can create a Smart Rule which copies the value (from the Markdown front-matter attribute) into a âregularâ DT custom metadata field.
That should be fairly simple to do⌠maybe.
Works perfectly. DEVONthink truly is an amazing piece of software. DTâs comprehensive AppleScript interface is superbâI cannot think of any other piece of sofware that I have that is as âopenâ to automation.
The approach used is as follows:
- When Markdown files are modified their front-matter is parsed and the
notetype
attribute value extracted - The
notetype
value is stored into the âNote Typeâ (mdnotetype
) custom metadata value. - This is automated by a Smart Rule that runs on save and also every one minute. It needs to run every minute to pick up files that have been modified outside of DT (since I mostly edit Markdown notes using Typora).
I now have, essentially, all of what I was looking for:
- Note Type can be displayed as a column
mdnotetype
can be used to rapidly + precisely search for notes of specific types- I can work purely with Markdown and the Smart Rule automatically updates the
mdnotetype
value if I change the type of a note (which I sometimes do as I work).
Below is a (admittedly contrived) search for all notes whose Note Type contains code/s
whose names contain the word create
:
And now my previous search for notes of type code/swiftui
finds all of the notes (instantly):
It would be (very) cool if DEVONthink could watch for files that are modified externally and allow a Smart Rule to trigger âUpon Modification Externallyâ. For my own code I use the Witness Swift package to monitor the filesystem for modified files and trigger updates in response.
Weâll consider this for future releases.