hasty 0.0.4
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, optionalpadding) - 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
spacerwith optional fixedsize(pixels) and configurableflexfactor
Styles & StyleSheets #
- Added
StyleSheet,CssRule, andMediaQuery— compose:rootCSS custom properties, box-sizing resets,:hover/:focusrules, and responsive@mediaqueries using typedStyleobjects - Added
Style.copyWith,Style.merge, andStyle + Styleoperator for deduplicated style composition - Added
Shadowspresets (none,sm,md,lg,xl,inner) - Added
Color.hsl,Color.hsla,Color.cssVar,Color.withOpacity, value equality, and newColorspalette constants (offWhite,slate,rose,amber,emerald,cyan) - Expanded
Stylewithbackground,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, andlistStyle
Markdown #
- Added
markdownandparseMarkdownNodes— zero-dependency Markdown-to-Nodeparser supporting ATX headings (with automatic slugids), 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
accordionandaccordionItem— zero-JS collapsible panels built on<details>and<summary> - Added
heroSection— prominent landing banner with eyebrow badge, headline, subtitle, and CTA actions - Added
breadcrumbandBreadcrumbItem— 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) tobadge
Tags & Rich Content #
- Text and inline containers (
p,li,span,strong,em,h1–h6,button, etc.) now acceptString,Node, orList<Node>for rich mixed inline content alongsidetxt(...) - Added
ButtonVariant.outline,ButtonVariant.danger, andButtonVariant.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, andcomment - Added
aria-*,data-*,role, andidsupport across containers and interactive elements
Generator & Multi-Page Sites #
- Added
renderDocument— renders a complete<!DOCTYPE html>page string without disk I/O - Extended
emitandrenderDocumentwith SEOdescription,meta(including OpenGraphog:*),favicon,stylesheets, deferredscripts, inlinestyleSheet, customheadnodes,bodyStyle/bodyClasses,minify, andquiet - Added
SitePageandemitSite— multi-page static site builder with shared layout wrappers, automatic relative stylesheet linking,prettyUrls, andsitemap.xmlgeneration - Added
emitCssfor standalone.cssfile 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-inhasty serve [dir] [--port=8080]local preview server - Added
aliases,defaultsTo, typedoption<T>(), booleanflag(),restpassthrough args, andformatHelp()toParser - 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 withnavLinkfor typed link items - Added
card— a styled box container withpadding,borderRadius, and optionalbackgroundColor - Added
badge— an inline status chip with acolorbackground, 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
ButtonVariantenum (primary,secondary,floating) — passvariant:tobuttonfor opinionated pre-built styles that can still be overridden withstyle: - Added
dataparameter tobutton,input, andtextarea— accepts aMap<String, String>and renders each entry as adata-*attribute buttonnow accepts anidparameter
CLI / Argparse #
- Parser now handles
--outputas an explicit double-dash flag (in addition to the existing bareoutputform)
Tests #
- Expanded test suite to cover component rendering (
card,badge,statCard,navBar),ButtonVariantstyle merging, anddata-*attribute output
0.0.2 #
Layout #
- Added
hStackandvStack— horizontal/vertical flexbox containers withMainAxisAlignmentandCrossAxisAlignmentsupport - 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(withTextKindenum),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(withScopeenum),td,colgroup,col - Escape hatch:
raw— injects HTML strings without escaping (unsafe; use only with controlled content)
Styles #
- Added
Styleclass with typed properties for color, background, padding, margin, font, dimensions, borders, flexbox, positioning, and more - Added
ColorwithColor.hex,Color.rgb,Color.rgbaconstructors - Added
Colorspalette (black,white,red,orange,yellow,green,teal,blue,indigo,purple,pink,gray,lightGray,darkGray,transparent) - Added
FontWeightconstants (thin,light,normal,medium,semibold,bold,extrabold) - Added enums:
TextAlign,TextDecoration,Position,Display,Float,FlexWrap,AlignSelf
Generator #
- Added
emit— writesindex.htmlto a configurable output directory; acceptstitle,fileName,outputDir, andlangparameters emitproduces a complete HTML document:<!DOCTYPE html>,<html lang="...">,<meta charset="utf-8">, and<meta name="viewport">are always includedemitprettifies output with indented formatting before writing — the resulting file is human-readable and well-indentedemitusesmason_loggerfor 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
ArgParseExceptionfor 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'sprettify()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_dartdependency; prettification is now handled natively - Removed unused
Node.cssfield and the deadcssSetcollection/write infrastructure that depended on it
Examples #
example/hasty_example.dart— updated to showcasespacer,padding,center,ul/li, and tables alongside forms, layout, and CLI parsingbin/hasty.dart— updated navbar to usespacer; addedintro()section demonstratingpadding,center, and inline text styling withspanandFontWeight
0.0.1 #
- Initial namespace reservation.