모듈:위키베이스 편집 버튼

최근 편집: 2021년 12월 18일 (토) 22:58

이 모듈에 대한 설명문서는 모듈:위키베이스 편집 버튼/설명문서에서 만들 수 있습니다

local yesno = require('Module:@en/Yesno')
local mArguments = require('Module:@en/Arguments')

p = {}

function p.main(frame)
  local args = mArguments.getArgs(frame)

  local qid = args.qid
  if not qid then qid = mw.wikibase.getEntityIdForCurrentPage() end
  if not qid then
    return args.noqid or ''
  end

  local pid = args.pid or ''

  if yesno(args.noicon) == true then
    return '[[Item:' .. qid .. '|정보 수정]]'
  else
    return '[[File:OOjs UI icon edit-ltr-colored.svg|frameless|text-top|10px|alt=' ..
    '위키베이스 항목 수정하기' ..
    '|link=Item:' ..
    qid ..
    (pid == '' and '' or ('#' .. pid)) ..
    ']]'
  end
end

return p