Difference between pages "Module:Hatnote inline" and "Module:Hatnote inline/sandbox"

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
(Blackwikiadmin changed the content model of the page Module:Hatnote inline from "wikitext" to "Scribunto")
Tag: content model change
 
m (3 revisions imported)
 
Line 1: Line 1:
--------------------------------------------------------------------------------
+
<includeonly>{{Hatnote inline/invoke/sandbox|1={{{1|{{{text|{{{content|}}}}}}}}}|extraclasses={{{class|{{{extraclasses|}}}}}}|selfref={{#if:{{{printworthy|{{{selfref|}}}}}}||yes}}|category={{{category|}}}|inline=true}}</includeonly><noinclude>
--                              Module:Hatnote-inline                         --
 
--                                                                            --
 
-- This module produces hatnote-style links and links to related articles,    --
 
-- but inside a <span>, instead of the <div> used by Module:Hatnote.  It      --
 
-- implements the {{hatnote-inline}} meta-template.                          --
 
--------------------------------------------------------------------------------
 
  
local mHatnote = require('Module:Hatnote')
+
;Test {{para|selfref|no}}:
local mArguments = require('Module:Arguments')
+
Foo1 {{hatnote inline/sandbox|selfref=no|bar1}} baz1
local yesno = require('Module:Yesno')
 
local p = {}
 
  
function p.hatnoteInline (frame)
+
;Test {{para|printworthy|yes}}:
local args = mArguments.getArgs(frame)
+
Foo2 {{hatnote inline/sandbox|printworthy=yes|bar2}} baz2
local hatnote = mHatnote.hatnote(frame)
 
if args.inline == nil or yesno(args.inline, true) then
 
local subs = {
 
['^<div'] = '<span',
 
['</div>$'] = '</span>'
 
}
 
for k, v in pairs(subs) do hatnote = string.gsub(hatnote, k, v) end
 
end
 
return hatnote
 
end
 
  
p.hatnote = p.hatnoteInline --alias
+
;Test default to selfref:
 +
Foo3 {{hatnote inline/sandbox|bar3}} baz3
  
return p
+
{{documentation}}
 +
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
 +
</noinclude>