rayquiro.web
rayquiro.web is an installable native module in 0.1.0 designed for static site generation (SSG), live routing, HTML builder layouts, CSS styling, and local live preview server environments.
🚀 Installation
Install globally on your machine:
rqio install rayquiro.web
Or install locally in your project folder:
rqio install rayquiro.web --local
🌐 Import
import rayquiro.web as web;
⚡ One-Shot Page Generation
web.page(title, bodyHtml, outputPath, optionalCss)
Quickly creates a self-contained HTML page.
title(string) — The<title>tag content.bodyHtml(string) — Raw HTML content to place inside the<body>.outputPath(string) — Path where the generated.htmlfile will be saved.optionalCss(string, optional) — Embedded CSS styling rules to place inside<style>.
🛠️ Builder-Style Layout API
For multi-page websites or complex layouts, you can use the builder session API.
web.begin(title, outputPath)
Initializes a new builder session.
title(string) — Initial website title.outputPath(string) — The path of the primary entry file (typicallyindex.html).
web.route(routePath, optionalTitle, optionalOutputPath)
Creates a new sub-page or switches focus to an existing route.
routePath(string) — The route path (e.g."/about"or"/contact").optionalTitle(string, optional) — A custom<title>tag for this specific route.optionalOutputPath(string, optional) — Custom destination file path (e.g.about.html).
web.head(html)
Injects raw markup directly into the <head> tag of the active route.
html(string) — Raw HTML tags (e.g.,<meta>tags, link fonts, external scripts).
web.public(path)
Specifies the folder containing static assets (images, fonts, prebuilt JS).
path(string) — Folder path. All contents of this folder will be copied into the output destination root.
web.live(port) or web.serve(port)
Starts a local development server at the end of the script execution.
port(number) — Network port to serve the website on (e.g.8080).- Note: Blocks execution and watches files.
web.style(cssText)
Appends CSS styling rules to the shared stylesheet of the active route.
cssText(string) — Raw CSS selector rules.
web.open(tagOrOpeningHtml, className)
Ergonomically opens a new HTML container tag.
tagOrOpeningHtml(string) — Either the tag name (like"div") or a full raw opening tag (like"<div class='grid' id='main'>").className(string, optional) — Class name to attach to the opened tag (if only the tag name was specified).
web.close(optionalFallbackTag)
Closes the most recently opened container tag tracked by the builder.
web.text(text, className, tag)
Generates a basic text element.
text(string) — Text content.className(string, optional) — Class name.tag(string, optional) — The HTML element tag. Defaults to"span".
web.h1(text, className)
Generates an <h1> heading tag.
web.h2(text, className)
Generates an <h2> heading tag.
web.p(text, className)
Generates a <p> paragraph tag.
web.button(label, className, href)
Generates an anchor <a> element styled like a button.
label(string) — Button text.className(string, optional) — CSS styling class.href(string, optional) — Target link destination (e.g.,"/about").
web.raw(html) or web.html(html)
Appends raw, unescaped HTML code directly into the active route body. Very useful with triple-quoted multiline strings """.
web.end()
Finalizes all active routes, runs template substitution, copies assets, writes files to the disk, and spawns the live server if configured.
🎨 Public Shell Templates
If a file named public/index.html exists in the folder configured via web.public(), RayQuiro will automatically parse it as a master template and insert generated content into these placeholders:
{{ rq_title }}— Substituted with the route's title.<!-- rq-styles -->— Replaced with compiled route CSS.<!-- rq-head -->— Replaced with<head>injections fromweb.head().<!-- rq-body -->— Replaced with the built HTML body markup.<!-- rq-live -->— Replaced with hot-reloading scripts (if in live server mode).