본문으로 이동
주 메뉴
주 메뉴
사이드바로 이동
숨기기
둘러보기
대문
최근 바뀜
요즘 화제
임의의 문서로
sitesupport
사용자 모임
사랑방
사용자 모임
관리 요청
편집 안내
소개
도움말
정책과 지침
질문방
한울위키
검색
검색
보이기
로그인
개인 도구
로그인
모듈:Su 문서 원본 보기
모듈
토론
English
읽기
원본 보기
역사 보기
도구
도구
사이드바로 이동
숨기기
동작
읽기
원본 보기
역사 보기
일반
여기를 가리키는 문서
가리키는 글의 최근 바뀜
문서 정보
보이기
사이드바로 이동
숨기기
←
모듈:Su
문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다:
일반 사용자
.
문서의 원본을 보거나 복사할 수 있습니다.
-- This module implements {{su}}. local p = {} function p.main(frame) -- Use arguments from the parent frame only, and remove any blank arguments. -- We don't need to trim whitespace from any arguments, as this module only -- uses named arguments, and whitespace is trimmed from them automatically. local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do if v ~= '' then args[k] = v end end -- Define the variables to pass to luaMain. local sup = args.p local sub = args.b local options = { align = args.a or args['정렬'], fontSize = args.w or args['폭'] or args['크기'] } return p._main(sup, sub, options) end function p._main(sup, sub, options) options = options or {} local span = mw.html.create('span') -- Set the styles. span:css{ ['display'] = 'inline-block', ['margin-bottom'] = '-0.3em', ['vertical-align'] = sub and '-0.4em' or '0.8em', ['line-height'] = '1.2em', } if options.fontSize == 'f' or options.fontSize == 'fixed' or options.fontSize == '고정' then span:css{ ['font-family'] = 'monospace,courier', ['font-size'] = '85%' } else span:css('font-size', options.fontSize and options.fontSize or '85%') end if options.align == 'r' or options.align == 'right' or options.align == '오른쪽' then span:css('text-align', 'right') elseif options.align == 'c' or options.align == 'center' or options.align == '가운데' then span:css('text-align', 'center') else span:css('text-align', 'left') end -- Add the wikitext. span :wikitext(sup) :tag('br', {selfClosing = true}):done() :wikitext(sub) return tostring(span) end return p
모듈:Su
문서로 돌아갑니다.
검색
검색
모듈:Su 문서 원본 보기
새 주제