Volatile:ListMolByReference: Difference between revisions

mNo edit summary
mNo edit summary
Line 2: Line 2:
Searching IDs with {{{1}}} in the reference namespace.  
Searching IDs with {{{1}}} in the reference namespace.  
</noinclude>{{#def:list|{{#SearchLineReg:{{{1}}}|Reference}}}}
</noinclude>{{#def:list|{{#SearchLineReg:{{{1}}}|Reference}}}}
Showing below {{#count:{{#var:list}}}} results of search <tt>{{{1}}}</tt>.


{{#replace:
{{#replace:
Line 13: Line 12:
     else table.insert(S[sp], ref) end
     else table.insert(S[sp], ref) end
   end
   end
  print("Showing below "..#idS.. "structures.")
   for k,v in pairs(idS) do
   for k,v in pairs(idS) do
     print("* [[Image:" ..k.. ".png]] ")
     print("* [[Image:" ..k.. ".png]] ")

Revision as of 05:04, 10 March 2013

Searching IDs with {{{1}}} in the reference namespace.


{{#lua:

 idS = {}
 for ref, sp, id in stdin:gmatch("|?|?([^|]+)||([%w\., ]+)||([^\n]+)") do
   local S = idS[id]
   if (S == nil) then idS[id]={} S = idS[id] end
   if (S[sp] == nil) then S[sp] = {ref}
   else table.insert(S[sp], ref) end
 end
 print("Showing below "..#idS.. "structures.")
 for k,v in pairs(idS) do
   print("* File:" ..k.. ".png ")
   for i,w in pairs(v) do
     print(i)
     for j,x in ipairs(w) do
       print("(ref)")
     end
   end
 end

| {{{1}}} }}