Skip to content

hermannsorgel/Logseq-Slasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slasher

Logseq Slasher

The opinionated page remover for Logseq.

Every day I delete multiple pages in Logseq DB. First, I create pages, tags, or properties to test some ideas. Then I have to clean things up.

There are three annoying things about deleting pages:

  1. I have to use my mouse and click through multiple UI menus.
  2. After deleting the current page, Logseq jumps to the journal/home page — while I usually prefer to return to the previous page.
  3. If a page was created from another block with [[syntax]], removing the page won't remove that block — it becomes an orphan, a regular text node.

This plugin adds a /delete this page command that solves exactly these issues:

  1. Deletes the current page.
  2. Jumps to the previous page.
  3. Removes all blocks referencing the removed page, if they contain no other data besides the reference.

Pages are deleted without asking for confirmation. If user accidentally deletes a page, ⌘+z will restore it. Nevertheless, it is easy to lose data with Slasher, so please make regular backups.

The plugin works with Logseq DB (0.11.x) and MD (0.10.x).

Demo

demo.mov

Instalation

  • Turn on Logseq developer mode in Settings -> Advanced
  • Download the slasher-plugin.zip from the Releases page
  • Unzip the file and load the unzipped folder from Logseq plugins page

If

If you also struggle with deleting pages, but do not want to install another plugin, or just do not like my approach, try this query:

{:query [:find (pull ?page [:block/name :block/tags])
         :in $ ?start
         :where
         (or-join [?tag]
           [?tag :block/name "page"]
           [?tag :block/name "property"]
           [?tag :block/name "tag"]
         )
         [?page :block/tags ?tag]
         [?page :block/created-at ?created]
         [(> ?created ?start)] 
 ]
 :inputs [:-1d-start]
}

It will show all recently created pages. With bulk actions in Logseq DB it's easy to delete unwanted pages.

About

The opinionated page remover for Logseq.

Resources

License

Stars

Watchers

Forks

Packages

No packages published