Hi, new user here! I figured out most of the features through the great documentation, but there is one use case that I couldn’t find anything about.
I’m using the journal pages (among other things) for some sort of bullet point diary. I rarely have to revisit the corresponding block as it is mostly just for some quick reflections. I really like having it matched to the corresponding day though and having the opportunity to see it in context of the things I worked on etc.
What I would like to achieve is these blocks being hidden by default (pressing the little arrow on the left to expand them) as they are quite private in nature and I’d be more comfortable using logreq in public or with other people present.
Is there a way to achieve this behavior? All the blocks in question share a certain tag that I don’t use anywhere else (let’s call it #diary).
I’d greatly appreciate your help, thank you
Welcome. If you are willing to do some filesystem scripting, you could:
- iterate all files inside folder
- search inside each file for the string of the tag (
#diary in your example)
- find its parent block
- i.e. the first block above the tagged block that is less indented
- append to it a properly indented string
- i.e. the property that saves the collapsed state
If the structure of your notes is relatively simple, the script doesn’t need to cover special cases.
Not an ideal solution as it requires the use of some external tool but it will probably work for now Thank you!
Something like this should be achievable with the
Beyond what the topic’s title indicates, the OP specifically asked for the ability to expand the hidden block like any other collapsed block:
The difference is that saving the hidden/collapsed state turns a mere change of appearance into a data change, thus beyond what css is about, no matter that the actual information hasn’t changed. If this behavior is not a requirement, it could be possible to come with some hack, css or otherwise.
Ok, right. Working with the collapsing arrow is, then, only achievable with what you suggest (
collapsed:: true on its own line under the Block’s Title line/paragraph).
If workarounds are acceptable then there are a few. I don’t know if there is an option to have “Toggle Open Blocks” “activated” by default, but doing “T O” right after opening Logseq when in a public area will collapse ALL blocks, then you can expand them with the left arrow as needed. If there was a way to have all toggled closed by default you’d be spared of having to do it every time when in a public space.
I was merely suggesting these options as OP was not keen on external tools/scripts.
Thank you, I’m definitely open to suggestions like that! small issue I noticed with using T O: It seems to just work on the currently ‘focused’ page, i.e. the journal page for the current day instead of all journal pages (even after just opening logseq and before actively editing the page). Am I doing something wrong or is this intended behavior?