경고 : 최신판이 아닙니다. 이 문서의 오래된 판을 편집하고 있습니다. 이것을 저장하면, 이 판 이후로 바뀐 모든 편집이 사라집니다. 로그인하고 있지 않습니다. 편집하면 당신의 IP 주소가 공개적으로 기록됩니다. 계정을 만들고 로그인하면 편집 시 사용자 이름만 보이며, 위키 이용에 여러 가지 편의가 주어집니다.스팸 방지 검사입니다. 이것을 입력하지 마세요!local mw = mw local ustring = mw.ustring local getArgs = require('Module:Arguments').getArgs --- frame 변수 처리 local p = {} ------------------------- code to char ------------------------------------------ ---@param code string string: U+ABCD function p.tochar(code) return ustring.char(tonumber(code:gsub(" ", ""):gsub("[Uu][+]", "0x"), 16)) end ------------------------- codepoint ------------------------------------------ --- ---문자 코드를 반환합니다. ---@param data table | string table : frame, string : char ---@param base string example) 10 : U+1234, r10 : 1234, 16(normal) : U+ABCD ---@param offset integer ---@return string function p.code(data, base, offset) local char if type(data) == 'table' then char = getArgs(data)[1] or nil else char = data end if type(char) == 'number' or type(char) == 'nil' then return '입력값이 없습니다.' end if offset == nil then offset = 0 end local baseformat, head p.codepoint = ustring.codepoint(char) if base == '10' then baseformat = '%d'; head = 'U+' elseif base == 'r10' then return p.codepoint + offset else baseformat = '%x'; head = 'U+' end return head ..ustring.upper(ustring.format(baseformat, p.codepoint + offset)) end ---------------------- next codepoint --------------------------------------- --- ---입력된 문자의 이후 문자 코드 반환 ---@param data table | string table : frame, string : char ---@return string function p.nextcode(data) local char if type(data) == 'table' then char = getArgs(data)[1] or nil else char = data or nil end if char then return p.code(char, '16', 1) else return '입력값이 없습니다.' end end ---------------------- prev codepoint --------------------------------------- --- ---입력된 문자의 이전 문자 코드 반환 ---@param data table | string table : frame, string : char ---@return string function p.prevcode(data) local char if type(data) == 'table' then char = getArgs(data)[1] or nil else char = data or nil end if char then return p.code(char, '16', -1) else return '입력값이 없습니다.' end end ---------------------- next char --------------------------------------- --- ---입력된 문자의 이후 문자 반환 ---@param data table | string table : frame, string : char ---@return string nextchar function p.nextchar(data) local char if type(data) == 'table' then char = getArgs(data)[1] or nil else char = data or nil end if char then return ustring.char(p.code(char, 'r10', 1)) else return '입력값이 없습니다.' end end ---------------------- prev char --------------------------------------- --- ---입력된 문자의 이전 문자 반환 ---@param data table | string table : frame, string : char ---@return string prevchar function p.prevchar(data) local char if type(data) == 'table' then char = getArgs(data)[1] or nil else char = data or nil end if char then return ustring.char(p.code(char, 'r10', -1)) else return '입력값이 없습니다.' end end p.unicodeBlock = require('Module:UnicodeBlock').unicodeBlock ---------------------- {{유니코드문자}} -------------------------- ---@param frame table ---@return string function p.unicodechar(frame) ---@type table local args = getArgs(frame) local class if args['class'] == 'x' then class = '' else class = args['class'] or 'infobox' end local charname = args['이름'] or mw.title.getCurrentTitle().prefixedText local curr = args[1] or args['기호'] or args['문자'] or nil local eng = args['영어이름'] or p.unicodeBlock(curr) local lang = args['lang'] or 'ko' local prefix = args['경로'] or '' local arrow = { prev = '<i class="fas fa-chevron-left unicodechar-arrow"></i></span>', next = '<i class="fas fa-chevron-right unicodechar-arrow"></i></span>' } local buildlink = require('Module:linkwithtemplate').test local function link(pagename, linktext, arrow, template, editintro) if template then return buildlink({ [1] = pagename, [2] = string.format('<div>%s<br>%s</div>', linktext, arrow), ['템플릿'] = template, ['editintro'] = editintro, }) else return ustring.format('[[%s|<div>%s<br>%s</div>]]', pagename, linktext, arrow or '') end end local htmlroot = mw.html.create('table') :addClass(class) :addClass('unicodechar') :cssText('margin: 0 auto ;max-width: ;width: ;float: right; text-align: center; clear:right') local tr, td if args['이름'] == '없음' then tr = ustring.format('<tr><th colspan="3"><small>%s</small></th></tr>',eng) else tr = ustring.format('<tr><th colspan="3"><div>%s</div><small>%s</small></th></tr>',charname, eng) end local prevlink, nextlink if curr == nil then return '<span class="warning">기호(문자)를 입력하지 않았습니다. |문자 = (문자)</span>' else if curr:find("[Uu]") then curr = p.tochar(curr) end local prevchar = args['이전'] or args['전문자']; local prevlinktext = args['전문자이름'] or args['이전이름'] or prevchar local nextchar = args['이후'] or args['후문자']; local nextlinktext = args['후문자이름'] or args['이후이름'] or nextchar --------------------- 이전 문자 if prevchar then prevlink = link(prevchar, prevlinktext, arrow.prev) --- 이전 문자 없으면 자동 계산 else local char = ustring.char(p.code(curr, 'r10', -1)) local pagename = prefix or '' local linktext = prevlinktext if ustring.codepoint(char) > 65535 then -- 문서 이름 결정 pagename = pagename .. p.code(curr, '16', -1); -- 문자 코드로 else pagename = pagename .. char; -- 문자로 end prevlink = link(pagename, linktext, arrow.prev, args['템플릿'], args['editintro']) end ------------------- 다음 문자 if nextchar then nextlink = link(nextchar, nextlinktext, arrow.next) --- 이전 문자 없으면 자동 계산 else local char = ustring.char(p.code(curr, 'r10', 1)) local pagename = prefix or '' local linktext = nextlinktext if ustring.codepoint(char) > 65535 then -- 문서 이름 결정 pagename = pagename .. p.code(curr, '16', 1); -- 문자 코드로 else pagename = pagename .. char; -- 문자로 end nextlink = link(pagename, linktext, arrow.next, args['템플릿'], args['editintro']) end end if args['순서반전'] then tr = ustring.format([[ <td class='unicodechar-prev' style="width: 7em;font-size:1.2em;" lang="%s">%s</td> <td class='unicodechar-char' style="width: 6em"><div style="font-size: 1.8em;line-height: 1.4em;"><b lang="%s">%s</b></div> <div style="font-size:80%%; color: gray; ">%s</div></td> <td class='unicodechar-next' style="width: 7em;font-size:1.2em;" lang="%s">%s</td>%s]], lang, prevlink, lang, curr, p.code(curr), lang, nextlink, tr) else tr = ustring.format([[%s <td class='unicodechar-prev' style="width: 7em;font-size:1.2em;" lang="%s">%s</td> <td class='unicodechar-char' style="width: 6em"><div style="font-size: 1.8em;line-height: 1.4em;"><b lang="%s">%s</b></div> <div style="font-size:80%%; color: gray; ">%s</div></td> <td class='unicodechar-next' style="width: 7em;font-size:1.2em;" lang="%s">%s</td>]], tr, lang, prevlink, lang, curr, p.code(curr), lang, nextlink) end return htmlroot:node(tr) end return p 요약: 리브레 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0 라이선스로 배포됩니다(자세한 내용에 대해서는 리브레 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요. 글이 직접 작성되었거나 호환되는 라이선스인지 확인해주세요. 리그베다 위키, 나무위키, 오리위키, 구스위키, 디시위키 및 CCL 미적용 사이트 등에서 글을 가져오실 때는 본인이 문서의 유일한 기여자여야 하고, 만약 본인이 문서의 유일한 기여자라는 증거가 없다면 그 문서는 불시에 삭제될 수 있습니다. 취소 편집 도움말 (새 창에서 열림) | () [] [[]] {{}} {{{}}} · <!-- --> · [[분류:]] · [[파일:]] · [[미디어:]] · #넘겨주기 [[]] · {{ㅊ|}} · <onlyinclude></onlyinclude> · <includeonly></includeonly> · <noinclude></noinclude> · <br /> · <ref></ref> · {{각주}} · {|class="wikitable" · |- · rowspan=""| · colspan=""| · |} {{lang|}} · {{llang||}} · {{인용문|}} · {{인용문2|}} · {{유튜브|}} · {{다음팟|}} · {{니코|}} · {{토막글}} {{삭제|}} · {{특정판삭제|}}(이유를 적지 않을 경우 기각될 가능성이 높습니다. 반드시 이유를 적어주세요.) {{#expr:}} · {{#if:}} · {{#ifeq:}} · {{#iferror:}} · {{#ifexist:}} · {{#switch:}} · {{#time:}} · {{#timel:}} · {{#titleparts:}} __NOTOC__ · __FORCETOC__ · __TOC__ · {{PAGENAME}} · {{SITENAME}} · {{localurl:}} · {{fullurl:}} · {{ns:}} –(대시) ‘’(작은따옴표) “”(큰따옴표) ·(가운뎃점) …(말줄임표) ‽(물음느낌표) 〈〉(홑화살괄호) 《》(겹화살괄호) ± − × ÷ ≈ ≠ ∓ ≤ ≥ ∞ ¬ ¹ ² ³ ⁿ ¼ ½ ¾ § € £ ₩ ¥ ¢ † ‡ • ← → ↔ ‰ °C µ(마이크로) Å °(도) ′(분) ″(초) Α α Β β Γ γ Δ δ Ε ε Ζ ζ Η η Θ θ Ι ι Κ κ Λ λ Μ μ(뮤) Ν ν Ξ ξ Ο ο Π π Ρ ρ Σ σ ς Τ τ Υ υ Φ φ Χ χ Ψ ψ Ω ω · Ά ά Έ έ Ή ή Ί ί Ό ό Ύ ύ Ώ ώ · Ϊ ϊ Ϋ ϋ · ΐ ΰ Æ æ Đ(D with stroke) đ Ð(eth) ð ı Ł ł Ø ø Œ œ ß Þ þ · Á á Ć ć É é Í í Ĺ ĺ Ḿ ḿ Ń ń Ó ó Ŕ ŕ Ś ś Ú ú Ý ý Ź ź · À à È è Ì ì Ǹ ǹ Ò ò Ù ù · İ Ż ż ·  â Ĉ ĉ Ê ê Ĝ ĝ Ĥ ĥ Î î Ĵ ĵ Ô ô Ŝ ŝ Û û · Ä ä Ë ë Ï ï Ö ö Ü ü Ÿ ÿ · ǘ ǜ ǚ ǖ · caron/háček: Ǎ ǎ Č č Ď ď Ě ě Ǐ ǐ Ľ ľ Ň ň Ǒ ǒ Ř ř Š š Ť ť Ǔ ǔ Ž ž · breve: Ă ă Ğ ğ Ŏ ŏ Ŭ ŭ · Ā ā Ē ē Ī ī Ō ō Ū ū · à ã Ñ ñ Õ õ · Å å Ů ů · Ą ą Ę ę · Ç ç Ş ş Ţ ţ · Ő ő Ű ű · Ș ș Ț ț 이 문서에서 사용한 틀: 틀:- (원본 보기) (준보호됨)틀:Wikitext (편집) 틀:새로고침 (원본 보기) (준보호됨)틀:설명문서 (원본 보기) (준보호됨)틀:유니코드문자 (편집) 틀:유니코드문자/설명문서 (편집) 모듈:Arguments (편집) 모듈:Linkwithtemplate (편집) 모듈:Unicode (편집) 모듈:Unicode/설명문서 (편집) 모듈:UnicodeBlock (편집)