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
+16
@@ -0,0 +1,16 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "markdown" for Markdown
|
||||
|
||||
var code = Markdown.toHtml("```\ncode here\n```")
|
||||
System.print(code.contains("<pre><code>")) // expect: true
|
||||
System.print(code.contains("code here")) // expect: true
|
||||
System.print(code.contains("</code></pre>")) // expect: true
|
||||
|
||||
var quote = Markdown.toHtml("> quoted text")
|
||||
System.print(quote.contains("<blockquote>")) // expect: true
|
||||
System.print(quote.contains("quoted text")) // expect: true
|
||||
System.print(quote.contains("</blockquote>")) // expect: true
|
||||
|
||||
var hr = Markdown.toHtml("---")
|
||||
System.print(hr.contains("<hr>")) // expect: true
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "markdown" for Markdown
|
||||
|
||||
System.print(Markdown.toHtml("**bold**")) // expect: <p><strong>bold</strong></p>
|
||||
System.print(Markdown.toHtml("*italic*")) // expect: <p><em>italic</em></p>
|
||||
System.print(Markdown.toHtml("`code`")) // expect: <p><code>code</code></p>
|
||||
System.print(Markdown.toHtml("~~deleted~~")) // expect: <p><del>deleted</del></p>
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "markdown" for Markdown
|
||||
|
||||
System.print(Markdown.toHtml("# Heading 1")) // expect: <h1>Heading 1</h1>
|
||||
System.print(Markdown.toHtml("## Heading 2")) // expect: <h2>Heading 2</h2>
|
||||
System.print(Markdown.toHtml("### Heading 3")) // expect: <h3>Heading 3</h3>
|
||||
System.print(Markdown.toHtml("###### Heading 6")) // expect: <h6>Heading 6</h6>
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "markdown" for Markdown
|
||||
|
||||
var link = Markdown.toHtml("[Google](https://google.com)")
|
||||
System.print(link.contains("<a href=\"https://google.com\">Google</a>")) // expect: true
|
||||
|
||||
var img = Markdown.toHtml("")
|
||||
System.print(img.contains("<img src=\"image.png\" alt=\"Alt text\">")) // expect: true
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "markdown" for Markdown
|
||||
|
||||
var ul = Markdown.toHtml("- item 1\n- item 2")
|
||||
System.print(ul.contains("<ul>")) // expect: true
|
||||
System.print(ul.contains("<li>item 1</li>")) // expect: true
|
||||
System.print(ul.contains("<li>item 2</li>")) // expect: true
|
||||
System.print(ul.contains("</ul>")) // expect: true
|
||||
|
||||
var ol = Markdown.toHtml("1. first\n2. second")
|
||||
System.print(ol.contains("<ol>")) // expect: true
|
||||
System.print(ol.contains("<li>first</li>")) // expect: true
|
||||
System.print(ol.contains("</ol>")) // expect: true
|
||||
Reference in New Issue
Block a user