https://github.com/itsmaheshkariya/ssr
Server Side HTML Functions for rapid development in Node and Deno.
https://github.com/itsmaheshkariya/ssr
Last synced: about 2 months ago
JSON representation
Server Side HTML Functions for rapid development in Node and Deno.
- Host: GitHub
- URL: https://github.com/itsmaheshkariya/ssr
- Owner: itsmaheshkariya
- Created: 2020-05-20T15:14:19.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-20T15:35:17.000Z (almost 5 years ago)
- Last Synced: 2025-01-06T01:08:59.636Z (4 months ago)
- Language: TypeScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

### Deno Server side HTML functions.## Rules
`HTML`
```htmlI am H1
```
`Qcom`
```js
h1({class:'head', style:{ color:'red', backgroundColor : 'Yellow' }, id:'heading' }, 'I am H1' )
```
`Example`
```ts
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