Collapse namespace prefixes

try to reindex, then close the app and restart. it should say it detected a custom.js then ask for permission to run it => grant the permission.

I’m risking being pedantic and splitting hairs here, but I think there might be something useful to distinguish between here: I think namespaces serve best as contexts that are narrow enough to unambiguously resolve a name to a particular concept. That’s slightly different from a “type”. Sometimes the namespace will match the type, but sometimes it won’t. Here are two contrasting examples:

  1. Namespace and type happen to line up:

    • Book/Matilda could be a name which refers to the book “Matilda”, while Movie/Matilda could be a name which refers to the movie of the same name.
    • In the context of the concept Book, Matilda refers to one thing, while in the context of the concept Movie, Matilda refers to another.
    • As it happens, Book/Matilda is a book, while Movie/Matilda is a movie.
  2. Namespace and type don’t line up, and that’s okay, too:

    • Acme/Org Structure could be a name which refers to the organizational structure in the Acme Company, while Globex/Org Structure could be a name which refers to the organizational structure in the Globex Corporation.
    • In the context of the concept Acme, Org Structure refers to one thing, while in the context of the concept Globex, Org Structure refers to another.
    • But in both cases, the “type” of the entity the name refers to is an organizational structure. Acme/Org Structure is not "an Acme", and Globex/Org Structure is not "a Globex".

All of which is to say: I think both namespaces and type::s are useful, for separate (if often overlapping) things. I haven’t seen much (or maybe anything?) use type:: yet, but a simple use might be a plugin which puts an icon in front of each link based on the link’s type. You’d expect to see something like:

  • :blue_book: [[Book/Matilda]]
  • :movie_camera: [[Movie/Matilda]]
  • :busts_in_silhouette: [[Acme/Org Structure]]
  • :busts_in_silhouette: [[Globex/Org Structure]]

(And having written all of that out, I now really want to write that plugin.) :slight_smile:

1 Like

Following up: Awesome Links does this! It uses the property page-type:: by default, though I’ve changed that to type:: for myself because I like it a little better. Then links to those pages inherit the icon:: of those pages’ types.

2 Likes

Just discovered this from another thread, do we have a way to support relative url when creating namespaced page references? Is this possible with logseq plugin api?

Like when you type [[./Ideas]] from [[CoolProject]], it will automatically expand to [[Cool Project/Ideas]]?

I’ve found I often need to do this, as there are usually multiple projects that I have to create sub pages for.