Collapse namespace prefixes

There are two ways to do namespaces, adding type:: book to every page that describes a book or adding it to the page title, like described here. The latter can be searched for, using:

#+BEGIN_QUERY 
{:title [:h2 "📚 Books Namespace"]
:query [:find (pull ?page [*])
:in $ ?ns
:where
  [?page :block/name ?title]
  [(clojure.string/starts-with? ?title ?ns)] ]
 :inputs [ "book/" ]
}
#+END_QUERY

It will find all pages called book/book title (not Book/book title!).

It’s not optimal, but it’s a start.

PS, welcome @egfrenzy!

2 Likes