local M = {} M.setup = function() -- nothing end ---@class rafta.Slides ---@fields slides string[]: The slides of the file --- Takes some lines and parses them ---@param lines string[]: The lines in the buffer ---@return rafta.Slides local parse_slides = function(lines) local current_slide = {} local sep = "^#" local slides = { slides = {} } for _, line in ipairs(lines) do print(line, "find:", line:find(sep), "|") if line:find(sep) then if #current_slide > 0 then table.insert(slides.slides, current_slide) end current_slide = {} end table.insert(current_slide, line) end table.insert(slides.slides, current_slide) return slides end vim.print(parse_slides({ "# Hello", "this is something else", "# World", "this is another thing", })) return M