Add data table markdown block
Some checks are pending
Build / build (push) Waiting to run

This commit is contained in:
Neeldhara Misra 2026-06-29 02:09:20 +05:30
parent 5dfcdfd516
commit c06f71a5ad
34 changed files with 3641 additions and 279 deletions

View file

@ -186,8 +186,15 @@ Astro wraps these glyphs in small semantic spans so they get stable font
fallbacks and accessible labels:
```html
<span class="symbol symbol-chess" data-symbol="white-knight" aria-label="white knight"></span>
<span class="symbol symbol-card" data-symbol="heart" aria-label="heart"></span>
<span
class="symbol symbol-chess"
data-symbol="white-knight"
aria-label="white knight"
>♘</span
>
<span class="symbol symbol-card" data-symbol="heart" aria-label="heart"
>♥</span
>
<span class="symbol symbol-emoji">🎯</span>
```
@ -263,6 +270,28 @@ Drag files along a tape and compare the access cost.
Use the Pandoc-style form for posts that should export to PDF.
### Data Tables
Use `.data-table` when a post should keep rows in a colocated YAML or JSON file
but render as a searchable, sortable table in Astro:
````markdown
```{.data-table #tbl:resources src="resources.yml" columns="type,title,summary" headers="type:Type,title:Resource,summary:Notes" link="title" number="slno" caption="Resources" search-placeholder="Search resources"}
The HTML version renders this as a searchable, sortable table. In Obsidian,
edit `resources.yml` to update the rows.
```
````
The data file should contain either a top-level array or an object with an
`items` array. The `src` path is resolved relative to the Markdown file. Use
`columns` to control the visible columns, `headers` to rename table headers,
`link` to choose the column that should link through the row's `link` field,
and `number` to prefix that linked column with a row number such as `slno`.
In Obsidian this remains a readable code fence next to the data file. In Astro
it becomes static HTML enhanced with local search and sort. In PDF it becomes a
short callout fallback unless a `pdf="..."` or fence body fallback is provided.
### LaTeX-Style Environments
Use `.env` plus the environment class and a label: