Skip to content

Commit d837faa

Browse files
committed
Add docs for renderText, update Jetzig
1 parent c0d4d71 commit d837faa

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
// internet connectivity.
1818
.dependencies = .{
1919
.jetzig = .{
20-
.url = "https://github.com/jetzig-framework/jetzig/archive/86d82026ab574d4e5c3c6cc3817dda84b510001a.tar.gz",
21-
.hash = "jetzig-0.0.0-IpAgLTkzDwDKmsY9MqM41EHDXWGkViiECa0lzV8xl17x",
20+
.url = "https://github.com/jetzig-framework/jetzig/archive/fe49185c32a18981abca1baaf518857837682b23.tar.gz",
21+
.hash = "jetzig-0.0.0-IpAgLZRQDwBiO15WJWWpLa2sTI6ZW4mTAZKRaU9pkPXW",
2222
},
2323
},
2424
.paths = .{

src/app/views/documentation/sections/requests/rendering.md.zmpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ It _Jetzig_, template data and _JSON_ data are interchangeable. Any values creat
3232

3333
See the _Data_ documentation for more details.
3434

35+
## Text
36+
37+
Render text directly using `request.renderText`. Use this option when you have some raw text that can be rendered directly, bypassing the template/JSON layers.
38+
39+
```zig
40+
pub fn index(request: *jetzig.Request) !jetzig.View {
41+
request.response.content_type = "text/xml";
42+
return request.renderText("<foo><bar>baz</bar></foo>", .ok);
43+
}
44+
```
45+
3546
## Example
3647

3748
The below example, taken from the `downloads.zig` view of this website shows a complete view function. It is automatically capable of responding to _JSON_ and _HTML_ requests.

0 commit comments

Comments
 (0)