feat(content): parse document preemble
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Has been cancelled
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Has been cancelled
Show title stored in preemble of markdown file if available.
This commit is contained in:
@@ -6,7 +6,9 @@ pub fn main() !void {
|
||||
|
||||
const allocator = gpa.allocator();
|
||||
|
||||
var app: App = .init(.{});
|
||||
var app: App = .init(.{
|
||||
.document = .init(@embedFile("blog")),
|
||||
});
|
||||
var renderer = zterm.Renderer.Buffered.init(allocator);
|
||||
defer renderer.deinit();
|
||||
|
||||
@@ -18,6 +20,8 @@ pub fn main() !void {
|
||||
},
|
||||
}, .{});
|
||||
defer container.deinit();
|
||||
var content_container: App.Container = undefined;
|
||||
defer content_container.deinit();
|
||||
|
||||
// header with navigation buttons and content's title
|
||||
{
|
||||
@@ -60,7 +64,7 @@ pub fn main() !void {
|
||||
// main actual tui_website page content
|
||||
{
|
||||
var content: Content = .init(allocator);
|
||||
const content_container: App.Container = try .init(allocator, .{}, content.element());
|
||||
content_container = try .init(allocator, .{}, content.element());
|
||||
|
||||
var scrollable: App.Scrollable = .init(content_container, .enabled(.green));
|
||||
// intermediate container for *padding* containing the scrollable `Content`
|
||||
|
||||
Reference in New Issue
Block a user