モジュール:ja-ruby/template

出典: フリー多機能辞典『ウィクショナリー日本語版(Wiktionary)』
ナビゲーションに移動 検索に移動

このモジュールについての説明文ページを モジュール:ja-ruby/template/doc に作成できます

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('通常文字の文字列が必要です')
    args.kana = frame_p.args[2] or error('ルビの文字列が必要です')
    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('[]()記号の文字列が必要です')
    args.target = args.options[1]
    return ruby_auto(args)
end

return export