feat: add merge_all_wren utility, strutil demo, and 7 new API manual pages
Add WrenFileReader class in apps/merge_all_wren.wren for recursive .wren file discovery and content printing. Introduce example/strutil_demo.wren demonstrating case conversion, hex encoding, SHA256 hashing, string repetition, padding, HTML/JSON escaping, and URL encoding/decoding. Create manual/api pages for argparse, dataset, html, markdown, uuid, wdantic, and web modules. Update manual/api/index.html sidebar and module count from 21 to 28, adding links and cards for the new modules.
This commit is contained in:
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "pathlib" for Path
|
||||
|
||||
var p1 = Path.new("/home/user")
|
||||
System.print(p1.isAbsolute) // expect: true
|
||||
System.print(p1.root) // expect: /
|
||||
System.print(p1.anchor) // expect: /
|
||||
|
||||
var p2 = Path.new("relative/path")
|
||||
System.print(p2.isAbsolute) // expect: false
|
||||
System.print(p2.root) // expect:
|
||||
System.print(p2.anchor) // expect:
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "pathlib" for Path
|
||||
|
||||
var p1 = Path.new("/home/user/file.txt")
|
||||
System.print(p1.toString) // expect: /home/user/file.txt
|
||||
|
||||
var p2 = Path.new("")
|
||||
System.print(p2.toString) // expect:
|
||||
|
||||
var p3 = Path.new(p1)
|
||||
System.print(p3.toString) // expect: /home/user/file.txt
|
||||
|
||||
var p4 = Path.new("/home") / "user" / "file.txt"
|
||||
System.print(p4.toString) // expect: /home/user/file.txt
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "pathlib" for Path
|
||||
|
||||
var p1 = Path.new("/home/user/file.tar.gz")
|
||||
System.print(p1.name) // expect: file.tar.gz
|
||||
System.print(p1.stem) // expect: file.tar
|
||||
System.print(p1.suffix) // expect: .gz
|
||||
System.print(p1.suffixes) // expect: [.tar, .gz]
|
||||
|
||||
var p2 = Path.new("/home/user/file.txt")
|
||||
System.print(p2.name) // expect: file.txt
|
||||
System.print(p2.stem) // expect: file
|
||||
System.print(p2.suffix) // expect: .txt
|
||||
System.print(p2.suffixes) // expect: [.txt]
|
||||
|
||||
var p3 = Path.new("/home/user/noext")
|
||||
System.print(p3.name) // expect: noext
|
||||
System.print(p3.stem) // expect: noext
|
||||
System.print(p3.suffix) // expect:
|
||||
System.print(p3.suffixes) // expect: []
|
||||
|
||||
var p4 = Path.new("/home/user/.hidden")
|
||||
System.print(p4.name) // expect: .hidden
|
||||
System.print(p4.stem) // expect: .hidden
|
||||
System.print(p4.suffix) // expect:
|
||||
System.print(p4.suffixes) // expect: []
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "pathlib" for Path
|
||||
|
||||
var p1 = Path.new("/home/user/file.txt")
|
||||
System.print(p1.parent) // expect: /home/user
|
||||
System.print(p1.parent.parent) // expect: /home
|
||||
System.print(p1.parent.parent.parent) // expect: /
|
||||
|
||||
var p2 = Path.new("/home/user/file.txt")
|
||||
var parents = p2.parents
|
||||
System.print(parents.count) // expect: 3
|
||||
System.print(parents[0]) // expect: /home/user
|
||||
System.print(parents[1]) // expect: /home
|
||||
System.print(parents[2]) // expect: /
|
||||
|
||||
var p3 = Path.new("relative/path")
|
||||
System.print(p3.parent) // expect: relative
|
||||
|
||||
var p4 = Path.new("file.txt")
|
||||
System.print(p4.parent) // expect: .
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "pathlib" for Path
|
||||
|
||||
var p1 = Path.new("/home/user/file.txt")
|
||||
System.print(p1.parts) // expect: [/, home, user, file.txt]
|
||||
|
||||
var p2 = Path.new("relative/path/file.txt")
|
||||
System.print(p2.parts) // expect: [relative, path, file.txt]
|
||||
|
||||
var p3 = Path.new("")
|
||||
System.print(p3.parts) // expect: []
|
||||
|
||||
var p4 = Path.new("/")
|
||||
System.print(p4.parts) // expect: [/]
|
||||
|
||||
var p5 = Path.new("file.txt")
|
||||
System.print(p5.parts) // expect: [file.txt]
|
||||
Reference in New Issue
Block a user