asw/packs/pandoc/README.md
Ludo 86464f3e21
feat: legacy import — packs, examples, lab, themes, docs, lineage
Import from agentic-semantic-web/ into restructured repo:
- 7 packs (apache, caddy, flask, hugo, nginx, pandoc, python)
- shared error pages (403-503)
- 17 lab experiments (boilerplate, charts, misc)
- 31 example pages (charts, components, content, layout, vault)
- 2 themes (garden, trentuna stub)
- 4 docs (llms.txt, vocabulary, philosophy, agent-directive)
- lineage.md (Pico/Open Props/Charts.css history)
- Hugo mounts for lab/ and examples/

All agentic.css references updated to asw.css.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 16:57:39 +02:00

105 lines
3.1 KiB
Markdown

---
title: "ASW Pandoc Pack"
description: "Convert markdown to ASW-styled HTML with one command"
layout: prose
---
# ASW Pandoc Pack
Converts GFM markdown to fully ASW-styled HTML. Write markdown natively; the pack renders it with correct `data-attribute` semantics.
## Usage
```bash
pandoc input.md \
--from gfm \
--lua-filter packs/pandoc/asw.lua \
--template packs/pandoc/asw.html5 \
-o output.html
```
## What it does
### Semantic mapping (asw.lua)
| Markdown | Output HTML |
|---|---|
| `- [ ] task` | `<li data-task="todo">task</li>` |
| `- [x] done` | `<li data-task="done">done</li>` |
| `> [!NOTE]` | `<div data-callout="note">` |
| `> [!WARNING]` | `<div data-callout="warning">` |
| `> [!TIP]` | `<div data-callout="tip">` |
| `> [!ERROR]` | `<div data-callout="error">` |
| `[[target]]` | `<a data-wikilink href="#target">target</a>` |
| `[[target\|label]]` | `<a data-wikilink href="#target">label</a>` |
Callout aliases: `[!CAUTION]` → warning, `[!IMPORTANT]`/`[!INFO]` → note, `[!DANGER]` → error.
Wikilinks: punctuation attached to `]]` is preserved outside the link element. Unresolved link detection is not automatic — the href slug is always generated; resolution is a build-time concern.
### Frontmatter → data-attributes (asw.html5)
YAML frontmatter keys map to page-level ASW properties:
```yaml
---
title: "Session Report — 2026-04-02"
description: "Summary of what happened"
layout: prose # → data-layout on <main> (default: prose)
status: done # → data-status on <main> and in header badge
date: 2026-04-02 # → <time datetime="...">
section: "Sessions" # → <p data-text="eyebrow"> above <h1>
tags:
- session
- autonomous
# Session metadata (if agent-authored):
agent: vigilio
model: claude-sonnet-4-6
mode: autonomous # → <span data-mode="autonomous">
session: 10
---
```
Keys not set are simply omitted — no empty elements in the output.
## Layout values
The `layout` key maps directly to `data-layout` on `<main>`:
| Value | Use case |
|---|---|
| `prose` (default) | Articles, notes, documentation |
| `docs` | Two-column docs layout |
| `fluid` | Full-width, no max-width |
Any `data-layout` value supported by `asw.css` works here.
## Status values
| Value | Meaning |
|---|---|
| `done` | Complete |
| `awake` | Active agent/session |
| `sleeping` | Inactive |
| `blocked` | Waiting on dependency |
## CSS dependency
The pack generates HTML that requires `asw.css` for styling. The template links `/asw.css` by default. Override with `--variable css=/path/to/asw.css`.
## Relationship to the build pipeline
`build.sh` uses this pack (via the `doc.html` template) for `content/``docs/` compilation. The standalone pack is also useful for:
- Rendering vault notes as public pages
- One-off markdown → ASW HTML conversion
- Integration into other build systems (trentuna-web, agent pipelines)
## Files
```
packs/pandoc/
├── asw.html5 pandoc HTML5 template — page structure, frontmatter vars
├── asw.lua Lua filter — task lists, callouts, wikilinks
└── README.md this file
```