Hot to create a list of contents of current page?

Hi there,

I’m new to logseq and I don’t know, where to find the loqseq data model for formulating queries. My current challenge is:

I would like to show a list of contents of the current page via a query. The list of contents should include only blocks with headers of level 1 (#) and level 2 (##).

Any help is appreciated!


1 Like

I recommend using the toc-gen plugin from the marketplace

1 Like

Fair enough. But I would like to learn using the power of queries :wink:

Not something I would honestly try to accomplish with queries.
It’s really difficult if not impossible to get a table of contents in the way you are thinking of.
Logseq works with blocks and so queries are on the block level as well.
While complicated things are possible in theory, it just doesn’t seem worth the investment.
At least for me to figure it out it isn’t.
The structure of the database is just simply not build for it.

1 Like

Ok, I see your point. Thanks! (I might try it anyway :wink:)

1 Like