Module:Documentation: Difference between revisions

Add direct doc content, for those small page-specific templates that really don't need a dedicated doc page.
Preserve spacing
Line 18: Line 18:
-- Creating a documentation page or transclution through {{subst:doc}}
-- Creating a documentation page or transclution through {{subst:doc}}
function p.create( f )
function p.create( f )
local args = require( 'Module:ProcessArgs' ).norm()
local args = f:getParent().args
local page = mw.title.getCurrentTitle()
local page = mw.title.getCurrentTitle()
local docPage = args.page or page.nsText .. ':' .. page.baseText .. '/doc'
local docPage = args.page or page.nsText .. ':' .. page.baseText .. '/doc'