ページの編集 ソースエディタ 警告: ログインしていません。編集を行うと、あなたの IP アドレスが公開されます。ログインまたはアカウントを作成すれば、あなたの編集はその利用者名とともに表示されるほか、その他の利点もあります。 スパム攻撃防止用のチェックです。 けっして、ここには、値の入力はしないでください!local p = {} function p.YearNav(frame) Pattern = frame.args[1] or -1 if Pattern==-1 then Pattern = "####-10 ・・ ####-1 ・ '''####''' ・ ####+1 ・・ ####+10" --Default. Will be overwritten if something was there. for i,v in pairs(frame.args) do Pattern= i .. "=" .. v end end ThisPageTitle = mw.title.getCurrentTitle() Prefix = ThisPageTitle.nsText Namespace = ThisPageTitle.namespace PageName = ThisPageTitle.text --Prefix = "Category" --Namespace = 0 --PageName = "1987 Sandwiches" _, _, OriginalYear = string.find(PageName, "(%d%d%d%d)") PageWithout = string.gsub(PageName, OriginalYear, "@@@@") CurrentText = Pattern itsthere, _, _, _ = string.find(CurrentText, "####([%+%-])(%d+)") while itsthere do --Continue while there are still instances in the pattern to alter _, _, plusminus, amount = string.find(CurrentText, "####([%+%-])(%d+)") if plusminus=="-" then NewYear = OriginalYear - amount else --assume it's plus NewYear = OriginalYear + amount end NewPageName = string.gsub(PageWithout, "@@@@", NewYear) if Namespace==0 then ReplacementSection = "[[" .. NewPageName .. "]]" else ReplacementSection = "[[:" .. Prefix .. ":" .. NewPageName .. "|" .. NewPageName .. "]]" end CurrentText = string.gsub(CurrentText, "####[%+%-]%d+", ReplacementSection, 1) itsthere, _, _, _ = string.find(CurrentText, "####([%+%-])(%d+)") end CurrentText = string.gsub(CurrentText, "####", PageName) return CurrentText end function p.JustTheYear(frame) ThisPageTitle = mw.title.getCurrentTitle() PageName = ThisPageTitle.text _, _, OriginalYear = string.find(PageName, "(%d%d%d%d)") return OriginalYear end return p 編集内容の要約: ハロー!プロジェクト Wikiへの投稿はすべて、「CC-BY-SA」に従って公開されるものとしてみなされます 取り消し 編集の仕方 (新しいウィンドウで開きます) 下記は一般に利用されるウィキマークアップコードです。使用したいものをクリックすると編集ボックスにそれが出現します。 挿入: – — … ° ≈ ≠ ≤ ≥ ± − × ÷ ← → · § あなたのユーザー名で署名する: ~~~~ ウィキマークアップ: {{}} | [] [[]] [[Category:]] #REDIRECT [[]] <s></s> <sup></sup> <sub></sub> <code></code> <blockquote></blockquote> <ref></ref> {{Reflist}} <references/> <includeonly></includeonly> <noinclude></noinclude> {{DEFAULTSORT:}} <nowiki></nowiki> <!-- --> <span class="plainlinks"></span> Symbols: ~ | ¡ ¿ † ‡ ↔ ↑ ↓ • ¶ # ¹ ² ³ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ∞ ‘ “ ’ ” «» ¤ ₳ ฿ ₵ ¢ ₡ ₢ $ ₫ ₯ € ₠ ₣ ƒ ₴ ₭ ₤ ℳ ₥ ₦ № ₧ ₰ £ ៛ ₨ ₪ ৳ ₮ ₩ ¥ ♠ ♣ ♥ ♦ ♡ ・ × ∮ ♪ ☆ ℃ ○ 。 ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ 年 月 日 このテンプレートを編集