Module:Dump Explained

-- Dump a table to help develop other modules.-- It is also possible to use mw.dumpObject but the result from this-- module is clearer and is close to valid Lua source.-- The main purpose is to allow easy inspection of Wikidata items.-- Preview the following in a sandbox to see entity Q833639 as a Lua table:-- -- Preview the following to dump a built-in table:--

local Collection -- a table to hold itemsCollection = Collection.__index = Collection

local function pre_block(text) -- Pre tags returned by a module do not act like wikitext

...
. return '
\n' ..
		mw.text.nowiki(text) ..
		(text:sub(-1) == '\n' and '' or '\n') ..
		'
\n'end

local function make_tabstr(indent) -- Return a string to generate one level of indent. if indent

'tab' then -- Tabs do not work well in a browser edit window, but can force them. return '\t' end indent = tonumber(indent) if not (type(indent)

'number' and 1 <= indent and indent <= 32) then indent = 4 end return string.rep(' ', indent)end

local function _dumphtml(html, tabwidth) -- Return a pretty-text formatted dump of an html string. -- This assumes clean html, for example, tag "