Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fjebaker/atomz

An Atom syndication feed generator for Zig.
https://github.com/fjebaker/atomz

atom feed generator syndication zig

Last synced: 19 days ago
JSON representation

An Atom syndication feed generator for Zig.

Awesome Lists containing this project

README

        

# atomz

An Atom feed generator for Zig.

```zig
const std = @import("std");
const atomz = @import("atomz");

pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();

var feed = atomz.Feed.init(allocator);
defer feed.deinit();

try feed.setTitle("My new feed");
try feed.setAuthor("Syliva");

var entry = try feed.newEntry();
try entry.setTitle("The conquest of cake");

const ptr = try entry.newField("content", "This would be the content.");
try ptr.put("type", "text/html");

try feed.write(std.io.getStdOut().writer());
}
```

This will output the following:

```

My new feed
Syliva

The conquest of cake
This would be the content.

```