Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

This script generates the mult-mesh field template for Wikipedia's Infobox_disease

View gist:3564040
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# This script generates the mult-mesh field template for Wikipedia's Infobox_disease
 
print "| label8 = [[Medical Subject Headings|MeSH]]\n";
print "| data8 = ";
print "{{#if:{{{MeshID|}}}{{{MeSH|}}}{{{MeSH1|}}}";
print "|{{mesh2|{{{MeshID|{{{MeSH|{{{MeSH1}}}}}}}}}";
print "|year={{{MeshYear|{{{MeshYear1|{{CURRENTYEAR}}}}}}}}}}}}";
 
my $startm = "{{{MeshID|}}}{{{MeSH|}}}{{{MeSH1|}}}";
my $starty = "{{{MeshYear|{{{MeshYear1|}}}}}}";
 
for (my $i = 2; $i < 10; ++$i) {
print "{{#if:{{{MeSH$i|}}}|";
print "{{#if:";
print $startm;
for (my $j = 2; $j < $i; ++$j) {
print "{{{MeSH$j|}}}";
}
print "|,}}";
print " {{mesh2|{{{MeSH$i|}}}|year={{{MeshYear$i|{{CURRENTYEAR}}}}}}}";
print "}}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.