obsidian-time-ruler
obsidian-time-ruler copied to clipboard
Path grouping should [optionally] select the last directory
Describe the solution you'd like
I have deep directory paths, ending in something like .../projects/[project]/[taskNote]
. However, currently the project will group by one of the first directories instead of [project]
. It would therefore be very nice to have a toggle or define the depth of the directory to group by. For example, having 1, would select [project]
as it's its parent directory, 2, would select projects
its grandparent and so forth.
Describe alternatives you've considered
Currently I've made two rather crude edits to accomplish this, in the function parseFolderFromPath
I've added:
if ((path2.match(/\//g) || []).length > 1 )
s = path2.split("/");
path2 = s.slice(s.length - 2).join("/");
and in the function splitHeading
I've added:
if ((heading.match(/\//g) || []).length > 1 ) {
h = heading.split("/")
heading = h.slice(h.length - 2).join("/")
}
However, these overrule the current implementation. The simple solution is thus instead a toggle between this or the current implementation.