Line 82: |
Line 82: |
| end | | end |
| | | |
− | function NanaminShipInfo:build_table(class) | + | function NanaminShipInfo:build_table(class, remove_headers) |
| if self._sorted_entries[class] ~= nil then | | if self._sorted_entries[class] ~= nil then |
− | table.insert(self._rows, "===" .. class .. "s===") | + | if remove_headers then |
| + | table.insert(self._rows, "===" .. class .. "s===") |
| + | end |
| table.insert(self._rows, self._table_start) | | table.insert(self._rows, self._table_start) |
| | | |
Line 116: |
Line 118: |
| end | | end |
| | | |
− | function NanaminShipInfo:build_one(class) | + | function NanaminShipInfo:build_one(class, remove_headers) |
− | self:build_table(class) | + | self:build_table(class, remove_headers) |
| return table.concat(self._rows, "\n") | | return table.concat(self._rows, "\n") |
| end | | end |
Line 125: |
Line 127: |
| --mw.log(self._sorted_entries["Light Cruiser"]["111"][1][1]) | | --mw.log(self._sorted_entries["Light Cruiser"]["111"][1][1]) |
| table.insert(self._rows, "__NOTOC__") | | table.insert(self._rows, "__NOTOC__") |
− | if args["class"] then return self:build_one(args["class"]) end | + | if args["class"] then return self:build_one(args["class"], args["remove_headers"]) end |
| self:build_table("Battleship") | | self:build_table("Battleship") |
| self:build_table("Carrier") | | self:build_table("Carrier") |