build: shuffle files around for mdgen

This commit is contained in:
Mitchell Hashimoto
2024-01-21 14:40:48 -08:00
parent 0967fb46f8
commit ba98aa3aeb
8 changed files with 10 additions and 16 deletions

View File

@ -1172,9 +1172,9 @@ fn buildDocumentation(
inline for (manpages) |manpage| {
const generate_markdown = b.addExecutable(.{
.name = "generate_" ++ manpage.name ++ "_" ++ manpage.section ++ "_markdown",
.name = "mdgen_" ++ manpage.name ++ "_" ++ manpage.section,
.root_source_file = .{
.path = "src/generate_" ++ manpage.name ++ "_" ++ manpage.section ++ "_markdown.zig",
.path = "src/mdgen_" ++ manpage.name ++ "_" ++ manpage.section ++ ".zig",
},
.target = b.host,
});

View File

@ -1,6 +1,6 @@
const std = @import("std");
const Config = @import("config/Config.zig");
const Action = @import("cli/action.zig").Action;
const Config = @import("../../config/Config.zig");
const Action = @import("../../cli/action.zig").Action;
const help_strings = @import("help_strings");
const build_options = @import("build_options");

View File

@ -1,16 +1,13 @@
const std = @import("std");
const gen = @import("generate_markdown.zig");
const gen = @import("build/mdgen/mdgen.zig");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const alloc = gpa.allocator();
const writer = std.io.getStdOut().writer();
try gen.substitute(alloc, @embedFile("doc/ghostty_1_header.md"), writer);
try gen.substitute(alloc, @embedFile("build/mdgen/ghostty_1_header.md"), writer);
try gen.generate_actions(writer);
try gen.generate_config(writer, true);
try gen.substitute(alloc, @embedFile("doc/ghostty_1_footer.md"), writer);
try gen.substitute(alloc, @embedFile("build/mdgen/ghostty_1_footer.md"), writer);
}

View File

@ -1,15 +1,12 @@
const std = @import("std");
const gen = @import("generate_markdown.zig");
const gen = @import("build/mdgen/mdgen.zig");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const alloc = gpa.allocator();
const output = std.io.getStdOut().writer();
try gen.substitute(alloc, @embedFile("doc/ghostty_5_header.md"), output);
try gen.substitute(alloc, @embedFile("build/mdgen/ghostty_5_header.md"), output);
try gen.generate_config(output, false);
try gen.substitute(alloc, @embedFile("doc/ghostty_5_footer.md"), output);
try gen.substitute(alloc, @embedFile("build/mdgen/ghostty_5_footer.md"), output);
}