Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FlamesX-128/denoTag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

9 Commits

Repository files navigation

Deno Tag

A simple HTML preprocessor for Deno.

Example

import { render } from "https://deno.land/x/denotag@0.2.0/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 -->
<body>
 <p>
 The value of the fibonacci sequence is:
 6765
 </p>
 13
</body>

AltStyle によって変換されたページ (->オリジナル) /