Skip to content

YU000jp/logseq-plugin-hierarchy-tool

Repository files navigation

Logseq Plugin: Hierarchy Tool (TOC)

  • Powerful tool for users who use hierarchy in Logseq.
    1. split by header to provide a workflow for splitting a comprehensive page into sub-pages with increased information content.
    2. A table of contents facility optimised for displaying or splitting comprehensive pages where hierarchies or headers are used!

Warning

This plugin does not work with Logseq db version now. We will fix this plugin so that it works.

Overview

  • Find the page you are looking for by relying on hierarchy, without opening the page.

    Incremental Page Search

    • Page search function. Lists pages that match the text input.

    Page Connection

    • Lists pages related to the currently opened page.
    • Display of links to lower levels (Namespace) and page tags in pop-ups, rather than below the page content.

Table of Contents with Sub-pages

  • Table of contents functionality with integrated sub-pages as well.

    Functions as a zoom-in to a block, rather than scrolling within a page.

  • Support for creating a sub-page and moving blocks

Getting Started

Install from Logseq Marketplace

  • Press [---] on the top right toolbar to open [Plugins]. Select Marketplace. Type sub in the search field, select it from the search results and install.

Usage

  • The button on the toolbar is the first toggle.
    • While the pop-up is displayed, if the user navigates to a page, it switches to the table of contents for that page.

    Initially, this button is hidden by Logseq. This button on the toolbar (アイコン) on the toolbar. Click on it and then click on this image . The 🏢 button will then appear on the toolbar.

  • In the table of contents, the block is opened by zooming in, but within Page Connections, the page does not open directly for moving up or down the hierarchy. (Ctrl+click to open as a page).

Tip

  1. press the ➕ button next to the page name to create a sub-page. Similar page names will be displayed as suggestions.
  2. By Ctrl+clicking on a header in the table of contents, the block with the header and its sub-blocks can be moved to a sub-page.

    Note: After the block has been relocated, the "backgroundcolor" property indicating the block background colour may remain and the colour may not be applied." Go to the "backgroundcolor" page and rename it to "background-colour".

  3. Shortcut to toggle the pop-up (default: Ctrl/Cmd + F1)
  4. Bullet context menu item Promoting a block to a page
    • It can be relocated to a new page, including sub-blocks.

Note

  • Due to content conflicts, the display of hierarchy and page tags in the page content is hidden in the plugin settings beforehand.
  • Sidebars and pop-ups are displayed overlapping. To use the sidebar, close the pop-up.
  • Loading may be slow if the amount of information on the page is too large or if there are too many page embeds in the content.
  • If you have other plug-ins with table of contents functionality, be sure to turn it off.
  • When using this plugin, be sure to turn off the 'Page View UI' functionality of Page-tags and Hierarchy plugin.
  • If using the Side Block plugin, in the plugin settings, add "#.side(-[a-z])? " in the input field.
  • In table of contents
    • Only headers on the first level are detected.
    • For automatic headers, the "heading:: true" property is used. In this case, they are not displayed in there.

Demo

HierarchyTool

Showcase / Questions / Ideas / Help

Go to the Discussions tab to ask and find this kind of things.

TODO

  1. Porting of table of contents functionality
  2. Currently implemented in pop-up view.
  3. Display of subordinate levels within the table of contents
  4. Support for zoomed pages (block zoom instead of scrolling)
  5. Added ability to search for pages using pattern matching by page name. (Incremental Page Search)
  6. add ability to turn blocks with headers into sub-pages (Ctrl-click on header in table of contents) 1.
  7. Added button to create a sub-page.
  8. Added support for displaying a list of page tags and hierarchies (replaces the display of page tags and hierarchies in the page content).
  9. Incremental Page Search in dialog that create sub-page
  10. Shortcut to enable toggling of the pop-up
  11. Sticky Heading Style https://github.com/zhouhua/obsidian-sticky-headings
  12. Adjustments need to be made after the db version of Logseq is released. ("heading:: true" and other properties).

Prior art & Credit