clerk

seb231 2024-02-13T16:29:06.219869Z

Any tips for placing an image at a point on a clerk notebook? For example as if it was right aligned?

Andrea 2024-02-13T16:43:30.427099Z

If you mean how to place images from cell results, you might nest them inside clerk/html like so:

(clerk/html
 [:div.flex.justify-end
  (clerk/image "some-image.png")])
and use the markup that best fits your use case (e.g using https://tailwindcss.com/docs/flex-basis)

šŸ‘ 2
seb231 2024-02-13T16:42:16.079199Z

html seemed to be the way to go

seb231 2024-02-13T16:42:21.765029Z

(clerk/html "  align=right> ")

Andrea 2024-02-13T16:48:27.874139Z

clerk/html also takes hiccup...

šŸ‘ 1
teodorlu 2024-02-13T20:38:26.846279Z

Is there a recommended way to display a table wider than the default width? I’ve got a table with lots of columns, and I’d like to use more space to show the table.

mkvlr 2024-02-13T21:16:55.854769Z

you can use {clerk/width :full} as either metadata or a first map arg to clerk/table

teodorlu 2024-02-13T21:40:55.853489Z

That did the trick. Thank you!

teodorlu 2024-02-13T21:47:01.885009Z

I’m looking into the data on my personal web site. Earlier, I just used the terminal. Putting a big table on a big screen was super helpful.

(defn big-table [x]
  (v/with-viewer (dissoc v/table-viewer :page-size)
    x))

^{::clerk/width :full}
(big-table
 (->> (cli/files->relations {})
      vals
      (sort-by :slug)))

teodorlu 2024-02-13T21:48:15.253489Z

Did I tell you earlier that I think Clerk is great? I might have to tell you again šŸ˜„

šŸ–¤ 3
ā¤ļø 1
seb231 2024-02-13T22:09:10.774499Z

I feel like I've seen this asked several times before but I can't seem to find the answer: How do I get local images in my notebook to appear in the static version?

teodorlu 2024-02-13T22:14:24.702649Z

One option is clerk/image and . A limitation then is SVG support, I don’t think java images support SVG natively. For SVG, reading the raw file and then viewing with clerk/html worked for me. Both screenshots are taken from Clerk garden, so I’d say that’s a ā€œstatic versionā€. What are you expecting and what isn’t working? I’ve felt like the book answered how to show images well for my use cases.

teodorlu 2024-02-13T22:18:27.225779Z

For io/resource to work, you probably need to make sure the image file is on the classpath. You can control the classpath with :paths ["src" "resources"] in deps.edn.

seb231 2024-02-14T00:52:41.862789Z

Thank you! Yes! I think ā€˜io/resource’ was what I’d seen suggested before

šŸ‘ 1