Skip to content

feat: sidebar-main layout and fix grid detection inside containers#4

Merged
teezeit merged 1 commit intomainfrom
feat/sidebar-layout
Apr 17, 2026
Merged

feat: sidebar-main layout and fix grid detection inside containers#4
teezeit merged 1 commit intomainfrom
feat/sidebar-layout

Conversation

@teezeit
Copy link
Copy Markdown
Owner

@teezeit teezeit commented Apr 17, 2026

⚠️ Depends on #2 (grid card/col-span) — please merge that first.

Summary

  • New layout component: :::layout {.sidebar-main} renders a two-column grid with a styled sidebar panel and main content area. Sidebar background matches each theme's nav (e.g. #87CEEB in sketch). Buttons inside the sidebar span full width.
  • Bug fix: grids nested inside any container (:::card, :::layout, etc.) were silently rendered as plain headings. Extracted processNodeList() shared helper so both the top-level document pass and transformContainer detect {.grid-N} headings correctly.
  • Example: examples/sidebar-layout.md — project management workspace wireframe demonstrating the layout with a 3-column stats grid inside the main section.

Test plan

  • npm test — 510 tests pass
  • Parser tests: grid inside container produces grid AST node; sidebar-main layout structure
  • Renderer tests: sidebar HTML structure, nav-matching CSS, full-width buttons, grid divs present inside containers
  • Visual: wiremd examples/sidebar-layout.md --serve 3002 --style sketch — sidebar styled like navbar, 3-column stats grid renders correctly

🤖 Generated with Claude Code

- Add renderSidebarMainLayout() to html-renderer — groups children by
  {.sidebar}/{.main} heading markers into wmd-layout-sidebar/main divs
- Add sidebar + layout CSS to all 7 style themes (nav-matching backgrounds,
  full-width buttons, section label styling)
- Fix grid detection inside containers: extract processNodeList() shared
  helper so both transformToWiremdAST and transformContainer detect
  {.grid-N} headings — previously grids inside :::layout, :::card etc.
  were silently rendered as plain headings
- Add examples/sidebar-layout.md
- Add parser and renderer tests for sidebar layout and nested grids

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@teezeit teezeit merged commit 8ffe85d into main Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant