Is there any online documentation on crafting the custom table :view techniques @siferiax uses?

I could not find any serious docs on the advanced queries custom tables syntax after ‘:view’ to craft explicit HTML tables to display advanced queries, except examples (most by @Siferiax).

I looked up in Datalog and Datomic resources outside of Logseq specific docs. No success.

Any hints or keywords to search for elsewhere?

1 Like

Very good hint. Needed to be added to the Logseq Advances Query Docs at least as proper hint to hiccup.


is mentioned, but not explained in detail.

Examples are split in two kind of ways:

  • Standard rendering without mentioning html structures
  • eclicit html table structures using the Hiccup way ( but almost never mentioned as such in a comment )

@Mentaloid: I also found your CSS snippets to style the table width etc.

A risk is with adding this to the official docs, keeping people in explicit coding of html, and fixing the smell of the past.

What other more abstract way to control the output is thinkable? A kind of Query Result Postprocessor that can handle nested queries in various ways and finally offer csv or rich table export incl. automation via cli.

Markdown itself lacks proper table formatting and tables in logseq are mostly ugly and hard to style from the source environment.

This could go into an effort in a better identifyable topic with proper title.

Suggestions and activities welcome.
The data display of tables is much more sophisticated in e.g. Notion. but switching to Notion as Renderer is overkill and nogo.

Presentation is king of understanding. Lets see how far we can go without reinventing the wheel.

They are working on that part:

For queries however, there is no solid solution.
Without a :view component there is the standard Logseq query table output, but it lacks in customization.
Often I was using the :view table for adding the page name, but this has been added to the standard table output since. So for those cases it is no longer necessary.
But if we want custom columns there is 2 options.

  • Build a custom view
  • Add those attributes as a property to the block/page output (= :result-transform clojure functions)

There are examples for both on this forum as far as I know.

1 Like

@Siferiax thx for pointing at the table version 2 stuff.
I completely missed that when scanning changelogs.
I am happy now with the hint to hiccup from @mentaloid .

Logseq used to paste hiccup from html, but there are many hurdles and counterintuitive effects.

My daily clipboard kata is to get from one copied content into pasting the relevant stuff into Logseq without loosing any relevant structure and formatting.

And the highlight is then to succed with roundtripping.

My dream is to have an AI driven converter learning from repeated procedures to scrape by XPath or CSS Selectors and paste using embedding different tastes of the cliboard depending of the complexity of the data.

pre and postprocessing, pipelines, logging etc.

This will be hardcore to code but should end up a snap to use.

1 Like