import { render } from "https://deno.land/x/[email protected]/mod.ts";
const html = Deno.readTextFileSync(
new URL("assets/main.html", import.meta.url)
);
console.log(
await render(html, {
params: {
timestamp: Date.now()
}
})
)
<!-- You can use <deno>, <script type="application/typescript">, or a custom query by adjusting the configuration. -->
<body>
<p>
The value of the fibonacci sequence is:
<script type="application/typescript">
function fibonacci(n: number): number {
if (n <= 1) {
return n;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
return fibonacci(20);
</script>
</p>
<deno>
return Date.now() - params.timestamp;
</deno>
</body>
<!-- When evaluated, it becomes into this -->
<!DOCTYPE html>
<html lang="es">
<head>
<title>denoTag</title>
</head>
<body>
<p>
The value of the fibonacci sequence is:
6765
</p>
13
</body>
</html>