tree_item
<%
const linkClass = `type-${note.type}` + (activeNote.noteId === note.noteId ? " active" : "");
const isExternalLink = note.hasLabel("shareExternal");
const linkHref = isExternalLink ? note.getLabelValue("shareExternal") : `./${note.shareId}`;
const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : "";
%>
<% if (note.noteId !== subRoot.note.noteId) { %>
>
<% if (note.hasVisibleChildren()) { %><% } %>
<%= note.title %>
<% } %>
<% if (note.hasVisibleChildren()) { %>
<% note.getVisibleChildNotes().forEach(function (childNote) { %>
<%
const hasChildren = childNote.hasVisibleChildren();
const isAncestorOfActive = ancestors.some(p => p === childNote.noteId);
const expandedClass = isAncestorOfActive ? " expanded" : "";
%>
-
<%- include('tree_item', {note: childNote, subRoot: subRoot}) %>
<% }) %>
<% } %>