「モジュール:SignalinstWiki」の版間の差分

編集の要約なし
編集の要約なし
74行目: 74行目:
     return finalOutput
     return finalOutput
end
end




79行目: 80行目:
     local output = ""
     local output = ""


    -- TopCategory=true なカテゴリページ一覧を取得
     local categories = frame:expandTemplate{ title = "カテゴリ一覧" }
     local categories = frame:expandTemplate{title="カテゴリ一覧"}
    local i = 1


    local i = 1
     for category in mw.text.gsplit(categories or "", ",", true) do
     for category in mw.text.gsplit(categories or "", ",", true) do
         if category ~= "" then
         if category ~= "" then
            -- Category 名前空間を除去
             local categoryName = category:gsub("^カテゴリ:", "")
             local categoryName = category:gsub("^カテゴリ:", "")


            -- Concept を使ってページ取得
             local pages = frame:expandTemplate{
             local pages = frame:expandTemplate{title="カテゴリ別ページ一覧", args={category}}
                title = "カテゴリ別ページ一覧",
                args = { category }
            }


             output = output
             output = output
                 .. "header" .. i .. "=" .. categoryName .. "\n|"
                 .. "\n|header" .. i .. "=" .. categoryName
                .. "content" .. i .. "=" .. (pages or "") .. "\n|"
                .. "\n|content" .. i .. "=" .. (pages or "")


             i = i + 1
             i = i + 1
         end
         end
     end
     end
    -- デバッグ用
     mw.log(output)
     mw.log(output)
     return output
     return output
end
end




return p
return p