Consider adding a specific code example to `clerk/use-headers` or `clerk/table` docstring?
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 55/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- clojure
- Domain
- documentation
Research direction
Locate the docstrings for nextjournal.clerk/use-headers and nextjournal.clerk/table, starting with the suggested use-headers example. Add a specific usage example to clarify how headers work with table, then verify the resulting docstring output shows the example clearly.
Written by the indexing model from the issue text.
Description
Hi,
I recently tried making a Clerk table with headers without reading the Clerk book, only by reading docstrings. I wasn't able to understand what I was supposed to do.
Perhaps a specific example could help docstring readability?
Reading the docstrings
Clerk evaluated '/Users/teodorlu/dev/teodorlu/lab/src/learn/playwright_2.clj' in 416.38625ms.
user> (doc nextjournal.clerk/table)
-------------------------
nextjournal.clerk/table
([xs] [viewer-opts xs])
Displays `xs` using the table viewer.
Performs normalization on the data, supporting:
* seqs of maps
* maps of seqs
* seqs of seqs
If you want a header for seqs of seqs use `use-headers`.
Supports an optional first `viewer-opts` map arg with the following optional keys:
* `:nextjournal.clerk/width`: set the width to `:full`, `:wide`, `:prose`
* `:nextjournal.clerk/viewers`: a seq of viewers to use for presentation of this value and its children
* `:nextjournal.clerk/render-opts`: a map argument that will be passed as a secong arg to the viewers `:render-fn`
;; => nil
user> (doc nextjournal.clerk/use-headers)
-------------------------
nextjournal.clerk/use-headers
([xs])
Treats the first element of the seq `xs` as a header for the table.
Meant to be used in combination with `table`.
;; => nil
table refers to use-headers, and use-headers refers to table. But I don't understand what I should do from the docstrings.
Reading the book
Ah, OK. That makes sense!
Docstring change suggestion
Something like this:
(doc nextjournal.clerk/use-headers)
-------------------------
nextjournal.clerk/use-headers
([xs])
Treats the first element of the seq `xs` as a header for the table.
Meant to be used in combination with `table` like this:
(clerk/table (clerk/use-headers [["odd numbers" "even numbers"]
[1 2]
[3 4]]))
I'm happy to make a PR if you want one.
- Dominant language
- Clojure
- Stars
- 2.1k
- Forks
- 87
- Avg merge
- 3m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextjournal/clerk
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nextjournal/clerk#830 ·
-
Build with ssr failsOpen
Difficulty 3/5 Half a day Newbie friendliness 55/100
nextjournal/clerk#831 ·
-
Cross-Site WebSocket Hijacking in the dev server's /_ws endpoint leads to arbitrary code executionOpen
Difficulty 3/5 1-2 days Newbie friendliness 45/100
nextjournal/clerk#825 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
nextjournal/clerk#818 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
nextjournal/clerk#807 ·
All issues in nextjournal/clerk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
penpot/penpot#13540 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Data Studio semantic layer: clicking a table or metric row only opens it when you click the namePossibly taken @sanketpatel32 claimed this 1 day ago. Open.Needs Triage .Team/UXWest Priority:P3 Type:Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
metabase/metabase#88853 · 1 comment ·
Maintainers usually reply within 1 day