local export = {}

local ruby_auto = require('Module:ja-ruby').ruby_auto

function export.show_from_text(frame)
    local frame_p = frame:getParent()
    local args = {options = frame.args}
    args.term = frame_p.args[1] or error('The term text is missing')
    args.kana = frame_p.args[2] or error('The ruby text is missing')
    args.target = args.options[1]
    return ruby_auto(args)
end

function export.show_from_markup(frame)
    local frame_p = frame:getParent()
    local args = {options = frame.args}
    args.markup = frame_p.args[1] or error('The markup is missing')
    args.target = args.options[1]
    return ruby_auto(args)
end

return export