Skip to main content

hasty 0.0.4 copy "hasty: ^0.0.4" to clipboard
hasty: ^0.0.4 copied to clipboard

A SwiftUI-inspired static site generator for Dart. Build HTML with HStacks, VStacks, and zero CSS stress.

0.0.4 #

Layout #

  • Added grid — CSS Grid container supporting fixed column counts (columns: 3) or responsive auto-fitting columns (minChildWidth: 240) with zero media queries
  • Added wrap — wrapping horizontal flex layout (flex-wrap: wrap) for chips, tags, and button groups
  • Added container — horizontally centered page/section wrapper (maxWidth, margin: 0 auto, optional padding)
  • Added expanded — proportional flex item wrapper (flex: n)
  • Added divider — horizontal and vertical (Axis) visual separator
  • Added fragment — transparent fragment wrapper (Node.fragment) that groups sibling nodes without emitting a wrapper tag
  • Extended spacer with optional fixed size (pixels) and configurable flex factor

Styles & StyleSheets #

  • Added StyleSheet, CssRule, and MediaQuery — compose :root CSS custom properties, box-sizing resets, :hover / :focus rules, and responsive @media queries using typed Style objects
  • Added Style.copyWith, Style.merge, and Style + Style operator for deduplicated style composition
  • Added Shadows presets (none, sm, md, lg, xl, inner)
  • Added Color.hsl, Color.hsla, Color.cssVar, Color.withOpacity, value equality, and new Colors palette constants (offWhite, slate, rose, amber, emerald, cyan)
  • Expanded Style with background, fontStyle, textTransform, whiteSpace, borderStyle, directional borders (borderTop/Right/Bottom/Left), boxShadow, cursor, boxSizing, objectFit, overflowX/Y, transition, transform, flex, flexGrow/Shrink, CSS Grid placement properties, and listStyle

Markdown #

  • Added markdown and parseMarkdownNodes — zero-dependency Markdown-to-Node parser supporting ATX headings (with automatic slug ids), paragraphs, bold/italic/strikethrough/inline code, snake_case underscore preservation, links, images, fenced code blocks, blockquotes, ordered/unordered lists, and horizontal rules, with automatic HTML escaping

Components #

  • Added alert (AlertVariant: info, success, warning, error) — accessible contextual callout banner
  • Added accordion and accordionItem — zero-JS collapsible panels built on <details> and <summary>
  • Added heroSection — prominent landing banner with eyebrow badge, headline, subtitle, and CTA actions
  • Added breadcrumb and BreadcrumbItem — accessible <nav aria-label="Breadcrumb"> trail
  • Added avatar — circular image or initials fallback badge
  • Added progressBar — visual progress indicator with ARIA attributes and optional percentage readout
  • Added codeBlock — styled terminal/syntax snippet card with optional filename/language header
  • Added BadgeVariant (solid, subtle, outline) to badge

Tags & Rich Content #

  • Text and inline containers (p, li, span, strong, em, h1–h6, button, etc.) now accept String, Node, or List<Node> for rich mixed inline content alongside txt(...)
  • Added ButtonVariant.outline, ButtonVariant.danger, and ButtonVariant.ghost
  • Added semantic HTML5 tags: aside, figure, figcaption, details, summary, dialog, blockquote, pre, code, kbd, mark, small, del, ins, sub, sup, abbr, time, dl, dt, dd, video, audio, source, picture, iframe, progress, meter, meta, linkTag, script, and comment
  • Added aria-*, data-*, role, and id support across containers and interactive elements

Generator & Multi-Page Sites #

  • Added renderDocument — renders a complete <!DOCTYPE html> page string without disk I/O
  • Extended emit and renderDocument with SEO description, meta (including OpenGraph og:*), favicon, stylesheets, deferred scripts, inline styleSheet, custom head nodes, bodyStyle/bodyClasses, minify, and quiet
  • Added SitePage and emitSite — multi-page static site builder with shared layout wrappers, automatic relative stylesheet linking, prettyUrls, and sitemap.xml generation
  • Added emitCss for standalone .css file output

CLI / Argparse #

  • Updated bin/hasty.dart (runHastyCli) into a full CLI runner (./bin/hasty.exe <target.dart> [flags...]) that executes target Hasty build scripts, forwards flags, and includes a built-in hasty serve [dir] [--port=8080] local preview server
  • Added aliases, defaultsTo, typed option<T>(), boolean flag(), rest passthrough args, and formatHelp() to Parser
  • Fixed = and : splitting so values containing URLs or query parameters are preserved intact

0.0.3 #

Components #

  • Added navBar — a ready-made <nav> with flex-row layout and configurable gap; pairs with navLink for typed link items
  • Added card — a styled box container with padding, borderRadius, and optional backgroundColor
  • Added badge — an inline status chip with a color background, white text, and pill shape
  • Added statCard — a compound card that displays an icon, a large value string, and a caption label on a coloured background

Tags #

  • Added ButtonVariant enum (primary, secondary, floating) — pass variant: to button for opinionated pre-built styles that can still be overridden with style:
  • Added data parameter to button, input, and textarea — accepts a Map<String, String> and renders each entry as a data-* attribute
  • button now accepts an id parameter

CLI / Argparse #

  • Parser now handles --output as an explicit double-dash flag (in addition to the existing bare output form)

Tests #

  • Expanded test suite to cover component rendering (card, badge, statCard, navBar), ButtonVariant style merging, and data-* attribute output

0.0.2 #

Layout #

  • Added hStack and vStack — horizontal/vertical flexbox containers with MainAxisAlignment and CrossAxisAlignment support
  • Added zStack — layered positioning container (position: relative)
  • Added spacer — flex-growing spacer element
  • Added padding — wraps a single child with configurable padding (all, horizontal, vertical, or per-side)
  • Added center — centers a child both horizontally and vertically

Tags #

  • Headings: h1, h2, h3, h4, h5, h6
  • Text: text (with TextKind enum), p, span, strong, em
  • Containers: div, section, main_, header, footer, nav, article
  • Lists: ul, ol, li
  • Interactive: a, button
  • Media: img, hr, br
  • Forms: form, input, textarea, select, option, optgroup, fieldset, legend, label
  • Tables: table, caption, thead, tbody, tfoot, tr, th (with Scope enum), td, colgroup, col
  • Escape hatch: raw — injects HTML strings without escaping (unsafe; use only with controlled content)

Styles #

  • Added Style class with typed properties for color, background, padding, margin, font, dimensions, borders, flexbox, positioning, and more
  • Added Color with Color.hex, Color.rgb, Color.rgba constructors
  • Added Colors palette (black, white, red, orange, yellow, green, teal, blue, indigo, purple, pink, gray, lightGray, darkGray, transparent)
  • Added FontWeight constants (thin, light, normal, medium, semibold, bold, extrabold)
  • Added enums: TextAlign, TextDecoration, Position, Display, Float, FlexWrap, AlignSelf

Generator #

  • Added emit — writes index.html to a configurable output directory; accepts title, fileName, outputDir, and lang parameters
  • emit produces a complete HTML document: <!DOCTYPE html>, <html lang="...">, <meta charset="utf-8">, and <meta name="viewport"> are always included
  • emit prettifies output with indented formatting before writing — the resulting file is human-readable and well-indented
  • emit uses mason_logger for a progress spinner during the build, with a green ✓ on success or red ✗ on failure
  • Added renderHtml — returns the raw HTML string for a node tree without writing any files

CLI / Argparse #

  • Added Parser — registers and parses typed CLI flags (supports = and : separators, typed arguments, and unknown-flag rejection)
  • Added ArgParseException for structured parse errors

Tests #

  • Added full test coverage for all layout functions (hStack, vStack, zStack, spacer, padding, center)
  • Added full test coverage for Parser (flag parsing, type coercion, all three separators, error cases, -- passthrough)

Bug Fixes #

  • Fixed malformed HTML output caused by beautiful_soup_dart's prettify() re-parsing the generated HTML and scrambling tag nesting order
  • Replaced the post-processing step with indentation built directly into the generation loop — output is now correctly structured and well-indented

Removed #

  • Removed beautiful_soup_dart dependency; prettification is now handled natively
  • Removed unused Node.css field and the dead cssSet collection/write infrastructure that depended on it

Examples #

  • example/hasty_example.dart — updated to showcase spacer, padding, center, ul/li, and tables alongside forms, layout, and CLI parsing
  • bin/hasty.dart — updated navbar to use spacer; added intro() section demonstrating padding, center, and inline text styling with span and FontWeight

0.0.1 #

  • Initial namespace reservation.
0
likes
160
points
81
downloads

Documentation

API reference

Publisher

verified publisherblandlogic.com

Weekly Downloads

A SwiftUI-inspired static site generator for Dart. Build HTML with HStacks, VStacks, and zero CSS stress.

Repository (GitHub)
View/report issues

Topics

#html #ssg #static-site-generator #css #markdown

License

MIT (license)

Dependencies

mason_logger

More

Packages that depend on hasty