Module:ja-furigana

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This does plain unlinked furigana for Japanese. It's like {{ja-usex}} but doesn't produce a romanization or accept a translation.

This accepts two unnamed parameters:

  1. the bottom part (usually the form written in kanji)
  2. the form written in kana

Requiring Module:ja-ruby.

A user has added this module page to requests for deletion(+).
Please see that page for discussion and justifications beyond the initial comment of: “replaced by mod:ja-ruby/template. You may continue to edit this module page while the discussion proceeds, but please mention significant edits at the RFD discussion and ensure that the intention of votes already cast is not left unclear. Do not remove the {{rfd}} until the debate has finished.

local export = {}
-- [[Module:ja-ruby]]

function export.show(frame)
	local args = frame:getParent().args
	local first_param = args[1] or error("Example has not been specified. Please pass parameter 1 to the module invocation.")
	local kana = args[2] ~= '' and args[2] or first_param
	-- if user only specified one param, assume first param is only kana (no kanji)
	return ('<span lang="ja" class="Jpan">%s</span>'):format(require('Module:ja-ruby').ruby_auto{
		term = first_param,
		kana = kana,
	})
end

return export