I have organised my notes into a somewhat hierarchical structure using links. Most of my notes contain the following line, with the appropriate replacement:
Topics: [[topic-note-1]] [[topic-note-2]]
For example, in my note for New York
I have the line:
Topics: [[City]] [[USA]]
What I want to obtain is to show a table in the City
and USA
notes that displays a list of sub-topics, i.e. the names of the notes (e.g. New York
) that contain backlinks to the note the table is in. However, I only want to display those notes in which the backlink is in the line starting with “Topics:
” and ignore notes with backlinks present elsewhere in the note.
Additionally, though not essential, it would be great to have a second column in the table which includes the number of sub-sub-topics each sub-topic has, i.e. the number of backlinks (filtered in the same way) that the sub-topic has.
I have been able to obtain this table without the appropriate filtering for backlinks in the “Topics:
” line with the following query:
TABLE WITHOUT ID file.link as Subtopics, length(file.inlinks) as "\# Subsubtopics"
FROM [[#]]
SORT length(file.inlinks) DESC
I have also read a few older posts that Dataview can’t read the contents of a note, so Dataviewjs would have to be used. Not sure if this is still the case.
I am unfamiliar with Dataviewjs and JavaScript in general so any help or pointers to useful documentation would be greatly appreciated (the documentation i found wasn’t very helpful).