Skip to content

itsmaheshkariya/ssr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 

Repository files navigation

demoofqcom

Deno Server side HTML functions.

Rules

HTML

<h1 class="head"  style = "color:red;  background-color:  yellow"    id="heading" > I am H1 </h1>

Qcom

h1({class:'head', style:{ color:'red', backgroundColor : 'Yellow' }, id:'heading' }, 'I am H1' )

Example

import { serve } from "https://deno.land/std/http/server.ts";
import {body,h1} from "https://deno.land/x/ssr/index.ts";

const s = serve({ port: 8000 });
const color = 'yellow';
const template = body(h1({style:{color:color}},'Hello World'))
for await (const req of s) { req.respond({ body : template })
}

Grammar:

                                        function
 ┌─────────-───────────────────────────────┴────────────────────────────────────────────────────────┐
 │                            separators                                                            |
 │                   ┌────────────┴───┬────────────────┬───────────────────────────┐                |
 |                   ↓                ↓                ↓                           ↓                |
p(  { to:'firstname' ,   class:'mt12' , id:'firstname' , style: {color:color.red} }, 'Hello World'  )
        └───┬───┘          └───┬───┘     └────┬───┘       └────┬────────┘                 |
            ┴───────────┬──────┴─────-──-─────┘-──-─────-─────-┘                          |
                   attributes                                                           Text

About

Server Side HTML Functions for rapid development in Node and Deno.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published