Compare commits

..
2 Commits
Author SHA1 Message Date
tangent dad2acc197 version in a better defined place 2026-08-26 19:47:07 -06:00
tangent 901990d6f5 make link actually optional 2026-08-26 19:46:21 -06:00
+11 -5
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env luajit
local version = "0.1"
local input_file_name = arg[1]
assert(input_file_name,
"You must enter an input file (its name will be the title).")
@@ -14,16 +16,20 @@ local output_file_name = title .. ".md"
local output_file = io.open(output_file_name, "w")
assert(output_file, "Could not open \"" .. output_file_name .. "\"")
for _, line in ipairs{
local frontmatter = {
"---",
"title: \"" .. title .. "\"",
"author: \"" .. author .. "\"",
"publisher: \"yt-transcript-tools v0.1\"",
"publisher: \"yt-transcript-tools v" .. version .. "\"",
"---",
"",
"From [" .. link .. "](" .. link .. ")",
"",
} do
}
if link and #link > 0 then
frontmatter[#frontmatter + 1] = "From [" .. link .. "](" .. link .. ")\n"
end
for _, line in ipairs(frontmatter) do
output_file:write(line)
output_file:write("\n")
end