rayquiro.web
rayquiro.web in 0.0.2 is an official installable native module for HTML generation, routes, shell templates, and local live serving.
Install it with:
rqio install rayquiro.web
or for the current project:
rqio install rayquiro.web --local
Import
import rayquiro.web as web;
What It Is For
Use rayquiro.web for:
- one-shot page generation
- builder-style page generation
- route-based output
- raw multiline HTML blocks
- public shell templates
- local live serving
One-Shot Page Generation
web.page(title, bodyHtml, outputPath, optionalCss)
Quick single-file generation helper.
Builder-Style Session API
web.begin(title, outputPath)
Starts a page session.
web.route(routePath, optionalTitle, optionalOutputPath)
Switches or creates the current route.
web.head(html)
Appends raw HTML into the current route <head>.
web.public(path)
Sets the public directory or shell directory.
web.live(port)
web.serve(port)
Starts or enables local serving after generation.
web.style(cssText)
Appends CSS to the current document output.
web.open(tag, className)
web.open("<raw markup>")
Opens a normal tag or injects ready-made opening markup.
web.close(optionalFallbackTag)
Closes the most recently tracked tag.
web.text(text, className, tag)
web.h1(text, className)
web.h2(text, className)
web.p(text, className)
Convenience content helpers.
web.button(label, className, href)
Creates an anchor styled like a button.
web.raw(html)
web.html(html)
Appends raw HTML directly into the current route body.
web.html(...) is the ergonomic multiline form:
web.html("""
<section class="hero">
<h1>RayQuiro</h1>
<p>Write route content directly.</p>
</section>
""");
web.end()
Finalizes all routes and writes output files.
Example
import rayquiro.web as web;
web.begin("Demo", "build/site/index.html");
web.public("public");
web.head("<meta name='description' content='RayQuiro demo'>");
web.style("""
.page { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.title { font-size: 48px; }
""");
web.open("<main class='page'>");
web.h1("RayQuiro", "title");
web.html("""
<p>Rendered through <code>web.html(...)</code>.</p>
""");
web.close();
web.route("/about", "About");
web.open("<main class='page'>");
web.p("About route.");
web.close();
web.end();
Public Shell Templates
If public/index.html exists, RayQuiro uses it as the output shell.
Recognized placeholders:
{{ rq_title }}<!-- rq-styles --><!-- rq-head --><!-- rq-body --><!-- rq-live -->
Notes
rayquiro.webis an installable native module in0.0.2- it is not a built-in system module
web.end()is required to write the outputweb.live(...)keeps the process alive until you stop it