Skip to content

Put a csquery table in a README

Status: Shipped

A csquery block turns a fenced code block in any markdown doc into a live table of your stories. There’s no HTML and no script. When a story changes on disk, the table updates.

This guide adds an “in flight” table to the Ledgerline checkout-v2 epic’s README.md.

1. Add the block

Open planning/checkout-v2/README.md and add a fenced block with the language csquery:

## In flight
```csquery
status: in-progress, review
tag: source_repo=ledgerline/web
columns: id, name, status
sort: id asc
```

Each line is one key: value pair. Keys aren’t case-sensitive, and blank lines and # comments are ignored.

2. View it

Open the README in CodeSense’s markdown viewer. The block renders as a table of every web story that’s in progress or in review, such as LL-231 “Cart summary tax breakdown”. Click a row to open that story.

The keys

KeyExampleMeaning
statusstatus: todo, in-progressAny of these statuses. Repeated status lines add up.
tagtag: ui or tag: source_repo=ledgerline/apiA bare value matches the doc’s tags: list. key=value matches any frontmatter field. Lines on different keys must all match; lines on the same key match either.
epicepic: SW-OCDocs in this epic.
dependsdepends: SW-OC-25Docs that depend on this one.
kindkind: story, epicKinds to list. Default story, bug, spike.
orgorg: allOrgs to search. Default: the org this doc is in.
relatedrelated: <doc>Docs that have this doc as a supporting doc.
backlinkbacklink: <doc>Docs backlinked by this doc.
scopescope: <path>Only docs under this path.
viewview: boardtable (default), list, board or connectivity.
groupgroup: statusGroup rows or board columns by a field. A board groups by status by default.
columnscolumns: id, name, status, typeTable columns. Default name, status. id, name, status, type and path are built in; any other name reads that tag.
limitlimit: 20At most this many rows. Default 200.
sortsort: prioritySort by any field, ascending by default. name is the file name and id the story id.

For all keys other than tag and status, the last line wins, and CodeSense shows a warning.

Variations

A board of every doc tagged ui, one column per status:

tag: ui
view: board

A short list of what’s waiting on review:

status: review
view: list
limit: 5

Blocks are read-only

A csquery block only shows data. Action keys such as setstatus, open or run are dropped with a warning. To act on stories from a page, use an HTML page. The same query engine powers codesense.queryContext() in pages and panes and the query_context MCP tool: see Query your context.

The full syntax is in the csquery reference.

How we know this is accurate 7 sources

Checked against the app at 1b3d5a69d73473db077dfb44f4390b42cded6bd4.

Feature inventory

  • B-18
  • B-19

Code

  • src/shared/lib/csquery/parse-csquery.ts
  • src/shared/lib/csquery/types.ts
  • src/shared/lib/context-query/types.ts
  • src/features/dashboard/components/csquery/cs-query-view.tsx
  • src/features/dashboard/components/markdown-viewer.tsx