-- lx-bundle:true

-- This file is part of Lx, created by Liqube <www.liqube.com>
-- Copyright Liqube Audio. All rights reserved.
-- Lx Interim License. See LICENSE for details.

--- OpenDocument drawing extractor
-- @module plugins.odfutils.odg

local pages = require("plugins.odfutils.pages")

local reader = {}

--- Read one ODG file as plain text
-- @param filename string archive path
-- @return string|nil content extracted text
-- @return string|nil error extraction error
function reader.extract_text(filename)
	return pages.extract(filename, "text", "office:drawing", "Page", false)
end

--- Read one ODG file as Markdown
-- @param filename string archive path
-- @return string|nil content extracted Markdown
-- @return string|nil error extraction error
function reader.extract_markdown(filename)
	return pages.extract(filename, "markdown", "office:drawing", "Page", false)
end

return reader
