Curl namespace hierarchy name on journal page by default

Hello,

The problem with namespaces workflow is that hierarchy names tend to get ridiculously long. Example:

School/Class/Spanish/Unit 2/Section A/Numbers

So, when you are using a journal and want to add a note to the “Numbers” in “Section A” there are 3 issues:

  1. This is very tedious to type.
  2. This takes a lot of the space on the journal page
  3. They are very long page names

For the issue number 2, we can curl the namespace by default, to something like this:
<<Numbers
And when you hover on “<<” the entire namespace hierarchy is displayed

Lemme know what you think, and how would you solve issue number 1 and 3.

Hi, I would love to see better namespace handling (like clickable hierarchies/abbreviations in the page title).

In the meantime, this is how I deal with it:

  1. Use abbreviations ( eg p/ instead of project/ )
  2. Try to use page properties ( eg year:: [[2023]], subject:: [[spanish]] ) instead of putting it in the namespace
  3. Use page aliases (alias:: ) to quickly reference pages.
  4. Make an index page (in your case “school/spanish” and put the rest of the hierarchy in the page content.

In general, I do not think a super deep & detailed hierarchy is really worth the hassle (or will ever be Logseq’s strength), I use only max 2 levels + page name.

as a workaround you could add this to your graph custom.js file:

1 Like

Thanks, but this does not work on the page title for me, only page references in the content.
Is it possible to have it target the page title too?

yes its possible but the code doesn’t support that usecase. I could take a look into implementing it on the weekend.

That would be amazing… i am generally fine with long links in the content, but the page title sometimes takes up way too much space (especially on mobile, can be multiple rows).

For issue 1, you should be able to just type numbers and get a list of pages, including the full namespace you are looking for. Maybe less useful if you have 20 pages with the name numbers… just saying in theory you shouldn’t need to type the full name.

For issue 2, you can use an alias either as suggested by @fegfeg or inline as [alias]([[page]])

I myself try to limit hierarchies in general and I try to not use namespaces to form hierarchies at all.
But that’s personal preference of course!

1 Like

I updated the script. It will work now with titles as well. Please import it directly or copy and paste it directly into custom.js. Sorry for the delay.

@import url("https://cdn.jsdelivr.net/gh/bad3r/logseq-scripts@latest/LogseqNamespaceAbbreviator.js");
3 Likes

Wow, thanks a lot!!!

1 Like