Fork me on GitHub
#clerk
<
2024-02-13
>
seb23116:02:06

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

Andrea16:02:30

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
seb23116:02:16

html seemed to be the way to go

seb23116:02:21

(clerk/html "  align=right> ")

Andrea16:02:27

clerk/html also takes hiccup...

šŸ‘ 1
teodorlu20:02:26

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.

mkvlr21:02:55

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

teodorlu21:02:55

That did the trick. Thank you!

teodorlu21:02:01

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)))

teodorlu21:02:15

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

šŸ–¤ 3
ā¤ļø 1
seb23122:02:10

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?

teodorlu22:02:24

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.

teodorlu22:02:27

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.

seb23100:02:41

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

šŸ‘ 1