feat: add example scripts for argparse, bytes, dataset, html, markdown, uuid, wdantic, and web chat modules
Add comprehensive demo scripts showcasing the usage of multiple Wren modules including argument parsing, byte manipulation, in-memory dataset operations, HTML encoding/slugification, markdown-to-HTML conversion, UUID generation/validation, schema validation with wdantic, and a full web chat application with REST endpoints.
This commit is contained in:
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "markdown" for Markdown
|
||||
|
||||
System.print("=== Markdown Module Demo ===")
|
||||
|
||||
var markdown = "# Welcome to Markdown
|
||||
|
||||
This is a **bold** statement and this is *italic*.
|
||||
|
||||
## Features
|
||||
|
||||
- Easy to read
|
||||
- Easy to write
|
||||
- Converts to HTML
|
||||
|
||||
### Code Example
|
||||
|
||||
Here is some `inline code`.
|
||||
|
||||
```
|
||||
function hello() {
|
||||
console.log(\"Hello, World!\")
|
||||
}
|
||||
```
|
||||
|
||||
### Links and Images
|
||||
|
||||
Check out [Wren](https://wren.io) for more info.
|
||||
|
||||

|
||||
|
||||
> This is a blockquote.
|
||||
> It can span multiple lines.
|
||||
|
||||
---
|
||||
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
|
||||
That's all folks!"
|
||||
|
||||
System.print("\n--- Source Markdown ---")
|
||||
System.print(markdown)
|
||||
|
||||
System.print("\n--- Generated HTML ---")
|
||||
System.print(Markdown.toHtml(markdown))
|
||||
|
||||
System.print("\n--- Safe Mode Example ---")
|
||||
var unsafe = "# Title\n\n<script>alert('xss')</script>\n\nSafe content."
|
||||
System.print(Markdown.toHtml(unsafe, {"safeMode": true}))
|
||||
Reference in New Issue
Block a user