Generate explicit hierarchy out of properties

Here is a quick workaround:

  • Find this line in the code:
        const roots = pgRoots.get(nodeconfig);
    
  • Replace it with these lines:
        const curpage = (div.dataset.page === "current") && logseq.api.get_current_page();
        if (curpage) curpage["original-name"] = curpage.originalName;
        const roots = (curpage) ? [curpage] : pgRoots.get(nodeconfig);
    
  • Add this macro inside file config.edn, inside macros{}:
    :curpagetree "<div class='kit pagetree' data-kit='pagetree' data-node-prep='$1' data-node-prop='$2' data-leaf-prep='$3' data-leaf-prop='$4' data-page='current'>pagetree</div>"
    
  • Visit the desired page
    • e.g. man1
  • Use the macro, either in the page or on the right sidebar
    • e.g. {{curpagetree from, parent}}
      • the result of the example:
        image
1 Like