উইকিবই
bnwikibooks
https://bn.wikibooks.org/wiki/%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE
MediaWiki 1.39.0-wmf.25
first-letter
মিডিয়া
বিশেষ
আলাপ
ব্যবহারকারী
ব্যবহারকারী আলাপ
উইকিবই
উইকিবই আলোচনা
চিত্র
চিত্র আলোচনা
মিডিয়াউইকি
মিডিয়াউইকি আলোচনা
টেমপ্লেট
টেমপ্লেট আলোচনা
সাহায্য
সাহায্য আলোচনা
বিষয়শ্রেণী
বিষয়শ্রেণী আলোচনা
উইকিশৈশব
উইকিশৈশব আলাপ
বিষয়
বিষয় আলাপ
রন্ধনপ্রণালী
রন্ধনপ্রণালী আলোচনা
TimedText
TimedText talk
মডিউল
মডিউল আলাপ
গ্যাজেট
গ্যাজেট আলোচনা
গ্যাজেট সংজ্ঞা
গ্যাজেট সংজ্ঞার আলোচনা
টেমপ্লেট:মুদ্রণ সংস্করণ
10
2090
46441
43165
2022-08-19T11:37:19Z
MdsShakil
7280
+
wikitext
text/x-wiki
{{mbox-side|type=growth|image=Printer.svg|text={{{3|{{BOOKNAME}}}}}-এর একটি '''''[[:{{existlist|{{{1}}}|/সকল পাতা|/মুদ্রণযোগ্য সংস্করণ|../সকল পাতা|../মুদ্রণযোগ্য সংস্করণ|{{FULLPAGENAME}}}}|মুদ্রণযোগ্য সংস্করণ]]''''' উপলব্ধ রয়েছে। <small>{{{2|}}} ([{{fullurl:{{existlist|{{{1}}}|/সকল পাতা|/মুদ্রণযোগ্য সংস্করণ|../সকল পাতা|../সকল পাতা|{{FULLPAGENAME}}}}|action=edit}} সম্পাদনা করুন])</small>}}<includeonly>{{#ifeq:{{{example|no}}}|no|[[Category:মুদ্রণ সংস্করণসহ বই|{{SUBPAGENAME}}]]}}</includeonly><noinclude>{{নথি}}</noinclude> <noinclude> [[বিষয়শ্রেণী:টেমপ্লেট]]</noinclude>
omr156glc7ajihammhb5srqmhp8h0dk
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ
100
3644
46431
39723
2022-08-19T11:07:35Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">বর্ণমালায় প্রাণীজগৎ'''</div>
[[চিত্র:বর্ণমালায় প্রাণীজগৎ.jpg|কেন্দ্র|500px]]<br />
<noinclude>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">স্বরবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/অ/]] [[/আ/]] [[/ই/]] [[/ঈ/]] [[/উ/]] [[/ঊ/]] [[/ঋ/]] [[/এ/]] [[/ঐ/]] [[/ও/]] [[/ঔ/]] --
</div>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">ব্যঞ্জনবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/ক/]] [[/খ/]] [[/গ/]] [[/ঘ/]] [[/ঙ/]] [[/চ/]] [[/ছ/]] [[/জ/]] [[/ঝ/]] [[/ঞ/]] [[/ট/]] [[/ঠ/]] [[/ড/]] [[/ঢ/]] [[/ণ/]] [[/ত/]] [[/থ/]] [[/দ/]] [[/ধ/]] [[/ন/]] [[/প/]] [[/ফ/]] [[/ব/]] [[/ভ/]] [[/ম/]] [[/য/]] [[/র/]] [[/ল/]] [[/শ/]] [[/ষ/]] [[/স/]] [[/হ/]] [[/ড়/]] [[/ঢ়/]] [[/য়/]] [[/ৎ/]] [[/ং/]] [[/ঃ/]] [[/ঁ/]] --
</div>
</noinclude>
<noinclude>
{{পাঠ্য স্তর|প্রাক-প্রাথমিক}}
{{অবস্থা|১০০%}}
{{বইয়ের বিষয়শ্রেণী}}
</noinclude>
5ruqaa462j07ezl2rzxj3bnc79ge50p
46433
46431
2022-08-19T11:13:10Z
MdsShakil
7280
wikitext
text/x-wiki
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">বর্ণমালায় প্রাণীজগৎ'''</div>
[[চিত্র:বর্ণমালায় প্রাণীজগৎ.jpg|কেন্দ্র|500px]]<br />
<noinclude>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">স্বরবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/অ/]] [[/আ/]] [[/ই/]] [[/ঈ/]] [[/উ/]] [[/ঊ/]] [[/ঋ/]] [[/এ/]] [[/ঐ/]] [[/ও/]] [[/ঔ/]] --
</div>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">ব্যঞ্জনবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/ক/]] [[/খ/]] [[/গ/]] [[/ঘ/]] [[/ঙ/]] [[/চ/]] [[/ছ/]] [[/জ/]] [[/ঝ/]] [[/ঞ/]] [[/ট/]] [[/ঠ/]] [[/ড/]] [[/ঢ/]] [[/ণ/]] [[/ত/]] [[/থ/]] [[/দ/]] [[/ধ/]] [[/ন/]] [[/প/]] [[/ফ/]] [[/ব/]] [[/ভ/]] [[/ম/]] [[/য/]] [[/র/]] [[/ল/]] [[/শ/]] [[/ষ/]] [[/স/]] [[/হ/]] [[/ড়/]] [[/ঢ়/]] [[/য়/]] [[/ৎ/]] [[/ং/]] [[/ঃ/]] [[/ঁ/]] --
</div>
</noinclude>
<noinclude>
{{পাঠ্য স্তর|প্রাক-প্রাথমিক}}
{{মুদ্রণ সংস্করণ|উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/সকল পাতা}}
{{অবস্থা|১০০%}}
{{বইয়ের বিষয়শ্রেণী}}
</noinclude>
5uytekzohj36fiomou3zn3sr876r25t
46435
46433
2022-08-19T11:17:26Z
MdsShakil
7280
wikitext
text/x-wiki
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">বর্ণমালায় প্রাণীজগৎ'''</div>
[[চিত্র:বর্ণমালায় প্রাণীজগৎ.jpg|কেন্দ্র|500px]]<br />
<noinclude>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">স্বরবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/অ/]] [[/আ/]] [[/ই/]] [[/ঈ/]] [[/উ/]] [[/ঊ/]] [[/ঋ/]] [[/এ/]] [[/ঐ/]] [[/ও/]] [[/ঔ/]] --
</div>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">ব্যঞ্জনবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/ক/]] [[/খ/]] [[/গ/]] [[/ঘ/]] [[/ঙ/]] [[/চ/]] [[/ছ/]] [[/জ/]] [[/ঝ/]] [[/ঞ/]] [[/ট/]] [[/ঠ/]] [[/ড/]] [[/ঢ/]] [[/ণ/]] [[/ত/]] [[/থ/]] [[/দ/]] [[/ধ/]] [[/ন/]] [[/প/]] [[/ফ/]] [[/ব/]] [[/ভ/]] [[/ম/]] [[/য/]] [[/র/]] [[/ল/]] [[/শ/]] [[/ষ/]] [[/স/]] [[/হ/]] [[/ড়/]] [[/ঢ়/]] [[/য়/]] [[/ৎ/]] [[/ং/]] [[/ঃ/]] [[/ঁ/]] --
</div>
</noinclude>
<noinclude>
{{পাঠ্য স্তর|প্রাক-প্রাথমিক}}
{{মুদ্রণ সংস্করণ|উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/সকল পাতা}}
{{অবস্থা|১০০%}}
{{বইয়ের বিষয়শ্রেণী}}
লেখক: [[ব্যবহারকারী:Sumasa|সুকান]]
</noinclude>
1uu1xifxtay85krtxgjwq88hungv6pe
46436
46435
2022-08-19T11:20:40Z
MdsShakil
7280
wikitext
text/x-wiki
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">বর্ণমালায় প্রাণীজগৎ'''</div>
[[চিত্র:বর্ণমালায় প্রাণীজগৎ.jpg|কেন্দ্র|500px]]<br />
<noinclude>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">স্বরবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/অ/]] [[/আ/]] [[/ই/]] [[/ঈ/]] [[/উ/]] [[/ঊ/]] [[/ঋ/]] [[/এ/]] [[/ঐ/]] [[/ও/]] [[/ঔ/]] --
</div>
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">ব্যঞ্জনবর্ণ'''</div>
<div style="font-size: x-large; text-align: center; margin: 0px auto 0px auto;">-- [[/ক/]] [[/খ/]] [[/গ/]] [[/ঘ/]] [[/ঙ/]] [[/চ/]] [[/ছ/]] [[/জ/]] [[/ঝ/]] [[/ঞ/]] [[/ট/]] [[/ঠ/]] [[/ড/]] [[/ঢ/]] [[/ণ/]] [[/ত/]] [[/থ/]] [[/দ/]] [[/ধ/]] [[/ন/]] [[/প/]] [[/ফ/]] [[/ব/]] [[/ভ/]] [[/ম/]] [[/য/]] [[/র/]] [[/ল/]] [[/শ/]] [[/ষ/]] [[/স/]] [[/হ/]] [[/ড়/]] [[/ঢ়/]] [[/য়/]] [[/ৎ/]] [[/ং/]] [[/ঃ/]] [[/ঁ/]] --
</div>
</noinclude>
<noinclude>
{{পাঠ্য স্তর|প্রাক-প্রাথমিক}}
{{মুদ্রণ সংস্করণ|উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/সকল পাতা}}
{{অবস্থা|১০০%}}
{{বইয়ের বিষয়শ্রেণী}}
{{বর্ণানুক্রমিক|ব}}
লেখক: [[ব্যবহারকারী:Sumasa|সুকান]]
</noinclude>
047c1t6pla38yo9qc3uh2vocy5hh77r
উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ
100
4197
46437
46288
2022-08-19T11:21:07Z
MdsShakil
7280
wikitext
text/x-wiki
[[চিত্র:Wikijunior_Animal_Alphabet.jpg|কেন্দ্র|500px]]<br />
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">'''উইকিশৈশব ইংরেজি বর্ণমালায় প্রাণী'''</div>
<noinclude>
<div style="font-size: large; text-align: center; margin: 0px auto 0px auto;">-- [[/A/]] [[/B/]] [[/C/]] [[/D/]] [[/E/]] [[/F/]] [[/G/]] [[/H/]] [[/I/]] [[/J/]] [[/K/]] [[/L/]] [[/M/]] [[/N/]] [[/O/]] [[/P/]] [[/Q/]] [[/R/]] [[/S/]] [[/T/]] [[/U/]] [[/V/]] [[/W/]] [[/X/]] [[/Y/]] [[/Z/]] --
[[/লেখকবৃন্দ/]]<br/>
[http://en.wikibooks.org/w/index.php?title=Wikijunior_Animal_Alphabet/All_pages&printable=yes Printable HTML Version]<br/>
[http://tools.wikimedia.de/~gmaxwell/jorbis/commonsJOrbisPlayer.php?path=Animal_Alphabet-320x240-kmf.ogg&wiki=en Video] - [http://upload.wikimedia.org/wikipedia/commons/f/f3/Animal_Alphabet-320x240-kmf.ogg Downloadable Video] - [http://commons.wikimedia.org/wiki/Image:Animal_Alphabet-320x240-kmf.ogg Info]</div>
<noinclude>
{{অবস্থা|১০০%}}
{{বর্ণানুক্রমিক|ই}}
{{মুদ্রণ সংস্করণ}}
{{বইয়ের বিষয়শ্রেণী}}
</noinclude>
kz83ae4v5f8oz2bu96h5xzdae4f5q5v
46440
46437
2022-08-19T11:34:34Z
MdsShakil
7280
wikitext
text/x-wiki
[[চিত্র:Wikijunior_Animal_Alphabet.jpg|কেন্দ্র|500px]]<br />
<div style="font-size: xx-large; text-align: center; margin: 0px auto 0px auto;">'''উইকিশৈশব ইংরেজি বর্ণমালায় প্রাণী'''</div>
<noinclude>
<div style="font-size: large; text-align: center; margin: 0px auto 0px auto;">-- [[/A/]] [[/B/]] [[/C/]] [[/D/]] [[/E/]] [[/F/]] [[/G/]] [[/H/]] [[/I/]] [[/J/]] [[/K/]] [[/L/]] [[/M/]] [[/N/]] [[/O/]] [[/P/]] [[/Q/]] [[/R/]] [[/S/]] [[/T/]] [[/U/]] [[/V/]] [[/W/]] [[/X/]] [[/Y/]] [[/Z/]] --
[[/লেখকবৃন্দ/]]<br/>
[http://en.wikibooks.org/w/index.php?title=Wikijunior_Animal_Alphabet/All_pages&printable=yes Printable HTML Version]<br/>
[http://tools.wikimedia.de/~gmaxwell/jorbis/commonsJOrbisPlayer.php?path=Animal_Alphabet-320x240-kmf.ogg&wiki=en Video] - [http://upload.wikimedia.org/wikipedia/commons/f/f3/Animal_Alphabet-320x240-kmf.ogg Downloadable Video] - [http://commons.wikimedia.org/wiki/Image:Animal_Alphabet-320x240-kmf.ogg Info]</div>
<noinclude>
{{অবস্থা|১০০%}}
{{বর্ণানুক্রমিক|ই}}
{{মুদ্রণ সংস্করণ|উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/সকল পাতা}}
{{বইয়ের বিষয়শ্রেণী}}
</noinclude>
ay5oi7alkuwuv1czjjw1o3cszvyl3b7
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/অ
100
8949
46332
27497
2022-08-19T10:44:56Z
MdsShakil
7280
+টেমপ্লেট
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''অ''' এ '''অ'''জগর
[[চিত্র:Snake Python.jpg|300px]]
<br>
অজগর ছোটো নয়।
তাকে দেখে ভয় হয়!</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
41ekfcsko5w9thta42vhez199xnm5qt
46378
46332
2022-08-19T11:03:16Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''অ''' এ '''অ'''জগর
[[চিত্র:Snake Python.jpg|300px]]
<br>
অজগর ছোটো নয়।
তাকে দেখে ভয় হয়!</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
qn7tkisy2gi6t4ix8pae2cglyi7onul
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/আ
100
8951
46333
27498
2022-08-19T10:53:27Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''আ''' এ '''আ'''রশোলা
[[চিত্র:Cockroach. Dictyoptera - Flickr - gailhampshire.jpg|কেন্দ্র|300px]]
<br>
আরশোলা ওড়ে যত।
<br>
ছোটো বড়ো থতমত!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
mkm5o8ej24u0dgdsiecduxw5671k4qy
46379
46333
2022-08-19T11:03:18Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''আ''' এ '''আ'''রশোলা
[[চিত্র:Cockroach. Dictyoptera - Flickr - gailhampshire.jpg|কেন্দ্র|300px]]
<br>
আরশোলা ওড়ে যত।
<br>
ছোটো বড়ো থতমত!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
dv9erx39u3tk3dqhmru9n8vsomcyhjx
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ই
100
8964
46334
27499
2022-08-19T10:53:39Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ই''' এ '''ই'''গল
[[চিত্র:Flying Eagle.jpg|কেন্দ্র|300px]]
ইগলটা উড়ে যায়।
<br>
ইঁদুরেরা ভয় পায়!</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
3saksu1k1if6vuf2ankv5doaua3kphb
46380
46334
2022-08-19T11:03:20Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ই''' এ '''ই'''গল
[[চিত্র:Flying Eagle.jpg|কেন্দ্র|300px]]
ইগলটা উড়ে যায়।
<br>
ইঁদুরেরা ভয় পায়!</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
fzs1awe5o9ykruao3nbma2tjaak24yr
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঈ
100
8965
46335
27500
2022-08-19T10:53:50Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ঈ''' এ '''ঈ'''ক্ষণ (চোখ)
[[চিত্র:2013 Shahbag protests.JPG|কেন্দ্র|300px]]
ঈক্ষণেই দেখা সব।
<br>
মানুষের কলরব!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
5jy1m3ltemj7ubt637so697vqr5zfnb
46381
46335
2022-08-19T11:03:21Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ঈ''' এ '''ঈ'''ক্ষণ (চোখ)
[[চিত্র:2013 Shahbag protests.JPG|কেন্দ্র|300px]]
ঈক্ষণেই দেখা সব।
<br>
মানুষের কলরব!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
gtg4q71qhnmsarf9x8ql961l2gh0d5u
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/উ
100
8967
46336
27501
2022-08-19T10:54:01Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''উ''' এ '''উ'''ট
[[চিত্র:07. Camel Profile, near Silverton, NSW, 07.07.2007.jpg|কেন্দ্র|300px]]
উট চলে হেলেদুলে।
<br>
উঁচু হয়ে মুখ তুলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
fy9sou2aacp7rx3btd47yyqhy336cdb
46382
46336
2022-08-19T11:03:23Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''উ''' এ '''উ'''ট
[[চিত্র:07. Camel Profile, near Silverton, NSW, 07.07.2007.jpg|কেন্দ্র|300px]]
উট চলে হেলেদুলে।
<br>
উঁচু হয়ে মুখ তুলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
bork5xfrwo7w4st9v3emndwc9h2285q
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঊ
100
8968
46337
28490
2022-08-19T10:54:10Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''উ''' এ '''ঊ'''র্ণনাভ (মাকড়সা)
[[চিত্র:Araneus diadematus web 1.jpg|কেন্দ্র|300px]]
ঊর্ণনাভ ঘুরে ঘুরে।
<br>
জাল বোনে কাছে দূরে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
8z5dalzcff6458whe054h2uxvz278xc
46383
46337
2022-08-19T11:03:25Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''উ''' এ '''ঊ'''র্ণনাভ (মাকড়সা)
[[চিত্র:Araneus diadematus web 1.jpg|কেন্দ্র|300px]]
ঊর্ণনাভ ঘুরে ঘুরে।
<br>
জাল বোনে কাছে দূরে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
56hciknpey526wapoyo9ny5y6hbaaq6
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঋ
100
8969
46338
27503
2022-08-19T10:54:19Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঋ''' এ '''ঋ'''ষি
[[চিত্র:সাধু.jpg|কেন্দ্র|300px]]
ঋষি যায় বন দিয়ে।
<br>
ফুল আর ফল নিয়ে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
8shrz2tg52hrxtgxcm06fboelad7wy2
46384
46338
2022-08-19T11:03:27Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঋ''' এ '''ঋ'''ষি
[[চিত্র:সাধু.jpg|কেন্দ্র|300px]]
ঋষি যায় বন দিয়ে।
<br>
ফুল আর ফল নিয়ে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
55teqdw14ctgqau0asvo0onbgbbxe44
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/এ
100
8970
46339
27504
2022-08-19T10:54:30Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''এ''' তে '''এ'''মু পাখি
[[চিত্র:Rhea (Rhea americana) (2).jpg|কেন্দ্র|300px]]
এমু পাখি গোটা কয়।
<br>
দেখে খুব মজা হয়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
j95rh1lg1bwf5bw8l6q84egnnnzmut1
46385
46339
2022-08-19T11:03:28Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''এ''' তে '''এ'''মু পাখি
[[চিত্র:Rhea (Rhea americana) (2).jpg|কেন্দ্র|300px]]
এমু পাখি গোটা কয়।
<br>
দেখে খুব মজা হয়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
28qmoazapt562lxz8z8ltom41gp5sg8
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঐ
100
8974
46340
27505
2022-08-19T10:54:38Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঐ''' এ '''ঐ'''রাবত
[[চিত্র:African Elephant (Loxodonta africana) bull (31100819046).jpg|কেন্দ্র|300px]]
ঐরাবত এল ওই।
<br>
তাকে দেখে ভীত হই!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
me9c4vc1mfayq0l7krbfgcnjmv1i2xk
46386
46340
2022-08-19T11:03:29Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঐ''' এ '''ঐ'''রাবত
[[চিত্র:African Elephant (Loxodonta africana) bull (31100819046).jpg|কেন্দ্র|300px]]
ঐরাবত এল ওই।
<br>
তাকে দেখে ভীত হই!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
iswme7wk6t4uu7y0w20pgh2t2f1udu0
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ও
100
8975
46341
27506
2022-08-19T10:54:47Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ও''' এ '''ও'''রাং'''ও'''টাং
[[চিত্র:Flickr - law keven - Hmmmmmm...it's NOT a nana^^...You promised me a nana..-O(.jpg|কেন্দ্র|300px]]
ওরাংওটাং লাফ দিল।
<br>
ফলটাকে লুফে নিল!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
nxitnmymvbyvtdyz123u5wa6nwepzlz
46387
46341
2022-08-19T11:03:31Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ও''' এ '''ও'''রাং'''ও'''টাং
[[চিত্র:Flickr - law keven - Hmmmmmm...it's NOT a nana^^...You promised me a nana..-O(.jpg|কেন্দ্র|300px]]
ওরাংওটাং লাফ দিল।
<br>
ফলটাকে লুফে নিল!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
5qej7j7du9oav3s8pqk6i9wux4afu8k
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঔ
100
8976
46342
36664
2022-08-19T10:54:56Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঔ''' এ '''ঔ'''দরিক (পেটুক)
[[চিত্র:DIMG 7438 (1873360447).jpg|কেন্দ্র|300px]]
ঔদরিক ভরা পেটে।
<br>
চলে আসে হেঁটে হেঁটে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
o2l9r6ga5d0kczi12nrdtip9gyw7en9
46388
46342
2022-08-19T11:03:33Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঔ''' এ '''ঔ'''দরিক (পেটুক)
[[চিত্র:DIMG 7438 (1873360447).jpg|কেন্দ্র|300px]]
ঔদরিক ভরা পেটে।
<br>
চলে আসে হেঁটে হেঁটে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
qcus2b3pwx190uvjd0f1x160h74h57a
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ক
100
8977
46343
36669
2022-08-19T10:55:04Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ক''' এ '''কোকিল'''
[[চিত্র:Asian koel.jpg|কেন্দ্র|300px]]
কোকিলের মিঠে গলা।
<br>
ডেকে ওঠে ভোরবেলা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
aaszi7hy7t1tpnxzip0n29zs1qzj3b0
46389
46343
2022-08-19T11:03:35Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ক''' এ '''কোকিল'''
[[চিত্র:Asian koel.jpg|কেন্দ্র|300px]]
কোকিলের মিঠে গলা।
<br>
ডেকে ওঠে ভোরবেলা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
gafshz1kh0kaxcurpjyrj47sm4fmt4g
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/খ
100
8978
46326
36670
2022-08-19T10:31:53Z
MdsShakil
7280
+
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''খ''' এ '''খরগোশ'''
[[চিত্র:খরগোশ ২.jpg|কেন্দ্র|300px]]
খরগোশ ছুটে যায়।
<br>
খোকাখুকু মজা পায়!
</div>
<noinclude>
{{ {{বইয়ের টেমপ্লেট}} }}
</noinclude>
21jtjddu8zakavfdd1jqsvt1kpo2vhe
46328
46326
2022-08-19T10:38:52Z
MdsShakil
7280
[[Special:Contributions/Tahmid|Tahmid]] ([[User talk:Tahmid|আলাপ]])-এর করা 27509 নং সংস্করণে ফেরত
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''খ''' এ '''খরগোশ'''
[[চিত্র:খরগোশ ২.jpg|কেন্দ্র|300px]]
খরগোশ ছুটে যায়।
<br>
খোকাখুকু মজা পায়!
</div>
{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}
oj8veik7kh0qbqm38yx0zhs8g9ktc6e
46390
46328
2022-08-19T11:03:37Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''খ''' এ '''খরগোশ'''
[[চিত্র:খরগোশ ২.jpg|কেন্দ্র|300px]]
খরগোশ ছুটে যায়।
<br>
খোকাখুকু মজা পায়!
</div>
{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}
{{বইয়ের বিষয়শ্রেণী}}
1csmzy7mr63vasewqv7kymf9hd6ls82
46432
46390
2022-08-19T11:08:10Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''খ''' এ '''খরগোশ'''
[[চিত্র:খরগোশ ২.jpg|কেন্দ্র|300px]]
খরগোশ ছুটে যায়।
<br>
খোকাখুকু মজা পায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
i9pocvhb8rmwrmw4zpyk5cpzlza2jo4
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/গ
100
8979
46344
36668
2022-08-19T10:55:19Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''গ''' এ '''গোরু'''
[[চিত্র:Black Baldy.jpg|কেন্দ্র|300px]]
গাইগোরু দুধ দেয়।
<br>
মানুষেরা খেয়ে নেয়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
4685xnuswa8as8n9du4ltcgcfylkhvy
46391
46344
2022-08-19T11:03:38Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''গ''' এ '''গোরু'''
[[চিত্র:Black Baldy.jpg|কেন্দ্র|300px]]
গাইগোরু দুধ দেয়।
<br>
মানুষেরা খেয়ে নেয়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
ieldj6p9p5tigdhhav77jxco6x9yagi
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঘ
100
8983
46345
36671
2022-08-19T10:55:27Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঘ''' এ '''ঘোড়া'''
[[File:IMG-20200516-WA0002.jpg|কেন্দ্র|300px]]
ঘোড়াটাকে বলে 'হয়'।
<br>
ঘোড়া দেখে খোঁড়া নয়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
6hsdlu6s01p7c7119thk59ivzma429h
46392
46345
2022-08-19T11:03:41Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঘ''' এ '''ঘোড়া'''
[[File:IMG-20200516-WA0002.jpg|কেন্দ্র|300px]]
ঘোড়াটাকে বলে 'হয়'।
<br>
ঘোড়া দেখে খোঁড়া নয়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
mq59b6a1pnvdz61y7clnqco7xzlmle3
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঙ
100
8984
46346
27512
2022-08-19T10:55:35Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঙ''' এ '''হাঙর'''
[[চিত্র:Carcharodon carcharias.jpg|কেন্দ্র|300px]]
হাঙরের বড়ো দাঁত।
<br>
করে যায় উৎপাত!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
bphv8xzeonbc3ajmaswcbegux955jsj
46393
46346
2022-08-19T11:03:44Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঙ''' এ '''হাঙর'''
[[চিত্র:Carcharodon carcharias.jpg|কেন্দ্র|300px]]
হাঙরের বড়ো দাঁত।
<br>
করে যায় উৎপাত!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
3lc2jjeioyxhdx9tzqihaqcgp2xqfib
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/চ
100
8985
46347
36672
2022-08-19T10:55:44Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''চ''' এ '''চড়াই'''
[[চিত্র:Passer domesticus -male outside nest.jpg|কেন্দ্র|300px]]
চড়াইরা গেল কই।
<br>
ঘুলঘুলি বাসা ওই!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
f7sj22ufptgpg0ns5tzfk3hp96un1sv
46394
46347
2022-08-19T11:03:47Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''চ''' এ '''চড়াই'''
[[চিত্র:Passer domesticus -male outside nest.jpg|কেন্দ্র|300px]]
চড়াইরা গেল কই।
<br>
ঘুলঘুলি বাসা ওই!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
ag9tj3frdt2gzvp05j5ihpwo92hkyuk
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ছ
100
8986
46348
36673
2022-08-19T10:55:55Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ছ''' এ '''ছাগল'''
[[চিত্র:Goat portrait.jpg|কেন্দ্র|300px]]
ছাগলটা ভয়ে মরে।
<br>
এই বুঝি বাঘে ধরে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
9drzxu9v1ebv9ulyuok5et3fip53j2n
46395
46348
2022-08-19T11:03:49Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ছ''' এ '''ছাগল'''
[[চিত্র:Goat portrait.jpg|কেন্দ্র|300px]]
ছাগলটা ভয়ে মরে।
<br>
এই বুঝি বাঘে ধরে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
qg52kv71c57y6yembkbb80wpu82ckzn
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/জ
100
8987
46349
36674
2022-08-19T10:56:02Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''জ''' এ '''জিরাফ'''
[[চিত্র:Young Giraffe, Uganda (30072931466).jpg|কেন্দ্র|300px]]
জিরাফের মুখ ভার।
<br>
আওয়াজ নেই তার!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
8m8igbb2cn3gt0byk5ztm82g5h0e4cx
46396
46349
2022-08-19T11:03:50Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''জ''' এ '''জিরাফ'''
[[চিত্র:Young Giraffe, Uganda (30072931466).jpg|কেন্দ্র|300px]]
জিরাফের মুখ ভার।
<br>
আওয়াজ নেই তার!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
q8qe4audawe2sfk6ssoh3peb1lmu3cb
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঝ
100
8988
46350
36675
2022-08-19T10:56:11Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঝ''' এ '''ঝিঁঝিপোকা'''
[[চিত্র:Iz - Schistocerca gregaria 1.jpg|কেন্দ্র|300px]]
ঝিঁঝিপোকা ঝাঁকে ঝাঁকে।
<br>
রাত এলে তারা ডাকে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
hbloruo7ebh9uxaejfkir2vsaahntt6
46397
46350
2022-08-19T11:03:52Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঝ''' এ '''ঝিঁঝিপোকা'''
[[চিত্র:Iz - Schistocerca gregaria 1.jpg|কেন্দ্র|300px]]
ঝিঁঝিপোকা ঝাঁকে ঝাঁকে।
<br>
রাত এলে তারা ডাকে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
kijl2a33iikem1z535zss86wjh3l8sx
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঞ
100
8989
46351
36678
2022-08-19T10:56:19Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঞ''' এ '''আঞ্জিনেয়'''
[[চিত্র:Anniella pulchra1.jpg|কেন্দ্র|300px]]
আঞ্জিনেয় এঁকে বেঁকে।
<br>
চলে আসে কোথা থেকে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
625ylgd8p4pc23drrvijrpkos77zpbi
46398
46351
2022-08-19T11:03:54Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঞ''' এ '''আঞ্জিনেয়'''
[[চিত্র:Anniella pulchra1.jpg|কেন্দ্র|300px]]
আঞ্জিনেয় এঁকে বেঁকে।
<br>
চলে আসে কোথা থেকে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
0n18cruvk58urttffqdlhohrjjj12fy
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ট
100
8990
46352
36679
2022-08-19T10:56:25Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ট''' এ '''টিয়া পাখি'''
[[চিত্র:Parrots on their little nest.jpg|কেন্দ্র|300px]]
টিয়া পাখি কথা বলে।
<br>
দল বেঁধে উড়ে চলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
sx7wd9mlikez2z1onyj9dyceez633xg
46399
46352
2022-08-19T11:03:56Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ট''' এ '''টিয়া পাখি'''
[[চিত্র:Parrots on their little nest.jpg|কেন্দ্র|300px]]
টিয়া পাখি কথা বলে।
<br>
দল বেঁধে উড়ে চলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
rlzk7yy5gmg8aws59qhwqu7l0hn63ag
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঠ
100
8991
46353
36680
2022-08-19T10:56:36Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঠ''' এ '''ঠোঁট'''
[[চিত্র:Dendrocopos leucotos 2.jpg|কেন্দ্র|300px]]
ঠোঁট দিয়ে পাখি খায়।
<br>
ঠোঁট দেখে চেনা যায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
k1id9oiayk894f6wgfce2yqad5l0ew7
46400
46353
2022-08-19T11:03:57Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঠ''' এ '''ঠোঁট'''
[[চিত্র:Dendrocopos leucotos 2.jpg|কেন্দ্র|300px]]
ঠোঁট দিয়ে পাখি খায়।
<br>
ঠোঁট দেখে চেনা যায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
sm4kfnqo1q9ef7enie7gidreqbpe7e7
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ড
100
8992
46354
27520
2022-08-19T10:56:45Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ড''' এ '''ডাহুক'''
[[চিত্র:The White Breasted Waterhen of Tripura.jpg|কেন্দ্র|300px]]
ডাহুকের দল যায়।
<br>
পোকা-মাছ খুঁটে খায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
qx8qykkihpf9n30ybpi57mo8q1y8lx9
46401
46354
2022-08-19T11:03:58Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ড''' এ '''ডাহুক'''
[[চিত্র:The White Breasted Waterhen of Tripura.jpg|কেন্দ্র|300px]]
ডাহুকের দল যায়।
<br>
পোকা-মাছ খুঁটে খায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
i33a3vp466zm0jdh1ax5r2wfmdf1xne
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঢ
100
8993
46356
27522
2022-08-19T10:57:01Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঢ''' এ '''ঢোঁড়াসাপ'''
[[চিত্র:Checkered Keelback Xenochrophis piscator Schneider, 1799 Assam by Dr Raju Kasambe DSC 0477 (1).JPG|কেন্দ্র|300px]]
কিলবিল ওরে বাপ!
<br>
ভয় নেই ঢোঁড়াসাপ!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
iv9k3kmdb3887cmr9m2lfkwe8d201t6
46402
46356
2022-08-19T11:04:00Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ঢ''' এ '''ঢোঁড়াসাপ'''
[[চিত্র:Checkered Keelback Xenochrophis piscator Schneider, 1799 Assam by Dr Raju Kasambe DSC 0477 (1).JPG|কেন্দ্র|300px]]
কিলবিল ওরে বাপ!
<br>
ভয় নেই ঢোঁড়াসাপ!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
6nyfgkyf1bwahfkjvo9xzas59z7r2d1
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ণ
100
8994
46358
27524
2022-08-19T10:57:18Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ণ''' এ '''হরিণ'''
[[চিত্র:হরিণের দল.jpg|কেন্দ্র|300px]]
হরিণের ভয় আছে।
<br>
সিংহেরা ধরে পাছে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
shebf4yvljvs0p4qkszswsyk8j0d03w
46403
46358
2022-08-19T11:04:01Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ণ''' এ '''হরিণ'''
[[চিত্র:হরিণের দল.jpg|কেন্দ্র|300px]]
হরিণের ভয় আছে।
<br>
সিংহেরা ধরে পাছে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
9harzy1req1u1wwf1epee4a3dot9g28
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ত
100
8995
46359
27525
2022-08-19T10:57:29Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ত''' এ '''তিমি'''
[[চিত্র:Anim1754 - Flickr - NOAA Photo Library.jpg|কেন্দ্র|300px]]
ইয়া বড়ো তিমিটাই।
<br>
সাগরের জলে ঠাঁই!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
ok3ubr4pbr0xnit2om4vkcki78mqq9p
46404
46359
2022-08-19T11:04:03Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ত''' এ '''তিমি'''
[[চিত্র:Anim1754 - Flickr - NOAA Photo Library.jpg|কেন্দ্র|300px]]
ইয়া বড়ো তিমিটাই।
<br>
সাগরের জলে ঠাঁই!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
dr5iiwql4hnj07lgk2bvslcwr10ot3a
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/থ
100
8996
46360
27526
2022-08-19T10:57:38Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''থ''' এ '''থাবা'''
[[চিত্র:Zambia leopard.jpg|কেন্দ্র|300px]]
থাবা দিয়ে যায় চেনা।
<br>
ওটা চিতাবাঘ কিনা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
rsrdzcff9f2dorfv7z3nih5ecyg6cm1
46405
46360
2022-08-19T11:04:04Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''থ''' এ '''থাবা'''
[[চিত্র:Zambia leopard.jpg|কেন্দ্র|300px]]
থাবা দিয়ে যায় চেনা।
<br>
ওটা চিতাবাঘ কিনা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
4db4sis0bae5qibedu6e0jzzhxp7nr3
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/দ
100
8997
46361
27527
2022-08-19T10:57:45Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''দ''' এ '''দোয়েল'''
[[চিত্র:বাংলাদেশের জাতীয় পাখি - দোয়েল.JPG|কেন্দ্র|300px]]
বাংলার জাতীয় পাখি।
<br>
দোয়েলকে চিনে রাখি!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
knwfqhr07j5i46c8wid1agzl8od01yu
46406
46361
2022-08-19T11:04:06Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''দ''' এ '''দোয়েল'''
[[চিত্র:বাংলাদেশের জাতীয় পাখি - দোয়েল.JPG|কেন্দ্র|300px]]
বাংলার জাতীয় পাখি।
<br>
দোয়েলকে চিনে রাখি!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
jtv5rro89kg8fzochrknstjf2xnl62w
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ধ
100
8998
46362
27528
2022-08-19T10:57:52Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ধ''' এ '''ধনেশ'''
[[চিত্র:Stavenn Ceratogymna bucinator 00.jpg|কেন্দ্র|300px]]
ধনেশের বড়ো ঠোঁট।
<br>
বনে তারা একজোট!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
qb3rq8q06kwff4o4ig2yf8spe1msp62
46407
46362
2022-08-19T11:04:08Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ধ''' এ '''ধনেশ'''
[[চিত্র:Stavenn Ceratogymna bucinator 00.jpg|কেন্দ্র|300px]]
ধনেশের বড়ো ঠোঁট।
<br>
বনে তারা একজোট!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
trww59ozgj1qvbljx8c1563dgs6jgzw
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ন
100
8999
46363
27529
2022-08-19T10:57:59Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ন''' এ '''নকুল'''
[[চিত্র:Herpestes edwardsii at Hyderaba.jpg|কেন্দ্র|300px]]
নকুলের কোথা বাড়ি?
<br>
সাপেদের সাথে আড়ি!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
cr3uzhz1cz6v8fr0k7110jel6un472h
46408
46363
2022-08-19T11:04:09Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ন''' এ '''নকুল'''
[[চিত্র:Herpestes edwardsii at Hyderaba.jpg|কেন্দ্র|300px]]
নকুলের কোথা বাড়ি?
<br>
সাপেদের সাথে আড়ি!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
jdetn0ir2g1g0hzb3nft0uizd7gyb85
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/প
100
9000
46364
27530
2022-08-19T10:58:12Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''প''' এ '''পাপিয়া'''
[[চিত্র:Large Hawk Cuckoo Hierococcyx sparverioides by Dr. Raju Kasambe DSC 4461 (3).jpg|কেন্দ্র|300px]]
পাপিয়ারা ডেকে যায়?
<br>
'চোখ গেল' করে হায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
sdw4drkftmhbljaemds53r86eimle11
46409
46364
2022-08-19T11:04:10Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''প''' এ '''পাপিয়া'''
[[চিত্র:Large Hawk Cuckoo Hierococcyx sparverioides by Dr. Raju Kasambe DSC 4461 (3).jpg|কেন্দ্র|300px]]
পাপিয়ারা ডেকে যায়?
<br>
'চোখ গেল' করে হায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
riljgx78y0sa5lxe4tytxeffomay8o4
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ফ
100
9001
46365
27531
2022-08-19T10:58:20Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ফ''' এ '''ফিঙে'''
[[চিত্র:Black drongo (ফিঙে).jpg|কেন্দ্র|300px]]
কুচকুচে কালো ফিঙে।
<br>
গোরু দেখে বসে শিঙে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
kcvhj1d2jwri5der89e7qs1vldctv2z
46410
46365
2022-08-19T11:04:12Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ফ''' এ '''ফিঙে'''
[[চিত্র:Black drongo (ফিঙে).jpg|কেন্দ্র|300px]]
কুচকুচে কালো ফিঙে।
<br>
গোরু দেখে বসে শিঙে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
3kle5cza9bgwvy2diidvhznzndxkiet
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ব
100
9002
46366
27532
2022-08-19T10:58:29Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ব''' এ '''বাঘ'''
[[চিত্র:Panthera tigris corbetti (Tierpark Berlin) 842-724-(118).jpg|কেন্দ্র|300px]]
জাতীয় পশুর নাম।
<br>
বাঘ এরা বনে ধাম!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
904ok37z8bjvqc0uerzwu3kdrxdf3kg
46411
46366
2022-08-19T11:04:13Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ব''' এ '''বাঘ'''
[[চিত্র:Panthera tigris corbetti (Tierpark Berlin) 842-724-(118).jpg|কেন্দ্র|300px]]
জাতীয় পশুর নাম।
<br>
বাঘ এরা বনে ধাম!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
oltd6bsmgrgmh5fqzsmnhe0m0ym3mx3
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ভ
100
9003
46367
27533
2022-08-19T10:58:38Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ভ''' এ '''ভালুক'''
[[চিত্র:Lippenbaer-24.jpg|কেন্দ্র|300px]]
ভালুকের খেলা দেখো।
<br>
চেহারাটা মনে রেখো!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
7fmev4tbkwzfwfi5mgkrl9dkpgig7kh
46412
46367
2022-08-19T11:04:15Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ভ''' এ '''ভালুক'''
[[চিত্র:Lippenbaer-24.jpg|কেন্দ্র|300px]]
ভালুকের খেলা দেখো।
<br>
চেহারাটা মনে রেখো!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
aj3di5ad2s1mb73jll1m0pbsfgt83tt
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ম
100
9004
46368
27534
2022-08-19T10:58:45Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ম''' এ '''ময়ূর'''
[[চিত্র:ময়ূরের নাচ.jpg|কেন্দ্র|300px]]
ভারতের জাতীয় পাখি।
<br>
ময়ূরকে বলে 'শিখী'!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
4l3gmqxv5wpurgbva27wym59yktlqnd
46413
46368
2022-08-19T11:04:16Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ম''' এ '''ময়ূর'''
[[চিত্র:ময়ূরের নাচ.jpg|কেন্দ্র|300px]]
ভারতের জাতীয় পাখি।
<br>
ময়ূরকে বলে 'শিখী'!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
e05vft0bnq4fffpltkwqqv7gz2d4r5v
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/য
100
9005
46369
27535
2022-08-19T10:58:53Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''য''' এ '''যমজ'''
[[চিত্র:TwinGirls.jpg|কেন্দ্র|300px]]
খেলা দেখে হাসাহাসি।
<br>
যমজেরা পাশাপাশি!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
0138wl0w1xgrd7gtabvkprxmnplyl7k
46414
46369
2022-08-19T11:04:18Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''য''' এ '''যমজ'''
[[চিত্র:TwinGirls.jpg|কেন্দ্র|300px]]
খেলা দেখে হাসাহাসি।
<br>
যমজেরা পাশাপাশি!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
qlpgxsw1tmxeo5eopcl176rmm1p15m1
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/র
100
9007
46371
27537
2022-08-19T10:59:09Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''র''' এ '''রাজহাঁস'''
[[চিত্র:Swan with nine cygnets 3.jpg|কেন্দ্র|300px]]
রাজহাঁস জলে চলে।
<br>
সারি বেঁধে দলে দলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
bdmgm2w44b04y8bk5oaieo0jdgvmreq
46415
46371
2022-08-19T11:04:19Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''র''' এ '''রাজহাঁস'''
[[চিত্র:Swan with nine cygnets 3.jpg|কেন্দ্র|300px]]
রাজহাঁস জলে চলে।
<br>
সারি বেঁধে দলে দলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
lwhem2mrbe0j348phytqv620kku0ol7
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ল
100
9008
46372
27538
2022-08-19T10:59:17Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ল''' এ '''লেমুর'''
[[চিত্র:Lemur catta 01.jpg|300px]]
<br>
লেমুরের বনে ডেরা।
<br>
দল বেঁধে থাকে এরা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
9rjp3ftet8qe9f3saae0dhp77ytqrw8
46416
46372
2022-08-19T11:04:21Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ল''' এ '''লেমুর'''
[[চিত্র:Lemur catta 01.jpg|300px]]
<br>
লেমুরের বনে ডেরা।
<br>
দল বেঁধে থাকে এরা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
fallf3sjmbhjvdqixgeyr760abb9uan
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/শ
100
9009
46373
27539
2022-08-19T10:59:23Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''শ''' এ '''শেয়াল'''
[[চিত্র:Flickr - Rainbirder - Golden Jackal (1).jpg|কেন্দ্র|300px]]
রাত এলে থেকে থেকে।
<br>
শেয়ালেরা ওঠে ডেকে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
gyg1u6on5bpflv9sq0kk9nc3iswms8e
46417
46373
2022-08-19T11:04:23Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''শ''' এ '''শেয়াল'''
[[চিত্র:Flickr - Rainbirder - Golden Jackal (1).jpg|কেন্দ্র|300px]]
রাত এলে থেকে থেকে।
<br>
শেয়ালেরা ওঠে ডেকে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
2oifmjgvahtjpyf3il9wafy4lhnzx2d
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ষ
100
9010
46374
27540
2022-08-19T10:59:30Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ষ''' এ '''ষাঁড়'''
[[চিত্র:কামারখোলা ব্রীজে ষাঁড় - panoramio.jpg|কেন্দ্র|300px]]
ষাঁড় আসে বাজারেতে।
<br>
শাকপাতা রোজ খেতে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
78ly3iu8908lrz3gdiz91lqobo5o5lf
46418
46374
2022-08-19T11:04:24Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''ষ''' এ '''ষাঁড়'''
[[চিত্র:কামারখোলা ব্রীজে ষাঁড় - panoramio.jpg|কেন্দ্র|300px]]
ষাঁড় আসে বাজারেতে।
<br>
শাকপাতা রোজ খেতে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
iblnlk9h0r5q1hy489ieych0koqee6b
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/স
100
9011
46375
27541
2022-08-19T10:59:38Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''স''' এ '''সারস'''
[[চিত্র:Yellow-billed Stork Mycteria ibis in Tanzania 4648 cropped Nevit.jpg|কেন্দ্র|300px]]
সারসের দল যায়।
<br>
নীল আকাশের গায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
4l6vb65d3927kd2nr1d9yw69vz7kg4y
46419
46375
2022-08-19T11:04:26Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''স''' এ '''সারস'''
[[চিত্র:Yellow-billed Stork Mycteria ibis in Tanzania 4648 cropped Nevit.jpg|কেন্দ্র|300px]]
সারসের দল যায়।
<br>
নীল আকাশের গায়!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
hycwjvc2754r26snv6mlynu75ncavsr
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/হ
100
9012
46376
27542
2022-08-19T10:59:50Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''হ''' এ '''হনুমান'''
[[চিত্র:Capped langur (9).jpg|কেন্দ্র|300px]]
করে নাও অনুমান।
<br>
এটা হল হনুমান!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
kuynsixks9bw07cbqf3av91ie73udck
46420
46376
2022-08-19T11:04:27Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center;color: blue; font-size: 300%;">'''হ''' এ '''হনুমান'''
[[চিত্র:Capped langur (9).jpg|কেন্দ্র|300px]]
করে নাও অনুমান।
<br>
এটা হল হনুমান!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
p84af9e1yudfmb9i2evhd1ae0jjt5ek
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ড়
100
9013
46355
34824
2022-08-19T10:56:52Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ড়''' এ '''সড়ক'''
[[চিত্র:Road side view at chalna, Khulna - 33.jpg|300px]]
<br>
সড়কের পথ ধরে।
<br>
মানুষেরা ঘরে ফেরে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
2t0tbqika5r75m2munsiom0p1uvg9x7
46421
46355
2022-08-19T11:04:28Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ড়''' এ '''সড়ক'''
[[চিত্র:Road side view at chalna, Khulna - 33.jpg|300px]]
<br>
সড়কের পথ ধরে।
<br>
মানুষেরা ঘরে ফেরে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
68pn2nzd9ep6eg8lk6ddwvb19oqyhn8
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঢ়
100
9014
46357
27523
2022-08-19T10:57:09Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ঢ়''' এ '''আষাঢ়'''
[[চিত্র:Agriculture in Bangladesh (02).jpg|300px]]
<br>
আষাঢ়ের মেঘ এলে।
<br>
চাষিদের হাসি খেলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
fxbbq7b1ep70z50xqhg5uvu1bmdkbox
46422
46357
2022-08-19T11:04:30Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ঢ়''' এ '''আষাঢ়'''
[[চিত্র:Agriculture in Bangladesh (02).jpg|300px]]
<br>
আষাঢ়ের মেঘ এলে।
<br>
চাষিদের হাসি খেলে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
lg73bzo0e14841tpkwr0kwv6geqcysj
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/য়
100
9015
46370
34825
2022-08-19T10:59:02Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''য়''' এ '''হায়না'''
[[চিত্র:Striped hyenas fighting.JPG|300px]]
<br>
হায়নার দল আসে।
<br>
শিকারের অভিলাষে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
qmfkvpjx7auu3m52urv5o5kbelxo9s0
46423
46370
2022-08-19T11:04:32Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''য়''' এ '''হায়না'''
[[চিত্র:Striped hyenas fighting.JPG|300px]]
<br>
হায়নার দল আসে।
<br>
শিকারের অভিলাষে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
fhmh9kccuxjbmlrivmf408bg5ogi1c4
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ৎ
100
9016
46377
27543
2022-08-19T10:59:59Z
MdsShakil
7280
সংশোধন
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ৎ''' এ '''উৎসব'''
[[চিত্র:ঈদের নামাজের পর কোলাকুলি.jpg|300px]]
<br>
খুশি আসে উৎসবে।
<br>
ইদ এলে মিলি সবে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
prtusxb1vkg0syyk0b4oyuwdob86i0l
46424
46377
2022-08-19T11:04:33Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''ৎ''' এ '''উৎসব'''
[[চিত্র:ঈদের নামাজের পর কোলাকুলি.jpg|300px]]
<br>
খুশি আসে উৎসবে।
<br>
ইদ এলে মিলি সবে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
gbdw49vdpx8j0gzedp5lfl3ez9otgy8
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ং
100
9017
46330
36665
2022-08-19T10:44:33Z
MdsShakil
7280
+টেমপ্লেট
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''<bdi>ং</bdi>'''-এ '''রং'''
[[চিত্র:Sit and Draw Competition.JPG|300px]]
<br>
খোকাখুকু এই বেলা।
<br>
রং নিয়ে করে খেলা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
ei1znufx1ob8a91njsrlrmvaoopryal
46425
46330
2022-08-19T11:04:35Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''<bdi>ং</bdi>'''-এ '''রং'''
[[চিত্র:Sit and Draw Competition.JPG|300px]]
<br>
খোকাখুকু এই বেলা।
<br>
রং নিয়ে করে খেলা!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
iyw6lyd91ap94t9i1bbmnwwygwixtld
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঃ
100
9018
46331
36666
2022-08-19T10:44:45Z
MdsShakil
7280
+টেমপ্লেট
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''<bdi>ঃ</bdi>'''-এ '''দুঃখ'''
[[চিত্র:09538jfTayuman Street Santa Cruz Tondo Manilafvf 02.jpg|300px]]
<br>
সুখ দুঃখ কত কাছে।
<br>
মানুষের সাথে আছে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
7xdqfof0i2dex2lv46h34x3ecrwn9ot
46426
46331
2022-08-19T11:04:36Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''<bdi>ঃ</bdi>'''-এ '''দুঃখ'''
[[চিত্র:09538jfTayuman Street Santa Cruz Tondo Manilafvf 02.jpg|300px]]
<br>
সুখ দুঃখ কত কাছে।
<br>
মানুষের সাথে আছে!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
978wn5q3phs98bxs3a2yfrr3arbgl1q
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঁ
100
9019
46329
36667
2022-08-19T10:44:18Z
MdsShakil
7280
+টেমপ্লেট
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''<bdi>ঁ</bdi>'''-তে '''প্যাঁচা'''
[[চিত্র:The Owlet.jpg|300px]]
<br>
প্যাঁচা হল নিশাচর।
<br>
কোটরেতে বাঁধে ঘর!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
9s08wn9k2ky9sn08jeo1szxkz5ta6lf
46427
46329
2022-08-19T11:04:38Z
MdsShakil
7280
+{{বইয়ের বিষয়শ্রেণী}}
wikitext
text/x-wiki
<div style="text-align: center; color: blue; font-size: 300%;">'''<bdi>ঁ</bdi>'''-তে '''প্যাঁচা'''
[[চিত্র:The Owlet.jpg|300px]]
<br>
প্যাঁচা হল নিশাচর।
<br>
কোটরেতে বাঁধে ঘর!
</div>
<noinclude>{{উইকিশৈশব বর্ণমালায় প্রাণীজগৎ}}</noinclude>
{{বইয়ের বিষয়শ্রেণী}}
9kqnk9so8d90jj9nrvahi0xoo8w2t0p
বাংলা বারো মাসের নাম
0
10611
46323
45862
2022-08-19T01:33:14Z
144.48.84.32
wikitext
text/x-wiki
{| class="wikitable" style="margin:0.5em; text-align:center; width:100%"
|- bgcolor=#eeeeee
! width=33% | বাংলা মাস
! width=33% | ইংরেজি মাস
! width=33% | কাল/ঋতু
|-
| বৈশাখ
| এপ্রিল-মে
|rowspan="2"| গ্রীষ্মকাল
|-
| জ্যৈষ্ঠ
| মে-জুন
|-
| আষাঢ়
| জুন-জুলাই
|rowspan="2"| বর্ষাকাল
|-
| শ্রাবণ
| জুলাই-আগস্ট
|-
| ভাদ্র
| আগস্ট-সেপ্টেম্বর
|rowspan="2"| শরৎকাল
|-
| আশ্বিন
| সেপ্টেম্বর Madarcoad
|-
| কার্তিক
| অক্টোবর-নভেম্বর
|rowspan="2"| হেমন্তকাল
|-
| অগ্রহায়ণ
| নভেম্বর-ডিসেম্বর
|-
| পৌষ
| ডিসেম্বর-জানুয়ারি
|rowspan="2"| শীতকাল
|-
| মাঘ
| জানুয়ারি-ফেব্রুয়ারি
|-
| ফাল্গুন
| ফেব্রুয়ারি-মার্চ
|rowspan="2"| বসন্তকাল
|-
| চৈত্র
| মার্চ-এপ্রিল
|}
{{বইয়ের_বিষয়শ্রেণী}}
{{বর্ণানুক্রমিক|ব}}
{{বইয়ের বিষয়শ্রেণী}}
{{বিষয়|শিক্ষা}}
6ty52r0by59bst86w29fu2ssleoe82y
46325
46323
2022-08-19T10:02:03Z
MdsShakil
7280
[[Special:Contributions/144.48.84.32|144.48.84.32]] ([[User talk:144.48.84.32|আলাপ]])-এর সম্পাদিত সংস্করণ হতে [[User:2401:4900:3BF2:62E6:D29F:8FE3:E2B9:8F13|2401:4900:3BF2:62E6:D29F:8FE3:E2B9:8F13]]-এর সম্পাদিত সর্বশেষ সংস্করণে ফেরত যাওয়া হয়েছে
wikitext
text/x-wiki
{| class="wikitable" style="margin:0.5em; text-align:center; width:100%"
|- bgcolor=#eeeeee
! width=33% | বাংলা মাস
! width=33% | ইংরেজি মাস
! width=33% | কাল/ঋতু
|-
| বৈশাখ
| এপ্রিল-মে
|rowspan="2"| গ্রীষ্মকাল
|-
| জ্যৈষ্ঠ
| মে-জুন
|-
| আষাঢ়
| জুন-জুলাই
|rowspan="2"| বর্ষাকাল
|-
| শ্রাবণ
| জুলাই-আগস্ট
|-
| ভাদ্র
| আগস্ট-সেপ্টেম্বর
|rowspan="2"| শরৎকাল
|-
| আশ্বিন
| সেপ্টেম্বর-অক্টোবর
|-
| কার্তিক
| অক্টোবর-নভেম্বর
|rowspan="2"| হেমন্তকাল
|-
| অগ্রহায়ণ
| নভেম্বর-ডিসেম্বর
|-
| পৌষ
| ডিসেম্বর-জানুয়ারি
|rowspan="2"| শীতকাল
|-
| মাঘ
| জানুয়ারি-ফেব্রুয়ারি
|-
| ফাল্গুন
| ফেব্রুয়ারি-মার্চ
|rowspan="2"| বসন্তকাল
|-
| চৈত্র
| মার্চ-এপ্রিল
|}
{{বইয়ের_বিষয়শ্রেণী}}
{{বর্ণানুক্রমিক|ব}}
{{বইয়ের বিষয়শ্রেণী}}
{{বিষয়|শিক্ষা}}
izwngdovae5tadir4wkzvoo7o1zcxn2
উইকিবইয়ের ব্যবহার/কীভাবে উইকিবই সম্পাদনা করবেন
0
15588
46319
46316
2022-08-18T16:09:38Z
Salil Kumar Mukherjee
7573
সম্প্রসারণ
wikitext
text/x-wiki
{{কাজ চলছে}}
<noinclude>
{{Using Wikibooks/Page}}
</noinclude>
== উইকিটেক্সট সম্পাদনা==
উইকিটেক্সট সম্পাদনা সম্পর্কে আমাদের একটি সম্পূর্ণ বই রয়েছে যা সমস্ত মূল বিষয়কে নিয়ে, শুধুমাত্র যেগুলি উইকিবুকগুলিতে ব্যবহৃত হয় তা নয়। বিদ্যমান পৃষ্ঠাগুলি কীভাবে সম্পাদনা করা যায় এবং সুন্দর সুন্দর নতুন পৃষ্ঠাগুলি কীভাবে তৈরি করা যায় সে সম্পর্কে আরও তথ্যের জন্য '''[[উইকিটেক্সট সম্পাদনা]]''' দেখুন।
(দ্রুত অবলোকনের জন্য এই বইয়ের শেষে উইকি-মার্কআপ বিভাগটি দেখুন)।
'''আপনার কেন সম্পাদনা করা উচিত...'''
লোকেরা বিভিন্ন কারণে উইকিবইয়ে সম্পাদনা করার সিদ্ধান্ত নেয়, কেন তা নেয় সেটা বোঝার চেষ্টা করা যেতেই পারে।
কিছু পাঠক, উইকিবই পড়ার সময়, ব্যাকরণের ত্রুটি খুঁজে পান। এই ত্রুটি তাদেরকে বিরক্ত করে। ত্রুটি দেখার পর অন্য কারোর জন্য অপেক্ষা না করে তারা এটা ঠিক করতে চায়।
''' পৃষ্ঠাটি নিজে সম্পাদনা করা নিঃসন্দেহে দ্রুত এবং সহজ কাজ।'''
কিছু লোক সত্যিই তাদের জানা জিনিস অন্যদের সাথে ভাগ করতে চায় এবং বিনামূল্যে অন্য শিক্ষার্থীদের শেখাতে চায়। এতে ওয়েবে পাঠ্যপুস্তক কেনার দরকার পড়ে না।
কিছু লোক একঘেয়েমি কাটাতে সম্পাদনা করেন এবং একটি গঠনমূলক শখ চান।
আবার কিছু ব্যক্তি সম্পাদনা করে এইজন্য যে তাদের শিক্ষক তাদের মূল্যায়ন করছেন!
এমনকি এমন ব্যক্তিরাও আছেন যাদের কাজ হল তাদের কোম্পানির জন্য উইকি তৈরি করা। তারা উইকিকে আরও গুরুত্বপূর্ণভাবে দেখেন এবং এর মাধ্যমে তারা সহজেই ত্রুটিগুলি খুঁজে পান। ত্রুটিগুলি সংশোধন করতে আগ্রহ বোধ করেন।
লোকেরা কেন সম্পাদনা করেন তার অনেক কারণ রয়েছে। তবে কারণগুলি শেষ পর্যন্ত তত গুরুত্বপূর্ণ মনে হয় না। যেটি গুরুত্বপূর্ণ সেটিটি হল আপনি উইকিবই প্রকল্পে অংশগ্রহণ করছেন এবং আপনি উইকিবই সম্প্রদায়ে যোগদানের জন্য প্রথম পদক্ষেপ নিয়েছেন।
== কীভাবে সম্পাদনা করবেন ==
প্রায় সমস্ত পৃষ্ঠার উপরে একটি লিঙ্ক থাকে যেখানে লেখা থাকে "এই পৃষ্ঠাটি সম্পাদনা করুন"। সেই লিঙ্কে ক্লিক করুন। এটি আপনাকে একটি পৃষ্ঠায় নিয়ে যাবে যেখানে আপনি পৃষ্ঠাটির পাঠ্যংশ সম্পাদনা এবং সংরক্ষণ করতে পারবেন। আমরা বলি "প্রায় সব" কারণ কিছু পৃষ্ঠা বিভিন্ন কারণে সম্পাদনা করা যায় না। সেই পাতাগুলিকে আমরা সুরক্ষিত পাতা বলি। যদি একটি পৃষ্ঠা সুরক্ষিত থাকে তবে "এই পৃষ্ঠাটি সম্পাদনা করুন" লিঙ্কটি একটি "উৎস দেখুন" লিঙ্ক দিয়ে প্রতিস্থাপিত হবে। আপনি পাঠ্যংশের উৎস কোডটি কীভাবে লেখা হয়েছে তা দেখতে পারেন। তবে সুরক্ষিত পৃষ্ঠাগুলিতে কোনও পরিবর্তন আপনি সংরক্ষণ করতে পারবেন না।
আপনি যখন একটি পৃষ্ঠা সম্পাদনা করেন, তখন একটি টেক্সট বাক্স প্রদর্শিত হবে যেখানে ইতিমধ্যেই লোড করা পৃষ্ঠাটির বর্তমান পাঠ্যংশটি রয়েছে। আপনি পৃষ্ঠায় কিছু পরিবর্তন বা যোগ করতে পারেন এবং আপনার কাজ শেষ হয়ে গেলে আপনি এটি সংরক্ষণও করতে পারেন।
<code>প্রাকদর্শন</code> বোতামে ক্লিক করলে উপরের দিকে নতুন পৃষ্ঠার একটি পূর্বরূপ দেখাবে এবং নীচে আপনাকে সম্পাদনা উইন্ডো প্রদান করবে। মনে রাখবেন প্রাকদর্শন করলে কোনো পরিবর্তন সংরক্ষিত হবে না।
<code>পরিবর্তন প্রকাশ করুন</code>বোতামে ক্লিক করলে আপনার পরিবর্তনগুলি সংরক্ষিত হবে, এবং যে কেউ এটি পড়বেন তাদের জন্য সেগুলি পৃষ্ঠায় প্রদর্শিত হবে।
আপনি যদি একটি ছোট সম্পাদনা করে থাকেন, তাহলে "এটি একটি অনুল্লেখ্য সম্পাদনা" বলে চেক বক্সে ক্লিক করুন। এটি একটি ছোট সম্পাদনা হিসাবে সম্পাদনাটিকে রেকর্ড করবে। উদ্দেশ্য্ হলো অন্য সম্পাদকদের এটি খুঁটিয়ে না দেখলেও চলবে।
=== সম্পাদনা সারাংশ ===
"সারাংশ" নামক টেক্সট বক্সটি আপনি কী করেছেন এবং কেন করেছেন সেটি ব্যাখ্যা করার একটি সুযোগ আপনাকে দেয়। সারাংশ লেখা বাধ্যতামূলক নয় তবে সারাংশ লেখার অভ্যাস ভাল অনুশীলন হিসাবে বিবেচিত হয়। আপনি যদি একটি ছোট সম্পাদনা করেন, যেমন একটি বানান সংশোধন বা ব্যাকরণ সম্পাদনা, আপনি কেবল "বানান" বা "ব্যাকরণ" লিখতে পারেন। এইটুকু লিখলেই যথেষ্ট। যদি আপনি একটি বড় বা আরও উল্লেখযোগ্য সম্পাদনা করেন, সংক্ষেপে লিখতে চেষ্টা করুন, আপনি কী করেছেন এবং কেন। এটি অন্য সম্পাদকদের কাজ করতে সাহায্য করবে যখন তারা আপনার কাজটিতে কোনো ত্রুটি আছে কীনা সেটি পরীক্ষা করবেন।
অন্যান্য পাঠক এবং সম্পাদকরা যখন পৃষ্ঠার ইতিহাসটি দেখবেন, তখন তারা শুধুমাত্র আপনার সম্পাদনার সারাংশটি দেখতে পাবেন৷ এর মানে হল যে একজন ব্যক্তি যদি দেখতে চান একটি পৃষ্ঠা কীভাবে পরিবর্তিত হয়েছে, তবে তাকে হয় সম্পাদনা সারাংশ পড়তে হবে (অবশ্য যদি সম্পাদনা সারাংশ লেখা হয়ে থাকে), অন্যথায় পৃষ্ঠার পরিবর্তন দেখার জন্য তাকে পৃষ্ঠার প্রতিটি লাইন পড়তে হবে।
এছাড়াও, একটি সম্পাদনা সারাংশ থেকে বোঝা যায় যে একজন ব্যক্তি গঠনমূলক সম্পাদনা করছেন কিনা অথবা তিনি কেবলমাত্র একজন নতুন ব্যবহারকারী যিনি নীতিমালা সম্পর্কে কিছুটা বিভ্রান্ত হয়ে থাকতে পারেন। একটি উদাহরণ দিয়ে বলা যেতে পারে। যেমন কেউ সম্পাদনা সারাংশে লিখলেন "আমি কিছু ঠিক করার চেষ্টা করেছি, কিন্তু আমি জানি না আমি এটি ঠিক করেছি কিনা"। অথবা কেউ লিখলেন "আমার সাহায্য দরকার!" এগুলি সম্ভবত ইঙ্গিত দেয় যে আপনি গঠনমূলক সম্পাদনা করতে আগ্রহী। আপনি ধ্বংসাত্মমূলক সম্পাদনা করছেন না। এক্ষেত্রে সাম্প্রতিক পরিবর্তনের তালিকা দেখছেন এমন ব্যবহারকারীদের কাছ থেকে আপনি সহায়তাও পেতে পারেন।
=== সম্পাদনা অনুসরণ ===
আপনি উইকিবইয়ে সম্পাদনা অনুসরণ করতে পারেন। এর বিভিন্ন উপায় আছে। আপনি আপনার নিজের সম্পাদনা, একটি নির্দিষ্ট পৃষ্ঠার সম্পাদনা এবং সমগ্র সম্প্রদায়ের দ্বারা করা সম্পাদনাগুলির অনুসরণ করতে পারেন। আমরা এখন সেসব বিষয় নিয়ে আলোচনা করব।
=== সাম্প্রতিক পরিবর্তন ===
সমস্ত পৃষ্ঠায় সমস্ত উইকিবইয়ের সম্পাদকদের দ্বারা করা সমস্ত পরিবর্তন [[বিশেষ:সাম্প্রতিক পরিবর্তন|সাম্প্রতিক পরিবর্তন]] এই শিরোনামে তালিকাভুক্ত করা হয়েছে। আপনি স্ক্রিনের বাম দিকে "নেভিগেশন" বাক্সে "সাম্প্রতিক পরিবর্তন" লিঙ্কে ক্লিক করে এই তালিকায় যেতে পারেন। এখানে, আপনি তালিকার শীর্ষে সাম্প্রতিক পরিবর্তনের সাথে বিপরীত কালানুক্রমিক ক্রমে করা পরিবর্তনগুলি দেখতে পাবেন। প্রতিটি পরিবর্তনে সম্পাদিত পৃষ্ঠার শিরোনাম, ব্যবহারকারীর নাম (অথবা ব্যক্তির আইপি ঠিকানা, যদি তারা লগ ইন না করে থাকে), এবং অন্যান্য বিভিন্ন তথ্য থাকবে। অন্যান্য কিছু তথ্য যা অন্তর্ভুক্ত হতে পারে সেগুলি হলো:
;অ অথবা ন:অ এটি একটি অনুল্লেখিত সম্পাদনা; ন এই সম্পাদনায় একটি নতুন পাতা তৈরি হয়েছে।
;(±১২৩): পাতার আকারে এই পরিমাণ বাইট পরিবর্তিত হয়েছে। সংখ্যাটি ছোট হলে, এটি সম্ভবত একটি ছোট সম্পাদনা ছিল। সংখ্যাটি বড় হলে, এটি একটি বড় পরিবর্তন ছিল।
;সম্পাদনা সারাংশ: যদি ব্যক্তিটি পৃষ্ঠা সংরক্ষণ করার আগে সম্পাদনা সারাংশ লিখে থাকেন তবে সম্পাদনা সারাংশটি লেখা থাকে। কখনও কখনও, যদি ব্যক্তিটি সম্পাদনা সারাংশ না লিখে থাকেন সেক্ষেত্রে একটি স্বয়ংক্রিয় সফ্টওয়্যার দ্বারা এটি তৈরি করা হয়ে থাকে।
=== আমার নজরতালিকা ===
আপনার যদি একটি অ্যাকাউন্ট থাকে এবং আপনি যদি লগ ইন করেন তবে আপনি চাইলে ব্যক্তিগত নজরতালিকাটি দেখতে পারেন৷ আপনার নজরতালিকা হল সেই পৃষ্ঠাগুলির একটি তালিকা যা আপনি নজর রাখতে চান বা অনুসরণ করতে চান৷ আপনি যখন পৃষ্ঠার শীর্ষে "আমার নজরতালিকা" লিঙ্কে ক্লিক করে বা বিশেষ:নজরতালিকায় গিয়ে, আপনার নজরতালিকাটি দেখেন তখন আপনি আপনার নজরতালিকার পৃষ্ঠাগুলিতে সাম্প্রতিক পরিবর্তনগুলির একটি তালিকা দেখতে পাবেন৷
hptk4f0tw3983x2s68njvmfg2una23l
46320
46319
2022-08-18T16:13:23Z
Salil Kumar Mukherjee
7573
সম্প্রসারণ
wikitext
text/x-wiki
{{কাজ চলছে}}
<noinclude>
{{Using Wikibooks/Page}}
</noinclude>
== উইকিটেক্সট সম্পাদনা==
উইকিটেক্সট সম্পাদনা সম্পর্কে আমাদের একটি সম্পূর্ণ বই রয়েছে যা সমস্ত মূল বিষয়কে নিয়ে, শুধুমাত্র যেগুলি উইকিবুকগুলিতে ব্যবহৃত হয় তা নয়। বিদ্যমান পৃষ্ঠাগুলি কীভাবে সম্পাদনা করা যায় এবং সুন্দর সুন্দর নতুন পৃষ্ঠাগুলি কীভাবে তৈরি করা যায় সে সম্পর্কে আরও তথ্যের জন্য '''[[উইকিটেক্সট সম্পাদনা]]''' দেখুন।
(দ্রুত অবলোকনের জন্য এই বইয়ের শেষে উইকি-মার্কআপ বিভাগটি দেখুন)।
'''আপনার কেন সম্পাদনা করা উচিত...'''
লোকেরা বিভিন্ন কারণে উইকিবইয়ে সম্পাদনা করার সিদ্ধান্ত নেয়, কেন তা নেয় সেটা বোঝার চেষ্টা করা যেতেই পারে।
কিছু পাঠক, উইকিবই পড়ার সময়, ব্যাকরণের ত্রুটি খুঁজে পান। এই ত্রুটি তাদেরকে বিরক্ত করে। ত্রুটি দেখার পর অন্য কারোর জন্য অপেক্ষা না করে তারা এটা ঠিক করতে চায়।
''' পৃষ্ঠাটি নিজে সম্পাদনা করা নিঃসন্দেহে দ্রুত এবং সহজ কাজ।'''
কিছু লোক সত্যিই তাদের জানা জিনিস অন্যদের সাথে ভাগ করতে চায় এবং বিনামূল্যে অন্য শিক্ষার্থীদের শেখাতে চায়। এতে ওয়েবে পাঠ্যপুস্তক কেনার দরকার পড়ে না।
কিছু লোক একঘেয়েমি কাটাতে সম্পাদনা করেন এবং একটি গঠনমূলক শখ চান।
আবার কিছু ব্যক্তি সম্পাদনা করে এইজন্য যে তাদের শিক্ষক তাদের মূল্যায়ন করছেন!
এমনকি এমন ব্যক্তিরাও আছেন যাদের কাজ হল তাদের কোম্পানির জন্য উইকি তৈরি করা। তারা উইকিকে আরও গুরুত্বপূর্ণভাবে দেখেন এবং এর মাধ্যমে তারা সহজেই ত্রুটিগুলি খুঁজে পান। ত্রুটিগুলি সংশোধন করতে আগ্রহ বোধ করেন।
লোকেরা কেন সম্পাদনা করেন তার অনেক কারণ রয়েছে। তবে কারণগুলি শেষ পর্যন্ত তত গুরুত্বপূর্ণ মনে হয় না। যেটি গুরুত্বপূর্ণ সেটিটি হল আপনি উইকিবই প্রকল্পে অংশগ্রহণ করছেন এবং আপনি উইকিবই সম্প্রদায়ে যোগদানের জন্য প্রথম পদক্ষেপ নিয়েছেন।
== কীভাবে সম্পাদনা করবেন ==
প্রায় সমস্ত পৃষ্ঠার উপরে একটি লিঙ্ক থাকে যেখানে লেখা থাকে "এই পৃষ্ঠাটি সম্পাদনা করুন"। সেই লিঙ্কে ক্লিক করুন। এটি আপনাকে একটি পৃষ্ঠায় নিয়ে যাবে যেখানে আপনি পৃষ্ঠাটির পাঠ্যংশ সম্পাদনা এবং সংরক্ষণ করতে পারবেন। আমরা বলি "প্রায় সব" কারণ কিছু পৃষ্ঠা বিভিন্ন কারণে সম্পাদনা করা যায় না। সেই পাতাগুলিকে আমরা সুরক্ষিত পাতা বলি। যদি একটি পৃষ্ঠা সুরক্ষিত থাকে তবে "এই পৃষ্ঠাটি সম্পাদনা করুন" লিঙ্কটি একটি "উৎস দেখুন" লিঙ্ক দিয়ে প্রতিস্থাপিত হবে। আপনি পাঠ্যংশের উৎস কোডটি কীভাবে লেখা হয়েছে তা দেখতে পারেন। তবে সুরক্ষিত পৃষ্ঠাগুলিতে কোনও পরিবর্তন আপনি সংরক্ষণ করতে পারবেন না।
আপনি যখন একটি পৃষ্ঠা সম্পাদনা করেন, তখন একটি টেক্সট বাক্স প্রদর্শিত হবে যেখানে ইতিমধ্যেই লোড করা পৃষ্ঠাটির বর্তমান পাঠ্যংশটি রয়েছে। আপনি পৃষ্ঠায় কিছু পরিবর্তন বা যোগ করতে পারেন এবং আপনার কাজ শেষ হয়ে গেলে আপনি এটি সংরক্ষণও করতে পারেন।
<code>প্রাকদর্শন</code> বোতামে ক্লিক করলে উপরের দিকে নতুন পৃষ্ঠার একটি পূর্বরূপ দেখাবে এবং নীচে আপনাকে সম্পাদনা উইন্ডো প্রদান করবে। মনে রাখবেন প্রাকদর্শন করলে কোনো পরিবর্তন সংরক্ষিত হবে না।
<code>পরিবর্তন প্রকাশ করুন</code>বোতামে ক্লিক করলে আপনার পরিবর্তনগুলি সংরক্ষিত হবে, এবং যে কেউ এটি পড়বেন তাদের জন্য সেগুলি পৃষ্ঠায় প্রদর্শিত হবে।
আপনি যদি একটি ছোট সম্পাদনা করে থাকেন, তাহলে "এটি একটি অনুল্লেখ্য সম্পাদনা" বলে চেক বক্সে ক্লিক করুন। এটি একটি ছোট সম্পাদনা হিসাবে সম্পাদনাটিকে রেকর্ড করবে। উদ্দেশ্য্ হলো অন্য সম্পাদকদের এটি খুঁটিয়ে না দেখলেও চলবে।
=== সম্পাদনা সারাংশ ===
"সারাংশ" নামক টেক্সট বক্সটি আপনি কী করেছেন এবং কেন করেছেন সেটি ব্যাখ্যা করার একটি সুযোগ আপনাকে দেয়। সারাংশ লেখা বাধ্যতামূলক নয় তবে সারাংশ লেখার অভ্যাস ভাল অনুশীলন হিসাবে বিবেচিত হয়। আপনি যদি একটি ছোট সম্পাদনা করেন, যেমন একটি বানান সংশোধন বা ব্যাকরণ সম্পাদনা, আপনি কেবল "বানান" বা "ব্যাকরণ" লিখতে পারেন। এইটুকু লিখলেই যথেষ্ট। যদি আপনি একটি বড় বা আরও উল্লেখযোগ্য সম্পাদনা করেন, সংক্ষেপে লিখতে চেষ্টা করুন, আপনি কী করেছেন এবং কেন। এটি অন্য সম্পাদকদের কাজ করতে সাহায্য করবে যখন তারা আপনার কাজটিতে কোনো ত্রুটি আছে কীনা সেটি পরীক্ষা করবেন।
অন্যান্য পাঠক এবং সম্পাদকরা যখন পৃষ্ঠার ইতিহাসটি দেখবেন, তখন তারা শুধুমাত্র আপনার সম্পাদনার সারাংশটি দেখতে পাবেন৷ এর মানে হল যে একজন ব্যক্তি যদি দেখতে চান একটি পৃষ্ঠা কীভাবে পরিবর্তিত হয়েছে, তবে তাকে হয় সম্পাদনা সারাংশ পড়তে হবে (অবশ্য যদি সম্পাদনা সারাংশ লেখা হয়ে থাকে), অন্যথায় পৃষ্ঠার পরিবর্তন দেখার জন্য তাকে পৃষ্ঠার প্রতিটি লাইন পড়তে হবে।
এছাড়াও, একটি সম্পাদনা সারাংশ থেকে বোঝা যায় যে একজন ব্যক্তি গঠনমূলক সম্পাদনা করছেন কিনা অথবা তিনি কেবলমাত্র একজন নতুন ব্যবহারকারী যিনি নীতিমালা সম্পর্কে কিছুটা বিভ্রান্ত হয়ে থাকতে পারেন। একটি উদাহরণ দিয়ে বলা যেতে পারে। যেমন কেউ সম্পাদনা সারাংশে লিখলেন "আমি কিছু ঠিক করার চেষ্টা করেছি, কিন্তু আমি জানি না আমি এটি ঠিক করেছি কিনা"। অথবা কেউ লিখলেন "আমার সাহায্য দরকার!" এগুলি সম্ভবত ইঙ্গিত দেয় যে আপনি গঠনমূলক সম্পাদনা করতে আগ্রহী। আপনি ধ্বংসাত্মমূলক সম্পাদনা করছেন না। এক্ষেত্রে সাম্প্রতিক পরিবর্তনের তালিকা দেখছেন এমন ব্যবহারকারীদের কাছ থেকে আপনি সহায়তাও পেতে পারেন।
=== সম্পাদনা অনুসরণ ===
আপনি উইকিবইয়ে সম্পাদনা অনুসরণ করতে পারেন। এর বিভিন্ন উপায় আছে। আপনি আপনার নিজের সম্পাদনা, একটি নির্দিষ্ট পৃষ্ঠার সম্পাদনা এবং সমগ্র সম্প্রদায়ের দ্বারা করা সম্পাদনাগুলির অনুসরণ করতে পারেন। আমরা এখন সেসব বিষয় নিয়ে আলোচনা করব।
=== সাম্প্রতিক পরিবর্তন ===
সমস্ত পৃষ্ঠায় সমস্ত উইকিবইয়ের সম্পাদকদের দ্বারা করা সমস্ত পরিবর্তন [[বিশেষ:সাম্প্রতিক পরিবর্তন|সাম্প্রতিক পরিবর্তন]] এই শিরোনামে তালিকাভুক্ত করা হয়েছে। আপনি স্ক্রিনের বাম দিকে "নেভিগেশন" বাক্সে "সাম্প্রতিক পরিবর্তন" লিঙ্কে ক্লিক করে এই তালিকায় যেতে পারেন। এখানে, আপনি তালিকার শীর্ষে সাম্প্রতিক পরিবর্তনের সাথে বিপরীত কালানুক্রমিক ক্রমে করা পরিবর্তনগুলি দেখতে পাবেন। প্রতিটি পরিবর্তনে সম্পাদিত পৃষ্ঠার শিরোনাম, ব্যবহারকারীর নাম (অথবা ব্যক্তির আইপি ঠিকানা, যদি তারা লগ ইন না করে থাকে), এবং অন্যান্য বিভিন্ন তথ্য থাকবে। অন্যান্য কিছু তথ্য যা অন্তর্ভুক্ত হতে পারে সেগুলি হলো:
;অ অথবা ন:অ এটি একটি অনুল্লেখিত সম্পাদনা; ন এই সম্পাদনায় একটি নতুন পাতা তৈরি হয়েছে।
;(±১২৩): পাতার আকারে এই পরিমাণ বাইট পরিবর্তিত হয়েছে। সংখ্যাটি ছোট হলে, এটি সম্ভবত একটি ছোট সম্পাদনা ছিল। সংখ্যাটি বড় হলে, এটি একটি বড় পরিবর্তন ছিল।
;সম্পাদনা সারাংশ: যদি ব্যক্তিটি পৃষ্ঠা সংরক্ষণ করার আগে সম্পাদনা সারাংশ লিখে থাকেন তবে সম্পাদনা সারাংশটি লেখা থাকে। কখনও কখনও, যদি ব্যক্তিটি সম্পাদনা সারাংশ না লিখে থাকেন সেক্ষেত্রে একটি স্বয়ংক্রিয় সফ্টওয়্যার দ্বারা এটি তৈরি করা হয়ে থাকে।
=== আমার নজরতালিকা ===
আপনার যদি একটি অ্যাকাউন্ট থাকে এবং আপনি যদি লগ ইন করেন তবে আপনি চাইলে ব্যক্তিগত নজরতালিকাটি দেখতে পারেন৷ আপনার নজরতালিকা হল সেই পৃষ্ঠাগুলির একটি তালিকা যা আপনি নজর রাখতে চান বা অনুসরণ করতে চান। আপনি যখন পৃষ্ঠার শীর্ষে "আমার নজরতালিকা" লিঙ্কে ক্লিক করে বা বিশেষ:নজরতালিকায় গিয়ে, আপনার নজরতালিকাটি দেখেন তখন আপনি আপনার নজরতালিকার পৃষ্ঠাগুলিতে সাম্প্রতিক পরিবর্তনগুলির একটি তালিকা দেখতে পাবেন৷ সাম্প্রতিক পরিবর্তন তালিকার সম্পাদনাগুলি যেভাবে প্রদর্শিত হয় এই পরিবর্তনগুলিও একইভাবে প্রদর্শিত হবে।
5hrfrwt4gd7dh503g4p414p9oq4degq
46321
46320
2022-08-18T16:16:52Z
Salil Kumar Mukherjee
7573
সংযোজন
wikitext
text/x-wiki
{{কাজ চলছে}}
<noinclude>
{{Using Wikibooks/Page}}
</noinclude>
== উইকিটেক্সট সম্পাদনা==
উইকিটেক্সট সম্পাদনা সম্পর্কে আমাদের একটি সম্পূর্ণ বই রয়েছে যা সমস্ত মূল বিষয়কে নিয়ে, শুধুমাত্র যেগুলি উইকিবুকগুলিতে ব্যবহৃত হয় তা নয়। বিদ্যমান পৃষ্ঠাগুলি কীভাবে সম্পাদনা করা যায় এবং সুন্দর সুন্দর নতুন পৃষ্ঠাগুলি কীভাবে তৈরি করা যায় সে সম্পর্কে আরও তথ্যের জন্য '''[[উইকিটেক্সট সম্পাদনা]]''' দেখুন।
(দ্রুত অবলোকনের জন্য এই বইয়ের শেষে উইকি-মার্কআপ বিভাগটি দেখুন)।
'''আপনার কেন সম্পাদনা করা উচিত...'''
লোকেরা বিভিন্ন কারণে উইকিবইয়ে সম্পাদনা করার সিদ্ধান্ত নেয়, কেন তা নেয় সেটা বোঝার চেষ্টা করা যেতেই পারে।
কিছু পাঠক, উইকিবই পড়ার সময়, ব্যাকরণের ত্রুটি খুঁজে পান। এই ত্রুটি তাদেরকে বিরক্ত করে। ত্রুটি দেখার পর অন্য কারোর জন্য অপেক্ষা না করে তারা এটা ঠিক করতে চায়।
''' পৃষ্ঠাটি নিজে সম্পাদনা করা নিঃসন্দেহে দ্রুত এবং সহজ কাজ।'''
কিছু লোক সত্যিই তাদের জানা জিনিস অন্যদের সাথে ভাগ করতে চায় এবং বিনামূল্যে অন্য শিক্ষার্থীদের শেখাতে চায়। এতে ওয়েবে পাঠ্যপুস্তক কেনার দরকার পড়ে না।
কিছু লোক একঘেয়েমি কাটাতে সম্পাদনা করেন এবং একটি গঠনমূলক শখ চান।
আবার কিছু ব্যক্তি সম্পাদনা করে এইজন্য যে তাদের শিক্ষক তাদের মূল্যায়ন করছেন!
এমনকি এমন ব্যক্তিরাও আছেন যাদের কাজ হল তাদের কোম্পানির জন্য উইকি তৈরি করা। তারা উইকিকে আরও গুরুত্বপূর্ণভাবে দেখেন এবং এর মাধ্যমে তারা সহজেই ত্রুটিগুলি খুঁজে পান। ত্রুটিগুলি সংশোধন করতে আগ্রহ বোধ করেন।
লোকেরা কেন সম্পাদনা করেন তার অনেক কারণ রয়েছে। তবে কারণগুলি শেষ পর্যন্ত তত গুরুত্বপূর্ণ মনে হয় না। যেটি গুরুত্বপূর্ণ সেটিটি হল আপনি উইকিবই প্রকল্পে অংশগ্রহণ করছেন এবং আপনি উইকিবই সম্প্রদায়ে যোগদানের জন্য প্রথম পদক্ষেপ নিয়েছেন।
== কীভাবে সম্পাদনা করবেন ==
প্রায় সমস্ত পৃষ্ঠার উপরে একটি লিঙ্ক থাকে যেখানে লেখা থাকে "এই পৃষ্ঠাটি সম্পাদনা করুন"। সেই লিঙ্কে ক্লিক করুন। এটি আপনাকে একটি পৃষ্ঠায় নিয়ে যাবে যেখানে আপনি পৃষ্ঠাটির পাঠ্যংশ সম্পাদনা এবং সংরক্ষণ করতে পারবেন। আমরা বলি "প্রায় সব" কারণ কিছু পৃষ্ঠা বিভিন্ন কারণে সম্পাদনা করা যায় না। সেই পাতাগুলিকে আমরা সুরক্ষিত পাতা বলি। যদি একটি পৃষ্ঠা সুরক্ষিত থাকে তবে "এই পৃষ্ঠাটি সম্পাদনা করুন" লিঙ্কটি একটি "উৎস দেখুন" লিঙ্ক দিয়ে প্রতিস্থাপিত হবে। আপনি পাঠ্যংশের উৎস কোডটি কীভাবে লেখা হয়েছে তা দেখতে পারেন। তবে সুরক্ষিত পৃষ্ঠাগুলিতে কোনও পরিবর্তন আপনি সংরক্ষণ করতে পারবেন না।
আপনি যখন একটি পৃষ্ঠা সম্পাদনা করেন, তখন একটি টেক্সট বাক্স প্রদর্শিত হবে যেখানে ইতিমধ্যেই লোড করা পৃষ্ঠাটির বর্তমান পাঠ্যংশটি রয়েছে। আপনি পৃষ্ঠায় কিছু পরিবর্তন বা যোগ করতে পারেন এবং আপনার কাজ শেষ হয়ে গেলে আপনি এটি সংরক্ষণও করতে পারেন।
<code>প্রাকদর্শন</code> বোতামে ক্লিক করলে উপরের দিকে নতুন পৃষ্ঠার একটি পূর্বরূপ দেখাবে এবং নীচে আপনাকে সম্পাদনা উইন্ডো প্রদান করবে। মনে রাখবেন প্রাকদর্শন করলে কোনো পরিবর্তন সংরক্ষিত হবে না।
<code>পরিবর্তন প্রকাশ করুন</code>বোতামে ক্লিক করলে আপনার পরিবর্তনগুলি সংরক্ষিত হবে, এবং যে কেউ এটি পড়বেন তাদের জন্য সেগুলি পৃষ্ঠায় প্রদর্শিত হবে।
আপনি যদি একটি ছোট সম্পাদনা করে থাকেন, তাহলে "এটি একটি অনুল্লেখ্য সম্পাদনা" বলে চেক বক্সে ক্লিক করুন। এটি একটি ছোট সম্পাদনা হিসাবে সম্পাদনাটিকে রেকর্ড করবে। উদ্দেশ্য্ হলো অন্য সম্পাদকদের এটি খুঁটিয়ে না দেখলেও চলবে।
=== সম্পাদনা সারাংশ ===
"সারাংশ" নামক টেক্সট বক্সটি আপনি কী করেছেন এবং কেন করেছেন সেটি ব্যাখ্যা করার একটি সুযোগ আপনাকে দেয়। সারাংশ লেখা বাধ্যতামূলক নয় তবে সারাংশ লেখার অভ্যাস ভাল অনুশীলন হিসাবে বিবেচিত হয়। আপনি যদি একটি ছোট সম্পাদনা করেন, যেমন একটি বানান সংশোধন বা ব্যাকরণ সম্পাদনা, আপনি কেবল "বানান" বা "ব্যাকরণ" লিখতে পারেন। এইটুকু লিখলেই যথেষ্ট। যদি আপনি একটি বড় বা আরও উল্লেখযোগ্য সম্পাদনা করেন, সংক্ষেপে লিখতে চেষ্টা করুন, আপনি কী করেছেন এবং কেন। এটি অন্য সম্পাদকদের কাজ করতে সাহায্য করবে যখন তারা আপনার কাজটিতে কোনো ত্রুটি আছে কীনা সেটি পরীক্ষা করবেন।
অন্যান্য পাঠক এবং সম্পাদকরা যখন পৃষ্ঠার ইতিহাসটি দেখবেন, তখন তারা শুধুমাত্র আপনার সম্পাদনার সারাংশটি দেখতে পাবেন৷ এর মানে হল যে একজন ব্যক্তি যদি দেখতে চান একটি পৃষ্ঠা কীভাবে পরিবর্তিত হয়েছে, তবে তাকে হয় সম্পাদনা সারাংশ পড়তে হবে (অবশ্য যদি সম্পাদনা সারাংশ লেখা হয়ে থাকে), অন্যথায় পৃষ্ঠার পরিবর্তন দেখার জন্য তাকে পৃষ্ঠার প্রতিটি লাইন পড়তে হবে।
এছাড়াও, একটি সম্পাদনা সারাংশ থেকে বোঝা যায় যে একজন ব্যক্তি গঠনমূলক সম্পাদনা করছেন কিনা অথবা তিনি কেবলমাত্র একজন নতুন ব্যবহারকারী যিনি নীতিমালা সম্পর্কে কিছুটা বিভ্রান্ত হয়ে থাকতে পারেন। একটি উদাহরণ দিয়ে বলা যেতে পারে। যেমন কেউ সম্পাদনা সারাংশে লিখলেন "আমি কিছু ঠিক করার চেষ্টা করেছি, কিন্তু আমি জানি না আমি এটি ঠিক করেছি কিনা"। অথবা কেউ লিখলেন "আমার সাহায্য দরকার!" এগুলি সম্ভবত ইঙ্গিত দেয় যে আপনি গঠনমূলক সম্পাদনা করতে আগ্রহী। আপনি ধ্বংসাত্মমূলক সম্পাদনা করছেন না। এক্ষেত্রে সাম্প্রতিক পরিবর্তনের তালিকা দেখছেন এমন ব্যবহারকারীদের কাছ থেকে আপনি সহায়তাও পেতে পারেন।
=== সম্পাদনা অনুসরণ ===
আপনি উইকিবইয়ে সম্পাদনা অনুসরণ করতে পারেন। এর বিভিন্ন উপায় আছে। আপনি আপনার নিজের সম্পাদনা, একটি নির্দিষ্ট পৃষ্ঠার সম্পাদনা এবং সমগ্র সম্প্রদায়ের দ্বারা করা সম্পাদনাগুলির অনুসরণ করতে পারেন। আমরা এখন সেসব বিষয় নিয়ে আলোচনা করব।
=== সাম্প্রতিক পরিবর্তন ===
সমস্ত পৃষ্ঠায় সমস্ত উইকিবইয়ের সম্পাদকদের দ্বারা করা সমস্ত পরিবর্তন [[বিশেষ:সাম্প্রতিক পরিবর্তন|সাম্প্রতিক পরিবর্তন]] এই শিরোনামে তালিকাভুক্ত করা হয়েছে। আপনি স্ক্রিনের বাম দিকে "নেভিগেশন" বাক্সে "সাম্প্রতিক পরিবর্তন" লিঙ্কে ক্লিক করে এই তালিকায় যেতে পারেন। এখানে, আপনি তালিকার শীর্ষে সাম্প্রতিক পরিবর্তনের সাথে বিপরীত কালানুক্রমিক ক্রমে করা পরিবর্তনগুলি দেখতে পাবেন। প্রতিটি পরিবর্তনে সম্পাদিত পৃষ্ঠার শিরোনাম, ব্যবহারকারীর নাম (অথবা ব্যক্তির আইপি ঠিকানা, যদি তারা লগ ইন না করে থাকে), এবং অন্যান্য বিভিন্ন তথ্য থাকবে। অন্যান্য কিছু তথ্য যা অন্তর্ভুক্ত হতে পারে সেগুলি হলো:
;অ অথবা ন:অ এটি একটি অনুল্লেখিত সম্পাদনা; ন এই সম্পাদনায় একটি নতুন পাতা তৈরি হয়েছে।
;(±১২৩): পাতার আকারে এই পরিমাণ বাইট পরিবর্তিত হয়েছে। সংখ্যাটি ছোট হলে, এটি সম্ভবত একটি ছোট সম্পাদনা ছিল। সংখ্যাটি বড় হলে, এটি একটি বড় পরিবর্তন ছিল।
;সম্পাদনা সারাংশ: যদি ব্যক্তিটি পৃষ্ঠা সংরক্ষণ করার আগে সম্পাদনা সারাংশ লিখে থাকেন তবে সম্পাদনা সারাংশটি লেখা থাকে। কখনও কখনও, যদি ব্যক্তিটি সম্পাদনা সারাংশ না লিখে থাকেন সেক্ষেত্রে একটি স্বয়ংক্রিয় সফ্টওয়্যার দ্বারা এটি তৈরি করা হয়ে থাকে।
=== আমার নজরতালিকা ===
আপনার যদি একটি অ্যাকাউন্ট থাকে এবং আপনি যদি লগ ইন করেন তবে আপনি চাইলে ব্যক্তিগত নজরতালিকাটি দেখতে পারেন৷ আপনার নজরতালিকা হল সেই পৃষ্ঠাগুলির একটি তালিকা যা আপনি নজর রাখতে চান বা অনুসরণ করতে চান। আপনি যখন পৃষ্ঠার শীর্ষে "আমার নজরতালিকা" লিঙ্কে ক্লিক করে বা [[বিশেষ:নজরতালিকা]]য় গিয়ে, আপনার নজরতালিকাটি দেখেন তখন আপনি আপনার নজরতালিকার পৃষ্ঠাগুলিতে সাম্প্রতিক পরিবর্তনগুলির একটি তালিকা দেখতে পাবেন৷ সাম্প্রতিক পরিবর্তন তালিকার সম্পাদনাগুলি যেভাবে প্রদর্শিত হয় এই পরিবর্তনগুলিও একইভাবে প্রদর্শিত হবে।
8rbk4j93863skn2no4emedmtpvvqpfu
ব্যবহারকারী আলাপ:Saurmandal
3
15829
46318
2022-08-18T15:40:15Z
KanikBot
8129
স্বাগতম!
wikitext
text/x-wiki
== বাংলা উইকিবইয়ে স্বাগত ==
{{স্বাগত/২য় সংস্করণ}} ১৫:৪০, ১৮ আগস্ট ২০২২ (ইউটিসি)
6k11ikr7g694smond23b7p96wgxgm2u
ব্যবহারকারী আলাপ:Prince Muntasir
3
15830
46322
2022-08-18T21:40:15Z
KanikBot
8129
স্বাগতম!
wikitext
text/x-wiki
== বাংলা উইকিবইয়ে স্বাগত ==
{{স্বাগত/২য় সংস্করণ}} ২১:৪০, ১৮ আগস্ট ২০২২ (ইউটিসি)
6u8rr480w0hzoz37tdollxgcjvw3qy6
ব্যবহারকারী আলাপ:AL Mamun Masudi
3
15831
46324
2022-08-19T06:40:15Z
KanikBot
8129
স্বাগতম!
wikitext
text/x-wiki
== বাংলা উইকিবইয়ে স্বাগত ==
{{স্বাগত/২য় সংস্করণ}} ০৬:৪০, ১৯ আগস্ট ২০২২ (ইউটিসি)
oaacupuezs2rrscnelslxecckyn2col
বিষয়শ্রেণী:বই:উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ
14
15833
46428
2022-08-19T11:05:05Z
MdsShakil
7280
খালি পাতা তৈরি হয়েছে
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
46429
46428
2022-08-19T11:05:30Z
MdsShakil
7280
wikitext
text/x-wiki
{{মূল|উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ}}
ofujq1dnighq69vkrl25nmp3lks6fes
46430
46429
2022-08-19T11:05:53Z
MdsShakil
7280
হটক্যাটের মাধ্যমে [[বিষয়শ্রেণী:বই বিষয়শ্রেণীসমূহ]] যোগ
wikitext
text/x-wiki
{{মূল|উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ}}
[[বিষয়শ্রেণী:বই বিষয়শ্রেণীসমূহ]]
nh06047ozbcplgu09m1rw1j47uoxtn1
উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/সকল পাতা
100
15834
46434
2022-08-19T11:16:03Z
MdsShakil
7280
পাতা তৈরি
wikitext
text/x-wiki
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/অ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/আ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ই}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঈ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/উ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঊ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঋ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/এ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঐ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ও}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঔ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ক}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/খ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/গ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঘ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঙ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/চ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ছ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/জ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঝ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঞ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ট}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঠ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ড}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ড়}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঢ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঢ়}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ণ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ত}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/থ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/দ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ধ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ন}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/প}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ফ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ব}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ভ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ম}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/য}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/য়}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/র}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ল}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/শ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ষ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/স}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/হ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ৎ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঁ}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ং}}
--------
{{উইকিশৈশব:বর্ণমালায় প্রাণীজগৎ/ঃ}}
m2kxgnzgva77mma6x7o9wnhspuo0yvv
উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/সকল পাতা
100
15835
46438
2022-08-19T11:22:55Z
MdsShakil
7280
+
wikitext
text/x-wiki
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/A}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/B}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/C}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/D}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/E}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/F}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/G}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/H}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/I}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/J}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/K}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/L}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/M}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/N}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/O}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/P}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/Q}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/R}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/S}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/T}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/U}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/V}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/W}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/X}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/Y}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/Z}}
b2x87xt1bl8hd2ov8rdxhpraxxarueo
46439
46438
2022-08-19T11:30:14Z
MdsShakil
7280
wikitext
text/x-wiki
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/A}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/B}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/C}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/D}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/E}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/F}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/G}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/H}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/I}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/J}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/K}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/L}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/M}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/N}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/O}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/P}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/Q}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/R}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/S}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/T}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/U}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/V}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/W}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/X}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/Y}}
--------
{{উইকিশৈশব:ইংরেজি বর্ণমালায় প্রাণিজগৎ/Z}}
scw3op715u25qk3mzqzkz447q2ef9c1
টেমপ্লেট:মুদ্রণ সংস্করণ/খেলাঘর
10
15836
46442
2022-08-19T11:39:54Z
MdsShakil
7280
+
wikitext
text/x-wiki
<includeonly>{{#invoke:Printable version|displays_book|{{{1|{{#ifexist:{{BASEPAGENAME}}/TOC|{{BASEPAGENAME}}/TOC|{{BASEPAGENAME}}}}}}}|{{{2|}}}|4={{{3|}}}}}</includeonly><noinclude>{{documentation}}</noinclude>
h2uw5ptxrmmlkmocbvzmsyh1clf0s7q
46443
46442
2022-08-19T11:40:26Z
MdsShakil
7280
wikitext
text/x-wiki
{{#invoke:Printable version|displays_book|{{{1|{{#ifexist:{{BASEPAGENAME}}/TOC|{{BASEPAGENAME}}/TOC|{{BASEPAGENAME}}}}}}}|{{{2|}}}|4={{{3|}}}}}<noinclude>{{documentation}}</noinclude>
ods1jnqygqqxpspx8gg4f5lle0felmz
মডিউল:Printable version
828
15837
46444
2014-02-03T14:59:47Z
JackPotte
2496
Created page with "local p = {} -- Search and display the book pages from the summary page, in order to create a printable version. function p.affiche_livre(frame) local param = frame.args..."
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the summary page, in order to create a printable version.
function p.affiche_livre(frame)
local param = frame.args[1]
if (param ~= nil and mw.text.trim(param) ~= '') then
title = mw.title.new(param)
else
return 'No TOC found'
end
text = title.getContent(title)
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" then
chapter = mw.text.trim(mw.ustring.gsub(v, "[ \*\#\[]*([^\|]*).*", "%1"))
if mw.title.new( chapter ).exists then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
begining = frame:expandTemplate{title = "Print version notice"}
--ending = frame:expandTemplate{title = ""}
local list = begining .. table.concat(lignes, "\r\n") --.. ending
return list
end
return p
36c819x2llkoegemeqncsqlqk8ci4gw
46445
46444
2015-11-09T23:18:31Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the summary page, in order to create a printable version.
function p.affiche_livre(frame)
local param = frame.args[1]
if (param ~= nil and mw.text.trim(param) ~= '') then
title = mw.title.new(param)
else
return 'No TOC found'
end
text = title.getContent(title)
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":" then
-- Extract the pages titles
if mw.ustring.find(v, "|") == nil then
chapter = mw.ustring.gsub(v, "[ :\*\#\[<small>]*([^%[%]]*).*", "%1")
else
chapter = mw.ustring.gsub(v, "[ :\*\#\[<small>]*([^\|]*).*", "%1")
end
--chapter = title.getContent(title)
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil) then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
begining = frame:expandTemplate{title = "Print version notice"}
local liste = begining .. table.concat(lignes, "\r\n")
return liste
end
return p
24e0afwsglmbl259mu25dy2nzzxk7zb
46446
46445
2016-01-10T13:08:49Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the summary page, in order to create a printable version.
function p.displays_book(frame)
local param = frame.args[1]
if (param ~= nil and mw.text.trim(param) ~= '') then
title = mw.title.new(param)
else
return 'No TOC found'
end
text = title.getContent(title)
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":" then
-- Extract the pages titles
if mw.ustring.find(v, "|") == nil then
chapter = mw.ustring.gsub(v, "[ :\*\#\[<small>]*([^%[%]]*).*", "%1")
else
chapter = mw.ustring.gsub(v, "[ :\*\#\[<small>]*([^\|]*).*", "%1")
end
--chapter = title.getContent(title)
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil) then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
begining = frame:expandTemplate{title = "Print version notice"}
local liste = begining .. table.concat(lignes, "\r\n")
return liste
end
return p
oxzub8b7yp72mjke77uazfk2ic4aqo6
46447
46446
2016-01-18T00:23:52Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the summary page, in order to create a printable version.
function p.displays_book(frame)
local param = frame.args[1]
if (param ~= nil and mw.text.trim(param) ~= '') then
title = mw.title.new(param)
else
return 'No TOC found'
end
text = title.getContent(title)
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":" then
-- Extract the pages titles
if mw.ustring.find(v, "|") == nil then
chapter = mw.ustring.gsub(v, "[ :\*\#\[<small>]*([^%[%]]*).*", "%1")
else
chapter = mw.ustring.gsub(v, "[ :\*\#\[<small>]*([^\|]*).*", "%1")
end
--chapter = title.getContent(title)
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
begining = frame:expandTemplate{title = "Print version notice"}
local liste = begining .. table.concat(lignes, "\r\n")
return liste
end
return p
8vj3armxemw1kti3w7j0obqo7qqw397
46448
46447
2016-06-02T01:00:15Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
cxegiwv3p0aydfmwapz9o6edd9aykee
46449
46448
2016-06-02T15:14:22Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
fqqkqku5ivnz8q0h5n4lics2j9o46gj
46450
46449
2016-06-02T15:18:23Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", titre)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
8zpuopn5yp6ynx7gjgohto76cpuh2g8
46451
46450
2016-06-02T15:19:25Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", titre)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and mw.ustring.find(v, "#") == nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
me81bframlxkvbev5yajgk2346mg26n
46452
46451
2016-06-02T15:22:08Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", titre)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
eygtt2h8ysxt9n3j23ho2md84pmqd36
46453
46452
2016-06-02T15:27:56Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", titre)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
qjcp6b7iaj18l8sho4mlvvnwnuvpt3m
46454
46453
2016-06-02T16:05:22Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", titre)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
omlvbaoi4f1gwixa6m2gglfj1du2p5w
46455
46454
2016-06-06T22:44:52Z
JackPotte
2496
Scribunto
text/plain
local p = {}
-- Search and display the book pages from the TOC page, in order to create a printable version.
function p.displays_book(frame)
local titre = frame.args[1]
if (titre ~= nil and mw.text.trim(titre) ~= '') then
title = mw.title.new(titre)
else
return 'Error: no TOC parameter'
end
if (title == nil or title == '') then return 'Error: no TOC title' end
text = title.getContent(title)
if (text == nil or text == '') then return 'Error: missing TOC page' end
-- Normalization of the subpages names
if mw.ustring.find(titre, "/") ~= nil then titre = mw.ustring.gsub(titre, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. titre .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", titre)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local lignes = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Extract the pages titles from the summary lines
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, "User:") == nil and mw.ustring.find(chapter, "talk:") == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
chapitre = mw.title.new(chapter)
if (chapitre ~= nil and chapitre.exists) then
titre = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (titre ~= nil and titre ~= '') then
table.insert(lignes, frame:expandTemplate{title = "Page-break"} .. '\n=' .. titre .. '=\n')
end
table.insert(lignes, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
debut = frame:expandTemplate{title = "Print version notice"}
fin = ""
local liste = debut .. table.concat(lignes, "\r\n") .. fin
return liste
end
return p
kw13ajxqk3f9brf26r8rnv2e1jtnwcx
46456
46455
2016-06-09T21:34:51Z
JackPotte
2496
i18n
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Exclusion = "User:"
Beginning1 = "Print version notice"
Beginning2 = ""
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil then
fin = "]"
else
fin = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..fin.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, Exclusion) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
BookName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (BookName ~= nil and BookName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. BookName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
mrlo2e6ntgilfdhfvg2dh84mfbcciib
46457
46456
2016-06-09T22:34:40Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Exclusion = "User:"
Beginning1 = "Print version notice"
Beginning2 = ""
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, Exclusion) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
BookName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (BookName ~= nil and BookName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. BookName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
06wg2j0p4k925731z9953sudzbod4bu
46458
46457
2016-06-10T00:56:41Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Exclusion = "User:"
Beginning1 = "Print version notice"
Beginning2 = ""
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil or mw.ustring.find(v, "|") > mw.ustring.find(v, "%]") then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, Exclusion) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
BookName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (BookName ~= nil and BookName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. BookName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
20xef9skc9oj5npmwprut3mxx8l6wkq
46459
46458
2016-06-11T22:59:49Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
User = "User:"
Wikibooks = "Wikibooks:"
Help = "Help:"
Beginning1 = "Print version notice"
Beginning2 = ""
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil or mw.ustring.find(v, "|") > mw.ustring.find(v, "%]") then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, User) == nil and mw.ustring.find(chapter, Wikibooks) == nil and mw.ustring.find(chapter, Help) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
BookName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (BookName ~= nil and BookName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. BookName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
8hyas22ep7fr3rkqxi5sbkv1wxc7ho3
46460
46459
2016-06-12T16:09:01Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
User = "User:"
Wikibooks = "Wikibooks:"
Help = "Help:"
Beginning1 = "Print version notice"
Beginning2 = ""
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil or mw.ustring.find(v, "|") > mw.ustring.find(v, "%]") then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, User) == nil and mw.ustring.find(chapter, Wikibooks) == nil and mw.ustring.find(chapter, Help) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
l66p42fuw8dgj3mltc1g9r52y19uu4o
46461
46460
2016-06-12T21:26:31Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
User = "User:"
Wikibooks = "Wikibooks:"
Help = "Help:"
Beginning1 = "Print version notice"
Beginning2 = ""
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":" or string.sub(v, 1, 1) == "=") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil or mw.ustring.find(v, "|") > mw.ustring.find(v, "%]") then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, User) == nil and mw.ustring.find(chapter, Wikibooks) == nil and mw.ustring.find(chapter, Help) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
57hvthyxzlw3f3mwl5hqsbckuu3q21y
46462
46461
2016-06-12T21:53:27Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
User = "User:"
Wikibooks = "Wikibooks:"
Help = "Help:"
Beginning1 = "Print version notice"
Beginning2 = ""
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":" or string.sub(v, 1, 1) == "=") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil or (mw.ustring.find(v, "%]") ~= nil and mw.ustring.find(v, "|") > mw.ustring.find(v, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, User) == nil and mw.ustring.find(chapter, Wikibooks) == nil and mw.ustring.find(chapter, Help) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
5lpuj1auxhvl9v51w39bgpb1w4v49rk
46463
46462
2016-08-07T14:38:36Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
User = "User:"
Wikibooks = "Wikibooks:"
Help = "Help:"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
local p = {}
function p.displays_book(frame)
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization
if mw.ustring.find(BookName, "/") ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)/(.*)", "%1") end
text = mw.ustring.gsub(text, "%[%[%.%./", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "%[%[/", "[[" .. BookName .. "/")
text = mw.ustring.gsub(text, "{{BOOKNAME}}", BookName)
text = mw.ustring.gsub(text, "%/%]%]", "]]")
local lines_ = mw.text.split(text, "\n")
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.ustring.find(v, "%[%[") ~= nil and (string.sub(v, 1, 1) == "*" or string.sub(v, 1, 1) == "#" or string.sub(v, 1, 1) == ":" or string.sub(v, 1, 1) == "=") then
-- Pages titles extraction from the TOC
if mw.ustring.find(v, "|") == nil or (mw.ustring.find(v, "%]") ~= nil and mw.ustring.find(v, "|") > mw.ustring.find(v, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(v, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1")
if (chapter ~= nil) then
if (chapter ~= '' and mw.ustring.find(chapter, "{") == nil and mw.ustring.find(chapter, "#") == nil and mw.ustring.find(chapter, User) == nil and mw.ustring.find(chapter, Wikibooks) == nil and mw.ustring.find(chapter, Help) == nil) then
chapter = mw.ustring.gsub(chapter, "_", " ")
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^/]*/*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
return p
chpdaanzatusg2h8drdbiztw06aj9x6
46464
46463
2016-08-21T15:00:10Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "Print version"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*: ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "|") > mw.ustring.find(chapter, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = book name or another subpage name</font>' else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.text.truncate(chapter, string.len(BookName .. sep)) ~= (BookName .. sep .. "…") and mw.text.truncate(chapter, string.len(BookName .. sep)) ~= (BookName .. sep .. "...") then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. mw.text.truncate(chapter, string.len(BookName .. sep)) .. " ~= " .. BookName .. sep .. "…" else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
c5cm06d538i1t7sb6g8nfde8vkqy4x4
46465
46464
2016-08-21T15:03:41Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
table.insert(PrintVersion, frame:expandTemplate{title = Break} .. '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*: ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "|") > mw.ustring.find(chapter, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = book name or another subpage name</font>' else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.text.truncate(chapter, string.len(BookName .. sep)) ~= (BookName .. sep .. "…") and mw.text.truncate(chapter, string.len(BookName .. sep)) ~= (BookName .. sep .. "...") then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. mw.text.truncate(chapter, string.len(BookName .. sep)) .. " ~= " .. BookName .. sep .. "…" else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
0xkw25vaq6evlbdukv5g11by744rvul
46466
46465
2016-08-21T21:56:03Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*: ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "|") > mw.ustring.find(chapter, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = book name or another subpage name</font>' else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.text.truncate(chapter, string.len(BookName .. sep)) ~= (BookName .. sep .. "…") and mw.text.truncate(chapter, string.len(BookName .. sep)) ~= (BookName .. sep .. "...") then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. mw.text.truncate(chapter, string.len(BookName .. sep)) .. " ~= " .. BookName .. sep .. "…" else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
s1habx481bjfp26k5u6tgsr12zd8wh6
46467
46466
2016-08-26T19:37:14Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*: ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "|") > mw.ustring.find(chapter, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = book name or another subpage name</font>' else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
ma0tpvnua0mpk5qaqld7eywkxmfn2wm
46468
46467
2016-09-20T06:52:24Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "|") > mw.ustring.find(chapter, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = book name or another subpage name</font>' else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
5dxi3chb0aztmm324vvv2ls6uu9cn7e
46469
46468
2016-10-14T18:19:54Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#*%**:*; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "|") > mw.ustring.find(chapter, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = book name or another subpage name</font>' else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
9lpbw2uen5jaw5xvx4e5ktn7aqku92f
46470
46469
2016-10-14T18:53:00Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "|") > mw.ustring.find(chapter, "%]")) then
Ending = "]"
else
Ending = "|"
end
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[([^%"..Ending.."]*).*", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = book name or another subpage name</font>' else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
5dxi3chb0aztmm324vvv2ls6uu9cn7e
46471
46470
2016-10-15T00:13:44Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
5e8iht96rajd4y9wqtanxpabw3bxx2s
46472
46471
2016-10-15T14:26:47Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Escape for find in regex
BookName = mw.ustring.gsub(BookName, "%+", "%+")
BookName = mw.ustring.gsub(BookName, "%-", "%-")
BookName = mw.ustring.gsub(BookName, "%*", "%*")
BookName = mw.ustring.gsub(BookName, "%/", "%/")
BookName = mw.ustring.gsub(BookName, "%%", "%%")
BookName = mw.ustring.gsub(BookName, "%^", "%^")
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
hrq5qnlsvkdesf5pbreentn5wkwh2vb
46473
46472
2016-12-20T19:55:49Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Escape for find in regex
BookName = mw.ustring.gsub(BookName, "%+", "%+")
BookName = mw.ustring.gsub(BookName, "%-", "%-")
BookName = mw.ustring.gsub(BookName, "%*", "%*")
BookName = mw.ustring.gsub(BookName, "%/", "%/")
BookName = mw.ustring.gsub(BookName, "%%", "%%")
BookName = mw.ustring.gsub(BookName, "%^", "%^")
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
sfn56e6r9we2zcno55h122orfxpz45p
46474
46473
2017-06-12T00:24:54Z
JackPotte
2496
+ footer
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|48px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|48px|link=]]</div>'
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Escape for find in regex
BookName = mw.ustring.gsub(BookName, "%+", "%+")
BookName = mw.ustring.gsub(BookName, "%-", "%-")
BookName = mw.ustring.gsub(BookName, "%*", "%*")
BookName = mw.ustring.gsub(BookName, "%/", "%/")
BookName = mw.ustring.gsub(BookName, "%%", "%%")
BookName = mw.ustring.gsub(BookName, "%^", "%^")
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.displays_footer(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
local currentPageName = frame.args[2]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= '') then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local footer = {}
local previousChapter = ''
local found = false
local chapter
for i,v in ipairs(lines_) do
chapter = p.subpage(BookName, v)
if chapter ~= nil then
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
chapter = BookName .. sep .. chapter
end
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == '' then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. '|' .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. PageName .. '|' .. PageName)
table.insert(footer, theTemplateRight)
break
elseif PageName == currentPageName then
found = true
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
elseif mw.text.trim(v) ~= '' then
previousChapter = PageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. PageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. chapter .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. '|' .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
ow3k02uhfnqs722wdxay5gmnr7pd5q0
46475
46474
2017-06-12T00:34:34Z
JackPotte
2496
Not ready yet, bug with "-". Undid revision 3228462 by [[Special:Contributions/JackPotte|JackPotte]] ([[User talk:JackPotte|discuss]])
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Escape for find in regex
BookName = mw.ustring.gsub(BookName, "%+", "%+")
BookName = mw.ustring.gsub(BookName, "%-", "%-")
BookName = mw.ustring.gsub(BookName, "%*", "%*")
BookName = mw.ustring.gsub(BookName, "%/", "%/")
BookName = mw.ustring.gsub(BookName, "%%", "%%")
BookName = mw.ustring.gsub(BookName, "%^", "%^")
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep) == nil then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. chapter .. " doesn't include " .. BookName .. sep else chapter = '' end
end
end
end
else
if debug then chapter = '<font color=red>No internal link</font>' else chapter = '' end
end
return chapter
end
return p
sfn56e6r9we2zcno55h122orfxpz45p
46476
46475
2017-06-12T01:00:13Z
JackPotte
2496
+ footer
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|48px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|48px|link=]]</div>'
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. "/")
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.displays_footer(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
local currentPageName = frame.args[2]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= '') then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local footer = {}
local previousChapter = ''
local found = false
local chapter
for i,v in ipairs(lines_) do
chapter = p.subpage(BookName, v)
if chapter ~= nil then
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
chapter = BookName .. sep .. chapter
end
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == '' then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. '|' .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. PageName .. '|' .. PageName)
table.insert(footer, theTemplateRight)
break
elseif PageName == currentPageName then
found = true
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
elseif mw.text.trim(v) ~= '' then
previousChapter = PageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. PageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. chapter .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. '|' .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
02g0diojmca2mncjgdvoap5iww90rz1
46477
46476
2017-06-18T23:25:09Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|48px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|48px|link=]]</div>'
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.displays_footer(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
local currentPageName = frame.args[2]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= '') then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local footer = {}
local previousChapter = ''
local found = false
local chapter
for i,v in ipairs(lines_) do
chapter = p.subpage(BookName, v)
if chapter ~= nil then
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
chapter = BookName .. sep .. chapter
end
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == '' then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. '|' .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. PageName .. '|' .. PageName)
table.insert(footer, theTemplateRight)
break
elseif PageName == currentPageName then
found = true
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
elseif mw.text.trim(v) ~= '' then
previousChapter = PageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. PageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. chapter .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. '|' .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
0mguwa810t1egugf9ddmzsl5jh76gsn
46478
46477
2017-06-20T00:39:29Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|48px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|48px|link=]]</div>'
linkTemplates = {}
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
for k, t in ipairs(linkTemplates) do
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
end
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.displays_footer(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
local currentPageName = frame.args[2]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= '') then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local footer = {}
local previousChapter = ''
local found = false
local chapter
for i,v in ipairs(lines_) do
chapter = p.subpage(BookName, v)
if chapter ~= nil then
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
chapter = BookName .. sep .. chapter
end
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == '' then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. '|' .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. PageName .. '|' .. PageName)
table.insert(footer, theTemplateRight)
break
elseif PageName == currentPageName then
found = true
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
elseif mw.text.trim(v) ~= '' then
previousChapter = PageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. PageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. chapter .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. '|' .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
2qn4jncfx619ut6afvi94x033ejadm7
46479
46478
2017-06-22T22:14:32Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|48px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|48px|link=]]</div>'
linkTemplates = {}
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
for k, t in ipairs(linkTemplates) do
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
end
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.displays_footer(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
local currentPageName = frame.args[2]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= '') then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local footer = {}
local previousChapter = ''
local found = false
local chapter
for i,v in ipairs(lines_) do
chapter = p.subpage(BookName, v)
if chapter ~= nil then
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
chapter = BookName .. sep .. chapter
end
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == '' then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. '|' .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. PageName .. '|' .. PageName)
table.insert(footer, theTemplateRight)
break
elseif PageName == currentPageName then
found = true
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
elseif mw.text.trim(v) ~= '' then
previousChapter = PageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. PageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. chapter .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. '|' .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
k37zyzujpddhdle7a3780rxwu3mgqpv
46480
46479
2017-08-15T22:44:40Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|48px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|48px|link=]]</div>'
linkTemplates = {}
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
for k, t in ipairs(linkTemplates) do
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
end
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.displays_footer(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
local currentPageName = frame.args[2]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
if currentPageName == nil or currentPageName == '' then currentPageName = mw.title.getCurrentTitle().subpageText end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= '') then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local footer = {}
local previousChapter = ''
local found = false
local chapter
for i,v in ipairs(lines_) do
chapter = p.subpage(BookName, v)
if chapter ~= nil then
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
chapter = BookName .. sep .. chapter
end
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == '' then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. '|' .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. PageName .. '|' .. PageName)
table.insert(footer, theTemplateRight)
break
elseif PageName == currentPageName then
found = true
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
elseif mw.text.trim(v) ~= '' then
previousChapter = PageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. PageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. chapter .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. '|' .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
t7k6ow6n1439ujv6havjj27zdj9vqpy
46481
46480
2017-08-15T23:23:11Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|40px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|40px|link=]]</div>'
linkTemplates = {}
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
function p.displays_book(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local chapter
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
chapter = p.subpage(BookName, v)
if chapter ~= nil then
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. chapter .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_subpage(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.subpage(frame.args[1], frame.args[2])
end
function p.subpage(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
for k, t in ipairs(linkTemplates) do
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{" .. t .. "%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
end
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.displays_footer(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
local currentPageName = frame.args[2]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, p._escapePattern(sep .. TOC)) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
if currentPageName == nil or currentPageName == '' then currentPageName = mw.title.getCurrentTitle().subpageText end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= '') then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local footer = {}
local previousChapter = ''
local found = false
local chapter
for i,v in ipairs(lines_) do
chapter = p.subpage(BookName, v)
if chapter ~= nil then
if mw.ustring.find(chapter, p._escapePattern(BookName .. sep)) == nil then
chapter = BookName .. sep .. chapter
end
ChapterTitle = mw.title.new(chapter)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == '' then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. '|' .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. PageName .. '|' .. PageName)
table.insert(footer, theTemplateRight)
break
elseif PageName == currentPageName then
found = true
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
elseif mw.text.trim(v) ~= '' then
previousChapter = PageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. PageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. chapter .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. '|' .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. '|' .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
fndya0b7reto690vkcdanvbqkf0qkck
46482
46481
2017-08-27T22:49:47Z
JackPotte
2496
++ handling
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|40px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|40px|link=]]</div>'
linkTemplates = {}
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern(pattern)
return mw.ustring.gsub(pattern, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1");
end
function p.displays_book(frame)
if not debug then Error = '' end
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local fullPageName
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
fullPageName = p.getFullPageName(BookName, v)
if fullPageName ~= nil then
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = p.getSubpageName(BookName, fullPageName)
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_fullPageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getFullPageName(frame.args[1], frame.args[2])
end
function p.getFullPageName(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.getSubpageName(bookName, fullPageName)
k, v = mw.ustring.gsub(fullPageName, p._escapePattern(bookName) .. '/', '')
return k
end
function p.extract_subpageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getSubpageName(frame.args[1], frame.args[2])
end
function p.displays_footer(frame)
if not debug then Error = '' end
if frame == nil then return "" end
if frame.args == nil then return "" end
if frame.args[1] == nil then return "" end
local footer = {}
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= "") then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
local currentPageName
if frame.args[2] ~= nil and frame.args[2] ~= '' then
currentPageName = frame.args[2]
else
currentPageName = p.getSubpageName(BookName, mw.title.getCurrentTitle().fullText)
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= "") then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if debug then table.insert(footer, " currentPageName = " .. currentPageName .. "\n") end
if (title == nil or title == "") then return Error end
text = title.getContent(title)
if (text == nil or text == "") then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local previousChapter = ""
local found = false
local fullPageName
local subpageName
local rawFullPageName
for i, v in ipairs(lines_) do
rawFullPageName = mw.text.trim(v)
if rawFullPageName ~= '' then
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<font color=red>No internal link</font>") ~= nil then
fullPageName = nil
else
table.insert(footer, " research into: " .. rawFullPageName .. "\n")
table.insert(footer, " extraction of: " .. fullPageName .. "\n")
end
end
if fullPageName ~= nil then
if mw.ustring.find(fullPageName, BookName .. sep, 1, true) == nil then
if debug then table.insert(footer, " replacement of " .. fullPageName .. " by " .. BookName .. sep .. fullPageName .. "\n") end
fullPageName = BookName .. sep .. fullPageName
end
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
subpageName = p.getSubpageName(BookName, fullPageName)
if debug then table.insert(footer, " cut subpage: " .. subpageName .. "\n") end
if (subpageName ~= nil and subpageName ~= "") then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == "" then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. "|" .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. subpageName .. "|" .. subpageName)
table.insert(footer, theTemplateRight)
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
if debug then table.insert(footer, " " .. subpageName .. " is different from " .. currentPageName .. "\n") end
previousChapter = subpageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. "|" .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
9w008lcx9ns8tbfwvxi6h8wtnui6lgt
46483
46482
2017-08-29T21:14:44Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|40px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|40px|link=]]</div>'
linkTemplates = {}
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = true
local p = {}
function p._escapePattern(pattern)
return mw.ustring.gsub(pattern, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1");
end
function p.displays_book(frame)
if not debug then Error = '' end
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local fullPageName
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
fullPageName = p.getFullPageName(BookName, v)
if fullPageName ~= nil then
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = p.getSubpageName(BookName, fullPageName)
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_fullPageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getFullPageName(frame.args[1], frame.args[2])
end
function p.getFullPageName(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.getSubpageName(bookName, fullPageName)
k, v = mw.ustring.gsub(fullPageName, p._escapePattern(bookName) .. '/', '')
return k
end
function p.extract_subpageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getSubpageName(frame.args[1], frame.args[2])
end
function p.displays_footer(frame)
if not debug then Error = '' end
if frame == nil then return "" end
if frame.args == nil then return "" end
if frame.args[1] == nil then return "" end
local footer = {}
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= "") then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
local currentPageName
if frame.args[2] ~= nil and frame.args[2] ~= '' then
currentPageName = frame.args[2]
else
currentPageName = p.getSubpageName(BookName, mw.title.getCurrentTitle().fullText)
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= "") then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if debug then table.insert(footer, " currentPageName = " .. currentPageName .. "\n") end
if (title == nil or title == "") then return Error end
text = title.getContent(title)
if (text == nil or text == "") then return Error end
if frame.args[3] ~= nil and frame.args[3] ~= '' then
if frame.args[3] == 'programming' then
if debug then table.insert(footer, " skin=programming\n\n") end
templateLeft = '{| style="width:100%; border:solid 1px #71c837; background:#c6e9af; color:#2d5016;" class="noprint"\n| style="text-align:left; width:33%; font-size:90%;" |[[Image:Navigation_Left_Arrow.svg|18px|link=printf|alt=]] [[printf]]\n'
templateRight = '| style="text-align:center; width:34%;" | [['..mw.title.getCurrentTitle().rootText..']]<br><b>'..mw.title.getCurrentTitle().subpageText..'</b>\n| style="text-align:right; width:33%; font-size:90%;" | [[printf]] [[Image:Navigation_Right_Arrow.svg|18px|link=printf|alt=]]\n|}'
end
end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local previousChapter = ""
local found = false
local fullPageName
local subpageName
local rawFullPageName
for i, v in ipairs(lines_) do
rawFullPageName = mw.text.trim(v)
if rawFullPageName ~= '' then
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<font color=red>No internal link</font>") ~= nil then
fullPageName = nil
else
table.insert(footer, " research into: " .. rawFullPageName .. "\n")
table.insert(footer, " extraction of: " .. fullPageName .. "\n")
end
end
if fullPageName ~= nil then
if mw.ustring.find(fullPageName, BookName .. sep, 1, true) == nil then
if debug then table.insert(footer, " replacement of " .. fullPageName .. " by " .. BookName .. sep .. fullPageName .. "\n") end
fullPageName = BookName .. sep .. fullPageName
end
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
subpageName = p.getSubpageName(BookName, fullPageName)
if debug then table.insert(footer, " cut subpage: " .. subpageName .. "\n") end
if (subpageName ~= nil and subpageName ~= "") then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == "" then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. "|" .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. subpageName .. "|" .. subpageName)
table.insert(footer, theTemplateRight)
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
if debug then table.insert(footer, " " .. subpageName .. " is different from " .. currentPageName .. "\n") end
previousChapter = subpageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. "|" .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
q66r5el3q2z8mccgbo6pw2dulxkwoyn
46484
46483
2017-08-29T21:15:13Z
JackPotte
2496
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
-- Locally translated parameters
Error = "Error: invalid TOC"
Beginning1 = "Print version notice"
Beginning2 = "Print version cover"
Break = "Page-break"
Ending1 = ""
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|40px|link=]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|40px|link=]]</div>'
linkTemplates = {}
TOC = "TOC"
sep = "/"
OnlySubpages = true
debug = false
local p = {}
function p._escapePattern(pattern)
return mw.ustring.gsub(pattern, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1");
end
function p.displays_book(frame)
if not debug then Error = '' end
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local fullPageName
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
fullPageName = p.getFullPageName(BookName, v)
if fullPageName ~= nil then
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = p.getSubpageName(BookName, fullPageName)
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_fullPageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getFullPageName(frame.args[1], frame.args[2])
end
function p.getFullPageName(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.getSubpageName(bookName, fullPageName)
k, v = mw.ustring.gsub(fullPageName, p._escapePattern(bookName) .. '/', '')
return k
end
function p.extract_subpageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getSubpageName(frame.args[1], frame.args[2])
end
function p.displays_footer(frame)
if not debug then Error = '' end
if frame == nil then return "" end
if frame.args == nil then return "" end
if frame.args[1] == nil then return "" end
local footer = {}
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= "") then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
local currentPageName
if frame.args[2] ~= nil and frame.args[2] ~= '' then
currentPageName = frame.args[2]
else
currentPageName = p.getSubpageName(BookName, mw.title.getCurrentTitle().fullText)
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= "") then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if debug then table.insert(footer, " currentPageName = " .. currentPageName .. "\n") end
if (title == nil or title == "") then return Error end
text = title.getContent(title)
if (text == nil or text == "") then return Error end
if frame.args[3] ~= nil and frame.args[3] ~= '' then
if frame.args[3] == 'programming' then
if debug then table.insert(footer, " skin=programming\n\n") end
templateLeft = '{| style="width:100%; border:solid 1px #71c837; background:#c6e9af; color:#2d5016;" class="noprint"\n| style="text-align:left; width:33%; font-size:90%;" |[[Image:Navigation_Left_Arrow.svg|18px|link=printf|alt=]] [[printf]]\n'
templateRight = '| style="text-align:center; width:34%;" | [['..mw.title.getCurrentTitle().rootText..']]<br><b>'..mw.title.getCurrentTitle().subpageText..'</b>\n| style="text-align:right; width:33%; font-size:90%;" | [[printf]] [[Image:Navigation_Right_Arrow.svg|18px|link=printf|alt=]]\n|}'
end
end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local previousChapter = ""
local found = false
local fullPageName
local subpageName
local rawFullPageName
for i, v in ipairs(lines_) do
rawFullPageName = mw.text.trim(v)
if rawFullPageName ~= '' then
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<font color=red>No internal link</font>") ~= nil then
fullPageName = nil
else
table.insert(footer, " research into: " .. rawFullPageName .. "\n")
table.insert(footer, " extraction of: " .. fullPageName .. "\n")
end
end
if fullPageName ~= nil then
if mw.ustring.find(fullPageName, BookName .. sep, 1, true) == nil then
if debug then table.insert(footer, " replacement of " .. fullPageName .. " by " .. BookName .. sep .. fullPageName .. "\n") end
fullPageName = BookName .. sep .. fullPageName
end
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
subpageName = p.getSubpageName(BookName, fullPageName)
if debug then table.insert(footer, " cut subpage: " .. subpageName .. "\n") end
if (subpageName ~= nil and subpageName ~= "") then
if found == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if previousChapter == "" then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. "|" .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
end
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. subpageName .. "|" .. subpageName)
table.insert(footer, theTemplateRight)
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
if debug then table.insert(footer, " " .. subpageName .. " is different from " .. currentPageName .. "\n") end
previousChapter = subpageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. "|" .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
dfhxclpofctyqvkckozq2kokg2lmcnb
46485
46484
2019-05-19T09:44:47Z
JackPotte
2496
Translations on Commons
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
debug = false
OnlySubpages = true
local p = {}
Error = require('Module:TNT').format('I18n/Module:Printable version', 'error_invalid_toc')
Beginning1 = require('Module:TNT').format('I18n/Module:Printable version', 'header_notice')
Beginning2 = require('Module:TNT').format('I18n/Module:Printable version', 'header_cover')
Break = require('Module:TNT').format('I18n/Module:Printable version', 'page_break')
Ending1 = require('Module:TNT').format('I18n/Module:Printable version', 'footer_license')
Ending2 = require('Module:TNT').format('I18n/Module:Printable version', 'footer2')
templateLeft = require('Module:TNT').format('I18n/Module:Printable version', 'template_left')
templateRight = require('Module:TNT').format('I18n/Module:Printable version', 'template_right')
TOC = require('Module:TNT').format('I18n/Module:Printable version', 'TOC')
sep = require('Module:TNT').format('I18n/Module:Printable version', 'subpage_separator')
function p._escapePattern(pattern)
return mw.ustring.gsub(pattern, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1");
end
function p.displays_book(frame)
if not debug then Error = '' end
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local fullPageName
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
fullPageName = p.getFullPageName(BookName, v)
if fullPageName ~= nil then
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = p.getSubpageName(BookName, fullPageName)
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<font color=red>Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</font> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_fullPageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getFullPageName(frame.args[1], frame.args[2])
end
function p.getFullPageName(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<font color=red>Incorrect book or chapter name</font>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<font color=red>Chapter = ' .. chapter .. ' => book name or another subpage name</font> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<font color=red>No book subpage into the internal link:</font> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<font color=red>No internal link</font> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.getSubpageName(bookName, fullPageName)
k, v = mw.ustring.gsub(fullPageName, p._escapePattern(bookName) .. '/', '')
return k
end
function p.extract_subpageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getSubpageName(frame.args[1], frame.args[2])
end
function p.displays_footer(frame)
if not debug then Error = '' end
if frame == nil then return "" end
if frame.args == nil then return "" end
if frame.args[1] == nil then return "" end
local footer = {}
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= "") then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
local currentPageName
if frame.args[2] ~= nil and frame.args[2] ~= '' then
currentPageName = frame.args[2]
else
currentPageName = p.getSubpageName(BookName, mw.title.getCurrentTitle().fullText)
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= "") then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if debug then table.insert(footer, " currentPageName = " .. currentPageName .. "\n") end
if (title == nil or title == "") then return Error end
text = title.getContent(title)
if (text == nil or text == "") then return Error end
if frame.args[3] ~= nil and frame.args[3] ~= '' then
if frame.args[3] == 'programming' then
if debug then table.insert(footer, " skin=programming\n\n") end
templateLeft = '{| style="width:100%; border:solid 1px #71c837; background:#c6e9af; color:#2d5016;" class="noprint"\n| style="text-align:left; width:33%; font-size:90%;" |[[Image:Navigation_Left_Arrow.svg|18px|link=printf|alt=]] [[printf]]\n'
templateRight = '| style="text-align:center; width:34%;" | [['..mw.title.getCurrentTitle().rootText..']]<br><b>'..mw.title.getCurrentTitle().subpageText..'</b>\n| style="text-align:right; width:33%; font-size:90%;" | [[printf]] [[Image:Navigation_Right_Arrow.svg|18px|link=printf|alt=]]\n|}'
end
end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local previousChapter = ""
local found = false
local fullPageName
local homepage = false
local subpageName
local rawFullPageName
if (currentPageName == BookName) then
if debug then table.insert(footer, " homepage\n") end
homepage = true
end
for i, v in ipairs(lines_) do
rawFullPageName = mw.text.trim(v)
if rawFullPageName ~= '' then
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<font color=red>No internal link</font>") ~= nil then
fullPageName = nil
else
table.insert(footer, " research into: " .. rawFullPageName .. "\n")
table.insert(footer, " extraction of: " .. fullPageName .. "\n")
end
end
if fullPageName ~= nil then
if mw.ustring.find(fullPageName, BookName .. sep, 1, true) == nil then
if debug then table.insert(footer, " replacement of " .. fullPageName .. " by " .. BookName .. sep .. fullPageName .. "\n") end
fullPageName = BookName .. sep .. fullPageName
end
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
subpageName = p.getSubpageName(BookName, fullPageName)
if debug then table.insert(footer, " cut subpage: " .. subpageName .. "\n") end
if (subpageName ~= nil and subpageName ~= "") then
if found == true or homepage == true then
if debug then table.insert(footer, "<font color=red>Previous & next chapter insertion</font>\n") end
if homepage == false then
if previousChapter == "" then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. "|" .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
end
table.insert(footer, theTemplateLeft)
end
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. subpageName .. "|" .. subpageName)
table.insert(footer, theTemplateRight)
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<font color=red>Page</font> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
if debug then table.insert(footer, " " .. subpageName .. " is different from " .. currentPageName .. "\n") end
previousChapter = subpageName
else
if debug then table.insert(footer, "<font color=red>The current page</font> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<font color=red>The page</font> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<font color=red>No next chapter</font>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. "|" .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
6qgoots0h9h6trcpz1t0a2zmqj382h3
46486
46485
2021-09-18T14:59:43Z
JackPotte
2496
Replace <font> tag
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
debug = false
OnlySubpages = true
local p = {}
Error = require('Module:TNT').format('I18n/Module:Printable version', 'error_invalid_toc')
Beginning1 = require('Module:TNT').format('I18n/Module:Printable version', 'header_notice')
Beginning2 = require('Module:TNT').format('I18n/Module:Printable version', 'header_cover')
Break = require('Module:TNT').format('I18n/Module:Printable version', 'page_break')
Ending1 = require('Module:TNT').format('I18n/Module:Printable version', 'footer_license')
Ending2 = require('Module:TNT').format('I18n/Module:Printable version', 'footer2')
templateLeft = require('Module:TNT').format('I18n/Module:Printable version', 'template_left')
templateRight = require('Module:TNT').format('I18n/Module:Printable version', 'template_right')
TOC = require('Module:TNT').format('I18n/Module:Printable version', 'TOC')
sep = require('Module:TNT').format('I18n/Module:Printable version', 'subpage_separator')
function p._escapePattern(pattern)
return mw.ustring.gsub(pattern, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1");
end
function p.displays_book(frame)
if not debug then Error = '' end
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local fullPageName
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
fullPageName = p.getFullPageName(BookName, v)
if fullPageName ~= nil then
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = p.getSubpageName(BookName, fullPageName)
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;page-break-before:always;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<span class="error">Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</span> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_fullPageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getFullPageName(frame.args[1], frame.args[2])
end
function p.getFullPageName(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<span class="error">Incorrect book or chapter name</span>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<span class="error">Chapter = ' .. chapter .. ' => book name or another subpage name</span> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<span class=\"error\">No book subpage into the internal link:</span> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<span class=\"error\">No internal link</span> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.getSubpageName(bookName, fullPageName)
k, v = mw.ustring.gsub(fullPageName, p._escapePattern(bookName) .. '/', '')
return k
end
function p.extract_subpageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getSubpageName(frame.args[1], frame.args[2])
end
function p.displays_footer(frame)
if not debug then Error = '' end
if frame == nil then return "" end
if frame.args == nil then return "" end
if frame.args[1] == nil then return "" end
local footer = {}
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= "") then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
local currentPageName
if frame.args[2] ~= nil and frame.args[2] ~= '' then
currentPageName = frame.args[2]
else
currentPageName = p.getSubpageName(BookName, mw.title.getCurrentTitle().fullText)
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= "") then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if debug then table.insert(footer, " currentPageName = " .. currentPageName .. "\n") end
if (title == nil or title == "") then return Error end
text = title.getContent(title)
if (text == nil or text == "") then return Error end
if frame.args[3] ~= nil and frame.args[3] ~= '' then
if frame.args[3] == 'programming' then
if debug then table.insert(footer, " skin=programming\n\n") end
templateLeft = '{| style="width:100%; border:solid 1px #71c837; background:#c6e9af; color:#2d5016;" class="navlinks noprint"\n| style="text-align:left; width:33%; font-size:90%;" class="navprevious" |[[Image:Navigation_Left_Arrow.svg|18px|link=printf|alt=]] [[printf]]\n'
templateRight = '| style="text-align:center; width:34%;" class="navtitle" | [['..mw.title.getCurrentTitle().rootText..']]<br><b>'..mw.title.getCurrentTitle().subpageText..'</b>\n| style="text-align:right; width:33%; font-size:90%;" class="navnext" | [[printf]] [[Image:Navigation_Right_Arrow.svg|18px|link=printf|alt=]]\n|}'
end
end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local previousChapter = ""
local found = false
local fullPageName
local homepage = false
local subpageName
local rawFullPageName
if (currentPageName == BookName) then
if debug then table.insert(footer, " homepage\n") end
homepage = true
end
for i, v in ipairs(lines_) do
rawFullPageName = mw.text.trim(v)
if rawFullPageName ~= '' then
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<span class=\"error\">No internal link</span>") ~= nil then
fullPageName = nil
else
table.insert(footer, " research into: " .. rawFullPageName .. "\n")
table.insert(footer, " extraction of: " .. fullPageName .. "\n")
end
end
if fullPageName ~= nil then
if mw.ustring.find(fullPageName, BookName .. sep, 1, true) == nil then
if debug then table.insert(footer, " replacement of " .. fullPageName .. " by " .. BookName .. sep .. fullPageName .. "\n") end
fullPageName = BookName .. sep .. fullPageName
end
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
subpageName = p.getSubpageName(BookName, fullPageName)
if debug then table.insert(footer, " cut subpage: " .. subpageName .. "\n") end
if (subpageName ~= nil and subpageName ~= "") then
if found == true or homepage == true then
if debug then table.insert(footer, "<span class=\"error\">Previous & next chapter insertion</span>\n") end
if homepage == false then
if previousChapter == "" then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. "|" .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
end
table.insert(footer, theTemplateLeft)
end
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. subpageName .. "|" .. subpageName)
table.insert(footer, theTemplateRight)
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<span class=\"error\">Page</span> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
if debug then table.insert(footer, " " .. subpageName .. " is different from " .. currentPageName .. "\n") end
previousChapter = subpageName
else
if debug then table.insert(footer, "<span class=\"error\">The current page</span> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<span class=\"error\">The page</span> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<span class=\"error\">No next chapter</span>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. "|" .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
1srcky478m2c49epcd9cg70qtojn3jp
46487
46486
2022-08-19T11:41:21Z
MdsShakil
7280
[[:b:en:Module:Printable_version]] থেকে ৪৩টি সংস্করণ আমদানি করা হয়েছে
Scribunto
text/plain
-- Search and display the book pages from the TOC page, in order to create a printable version and a previous / next navigation.
debug = false
OnlySubpages = true
local p = {}
Error = require('Module:TNT').format('I18n/Module:Printable version', 'error_invalid_toc')
Beginning1 = require('Module:TNT').format('I18n/Module:Printable version', 'header_notice')
Beginning2 = require('Module:TNT').format('I18n/Module:Printable version', 'header_cover')
Break = require('Module:TNT').format('I18n/Module:Printable version', 'page_break')
Ending1 = require('Module:TNT').format('I18n/Module:Printable version', 'footer_license')
Ending2 = require('Module:TNT').format('I18n/Module:Printable version', 'footer2')
templateLeft = require('Module:TNT').format('I18n/Module:Printable version', 'template_left')
templateRight = require('Module:TNT').format('I18n/Module:Printable version', 'template_right')
TOC = require('Module:TNT').format('I18n/Module:Printable version', 'TOC')
sep = require('Module:TNT').format('I18n/Module:Printable version', 'subpage_separator')
function p._escapePattern(pattern)
return mw.ustring.gsub(pattern, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1");
end
function p.displays_book(frame)
if not debug then Error = '' end
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= '') then
title = mw.title.new(BookName)
if frame.args[2] ~= nil and frame.args[2] ~= '' then
BookName = frame.args[2]
else
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
end
if frame.args[3] ~= nil then OnlySubpages = false end
else
return Error
end
if (title == nil or title == '') then return Error end
text = title.getContent(title)
if (text == nil or text == '') then return Error end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local fullPageName
local PrintVersion = {}
for i,v in ipairs(lines_) do
if mw.text.trim(v) ~= '' then
fullPageName = p.getFullPageName(BookName, v)
if fullPageName ~= nil then
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
PageName = p.getSubpageName(BookName, fullPageName)
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table.insert(PrintVersion, '\n<div style="clear:both;page-break-before:always;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<span class="error">Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</span> ' .. BookName .. '\n\n') end
end
end
end
end
Templates1 = ""
if Beginning1 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning1} .. '\n' end
if Beginning2 ~= "" then Templates1 = Templates1 .. frame:expandTemplate{title = Beginning2} .. '\n' end
Templates2 = ""
if Ending1 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending1} .. '\n' end
if Ending2 ~= "" then Templates2 = Templates2 .. frame:expandTemplate{title = Ending2} .. '\n' end
return Templates1 .. table.concat(PrintVersion, "\r\n") .. Templates2
end
function p.extract_fullPageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getFullPageName(frame.args[1], frame.args[2])
end
function p.getFullPageName(BookName, chapter)
if (BookName ~= nil and mw.text.trim(BookName) ~= '') or (chapter ~= nil and mw.text.trim(chapter) ~= '') then
BookName = mw.text.trim(BookName)
chapter = mw.text.trim(chapter)
BookName = mw.ustring.gsub(BookName, "_", " ")
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<span class="error">Incorrect book or chapter name</span>' else chapter = '' end
end
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{[Mm]odulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)%|[0-9]}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%| *[0-9]*.*{{[Cc]%|([^}]+)}}", "[[" .. BookName .. sep .. "%1]]")
chapter = mw.ustring.gsub(chapter, " *%[%[Image:[^%]]+%]%]", "")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*:; ]*", "")
chapter = mw.ustring.gsub(chapter, "%[%[%.%.?/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%[%[/", "[[" .. BookName .. sep)
chapter = mw.ustring.gsub(chapter, "%/%]%]", "]]")
chapter = mw.ustring.gsub(chapter, "%/$", "")
if mw.ustring.find(chapter, "%[%[") ~= nil then
-- Pages titles extraction from the TOC
if mw.ustring.find(chapter, "%|") == nil or (mw.ustring.find(chapter, "%]") ~= nil and mw.ustring.find(chapter, "%|") > mw.ustring.find(chapter, "%]")) then
Ending = "%]"
else
if mw.ustring.find(chapter, "%/%|") == nil or mw.ustring.find(chapter, "%/%|") > mw.ustring.find(chapter, "%|") then
Ending = "%|"
else
Ending = "%/%|"
end
end
chapter = mw.text.split(chapter, Ending)[1] -- extraction of the line beginning
--chapter = mw.text.split(chapter, "%[%[")[2]
chapter = mw.ustring.gsub(chapter, "[^%[]*%[%[(.*)", "%1") -- brackets and pipes removal
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<span class="error">Chapter = ' .. chapter .. ' => book name or another subpage name</span> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<span class=\"error\">No book subpage into the internal link:</span> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<span class=\"error\">No internal link</span> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
end
function p.getSubpageName(bookName, fullPageName)
k, v = mw.ustring.gsub(fullPageName, p._escapePattern(bookName) .. '/', '')
return k
end
function p.extract_subpageName(frame)
if frame == nil then return '' end
if frame.args == nil then return '' end
if frame.args[1] == nil then return '' end
if frame.args[2] == nil then return '' end
return p.getSubpageName(frame.args[1], frame.args[2])
end
function p.displays_footer(frame)
if not debug then Error = '' end
if frame == nil then return "" end
if frame.args == nil then return "" end
if frame.args[1] == nil then return "" end
local footer = {}
local BookName = frame.args[1]
if (BookName ~= nil and mw.text.trim(BookName) ~= "") then
title = mw.title.new(BookName)
if mw.ustring.find(BookName, sep .. TOC, 1, true) ~= nil then BookName = mw.ustring.gsub(BookName, "^(.*)" .. sep .. TOC .. "$", "%1") end
else
return Error
end
local currentPageName
if frame.args[2] ~= nil and frame.args[2] ~= '' then
currentPageName = frame.args[2]
else
currentPageName = p.getSubpageName(BookName, mw.title.getCurrentTitle().fullText)
end
if (currentPageName ~= nil and mw.text.trim(currentPageName) ~= "") then
currentPageName = mw.text.trim(currentPageName)
else
return Error
end
if debug then table.insert(footer, " currentPageName = " .. currentPageName .. "\n") end
if (title == nil or title == "") then return Error end
text = title.getContent(title)
if (text == nil or text == "") then return Error end
if frame.args[3] ~= nil and frame.args[3] ~= '' then
if frame.args[3] == 'programming' then
if debug then table.insert(footer, " skin=programming\n\n") end
templateLeft = '{| style="width:100%; border:solid 1px #71c837; background:#c6e9af; color:#2d5016;" class="navlinks noprint"\n| style="text-align:left; width:33%; font-size:90%;" class="navprevious" |[[Image:Navigation_Left_Arrow.svg|18px|link=printf|alt=]] [[printf]]\n'
templateRight = '| style="text-align:center; width:34%;" class="navtitle" | [['..mw.title.getCurrentTitle().rootText..']]<br><b>'..mw.title.getCurrentTitle().subpageText..'</b>\n| style="text-align:right; width:33%; font-size:90%;" class="navnext" | [[printf]] [[Image:Navigation_Right_Arrow.svg|18px|link=printf|alt=]]\n|}'
end
end
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local previousChapter = ""
local found = false
local fullPageName
local homepage = false
local subpageName
local rawFullPageName
if (currentPageName == BookName) then
if debug then table.insert(footer, " homepage\n") end
homepage = true
end
for i, v in ipairs(lines_) do
rawFullPageName = mw.text.trim(v)
if rawFullPageName ~= '' then
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<span class=\"error\">No internal link</span>") ~= nil then
fullPageName = nil
else
table.insert(footer, " research into: " .. rawFullPageName .. "\n")
table.insert(footer, " extraction of: " .. fullPageName .. "\n")
end
end
if fullPageName ~= nil then
if mw.ustring.find(fullPageName, BookName .. sep, 1, true) == nil then
if debug then table.insert(footer, " replacement of " .. fullPageName .. " by " .. BookName .. sep .. fullPageName .. "\n") end
fullPageName = BookName .. sep .. fullPageName
end
ChapterTitle = mw.title.new(fullPageName)
if (ChapterTitle ~= nil and ChapterTitle.exists) then
subpageName = p.getSubpageName(BookName, fullPageName)
if debug then table.insert(footer, " cut subpage: " .. subpageName .. "\n") end
if (subpageName ~= nil and subpageName ~= "") then
if found == true or homepage == true then
if debug then table.insert(footer, "<span class=\"error\">Previous & next chapter insertion</span>\n") end
if homepage == false then
if previousChapter == "" then
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. "|" .. TOC)
else
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
end
table.insert(footer, theTemplateLeft)
end
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. sep .. subpageName .. "|" .. subpageName)
table.insert(footer, theTemplateRight)
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<span class=\"error\">Page</span> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
if debug then table.insert(footer, " " .. subpageName .. " is different from " .. currentPageName .. "\n") end
previousChapter = subpageName
else
if debug then table.insert(footer, "<span class=\"error\">The current page</span> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<span class=\"error\">The page</span> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
end
end
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<span class=\"error\">No next chapter</span>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)
theTemplateRight, nb = mw.ustring.gsub(templateRight, "printf", BookName .. "|" .. TOC)
table.insert(footer, theTemplateRight)
end
return table.concat(footer, "")
end
return p
1srcky478m2c49epcd9cg70qtojn3jp
মডিউল:TNT
828
15838
46488
2019-04-26T17:55:59Z
আফতাবুজ্জামান
1621
https://www.mediawiki.org/wiki/Module:TNT থেকে
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, v)
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Converts first parameter to a interwiki-ready link. For example, it converts
-- "Sandbox/Sample.tab" -> 'commons:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
function link(dataset)
dataset = 'Data:' .. mw.text.trim(dataset or '')
if mw.site.siteName == 'Wikimedia Commons' then
return dataset
else
return 'commons:' .. dataset
end
end
function p.doc(frame)
return frame:extensionTag(
'templatedata',
p.getTemplateData(frame.args[1])
) .. tntMessage('edit_doc', {link(dataset)})
end
function p.getTemplateData(page)
dataset = 'Templatedata/' .. normalizeDataset(page)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
function formatMessage(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(tntMessage('error_bad_msgkey', {key, link(dataset)}))
end
end
function tntMessage(key, params)
return formatMessage(i18nDataset, key, params)
end
function normalizeDataset(dataset)
if not dataset or dataset == '' then
error(tntMessage('error_no_dataset', {}))
end
if string.sub(dataset,-4) ~= '.tab' then
dataset = dataset .. '.tab'
end
return dataset
end
function loadData(dataset, lang)
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(tntMessage('error_bad_dataset', {link(dataset)}))
end
end
return data
end
return p
bwymwfgzx0xl18rmczypfxmbfns29um
46489
46488
2019-04-28T05:40:45Z
DiBabelYurikBot
8312
[[mw:Module:TNT]] থেকে Yurik-এর করা 4টি পরিবর্তন অনুলিপি করা হয়েছে: "no auto I18n/ prefix, breaks some graphs, fixed doc link, Trim parameter whitespaces, docs link"। [[mw:WP:TNT|নথিপত্র]] দেখুন।
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
local checkType = require('libraryUtil').checkType
-- Forward declaration of the local functions
local formatMessage, loadData, link
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
function p.format(dataset, key, params, lang)
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
checkType('format', 3, params, 'table', true)
checkType('format', 4, lang, 'string', true)
return formatMessage(dataset, key, params, lang)
end
-- Converts first parameter to a interwiki-ready link. For example, it converts
-- "Sandbox/Sample.tab" -> 'commons:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
return frame:extensionTag(
'templatedata',
p.getTemplateData(mw.text.trim(frame.args[1]))
) .. formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(page)
dataset = 'Templatedata/' .. mw.text.trim(page)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
loadData = function(dataset, lang)
if not dataset or dataset == '' then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
if string.sub(dataset,-4) ~= '.tab' then
dataset = dataset .. '.tab'
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
dataset = 'Data:' .. mw.text.trim(dataset or '')
if mw.site.siteName == 'Wikimedia Commons' then
return dataset
else
return 'commons:' .. dataset
end
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
cj3sci2qniookq33t70bbeiy23liz7s
46490
46489
2019-05-01T03:02:03Z
DiBabelYurikBot
8312
[[mw:Module:TNT]] থেকে Yurik-এর করা 5টি পরিবর্তন অনুলিপি করা হয়েছে: "fix doc translation link, Trim parameter whitespaces, docs link, fix templatedata doc having just the positional parameters, make i18n/ prefix optional, support for usage from modules"। [[mw:WP:TNT|নথিপত্র]] দেখুন।
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
local checkType = require('libraryUtil').checkType
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
function p.format(dataset, key, params, lang)
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
checkType('format', 3, params, 'table', true)
checkType('format', 4, lang, 'string', true)
return formatMessage(dataset, key, params, lang)
end
-- Converts first parameter to a interwiki-ready link. For example, it converts
-- "Sandbox/Sample.tab" -> 'commons:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
dataset = 'Data:' .. mw.text.trim(dataset or '')
if mw.site.siteName == 'Wikimedia Commons' then
return dataset
else
return 'commons:' .. dataset
end
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
0a6dg9820n4xn6bgctsi6veuaesh4fn
46491
46490
2019-05-04T03:30:04Z
DiBabelYurikBot
8312
[[mw:Module:TNT]] থেকে Yurik-এর করা 4টি পরিবর্তন অনুলিপি করা হয়েছে: "optimize libraryUtil loading only when needed, fix templatedata doc having just the positional parameters, make i18n/ prefix optional, support for usage from modules, no auto I18n/ prefix, breaks some graphs"। [[mw:WP:TNT|নথিপত্র]] দেখুন।
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
function p.format(dataset, key, params, lang)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
checkType('format', 3, params, 'table', true)
checkType('format', 4, lang, 'string', true)
return formatMessage(dataset, key, params, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
dvi86waksuvejuhtqezicw68gjid5yd
46492
46491
2019-05-05T23:32:38Z
DiBabelYurikBot
8312
[[mw:Module:TNT]] থেকে Yurik-এর করা 5টি পরিবর্তন অনুলিপি করা হয়েছে: "breaking: ignore lang param in format(), use formatInLanguage() instead, make i18n/ prefix optional, support for usage from modules, no auto I18n/ prefix, breaks some graphs, fix doc translation link, deprecate link function, always use c: for data links to Commons"। [[mw:WP:TNT|নথিপত্র]] দেখুন।
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
gab220sz1nwgzs30q2kfz236j8cpbhm
46493
46492
2020-04-28T16:44:07Z
DiBabelYurikBot
8312
[[mw:Module:TNT]] থেকে Bawolff-এর করা একটি পরিবর্তন অনুলিপি করা হয়েছে: "Give a more useful error message if jsonconfig is missing. There have been three questions about this on the support desk from third party folks copying this template."। [[mw:WP:TNT|নথিপত্র]] দেখুন।
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
icfixo3zxiew6gqg3s5h19xr03x3wkh
46494
46493
2022-08-19T11:43:16Z
MdsShakil
7280
[[:w:মডিউল:TNT]] থেকে ৬টি সংস্করণ আমদানি করা হয়েছে
Scribunto
text/plain
--
-- INTRO: (!!! DO NOT RENAME THIS PAGE !!!)
-- This module allows any template or module to be copy/pasted between
-- wikis without any translation changes. All translation text is stored
-- in the global Data:*.tab pages on Commons, and used everywhere.
--
-- SEE: https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules
--
-- ATTENTION:
-- Please do NOT rename this module - it has to be identical on all wikis.
-- This code is maintained at https://www.mediawiki.org/wiki/Module:TNT
-- Please do not modify it anywhere else, as it may get copied and override your changes.
-- Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT
--
-- DESCRIPTION:
-- The "msg" function uses a Commons dataset to translate a message
-- with a given key (e.g. source-table), plus optional arguments
-- to the wiki markup in the current content language.
-- Use lang=xx to set language. Example:
--
-- {{#invoke:TNT | msg
-- | I18n/Template:Graphs.tab <!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab -->
-- | source-table <!-- uses a translation message with id = "source-table" -->
-- | param1 }} <!-- optional parameter -->
--
--
-- The "doc" function will generate the <templatedata> parameter documentation for templates.
-- This way all template parameters can be stored and localized in a single Commons dataset.
-- NOTE: "doc" assumes that all documentation is located in Data:Templatedata/* on Commons.
--
-- {{#invoke:TNT | doc | Graph:Lines }}
-- uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab
-- if the current page is Template:Graph:Lines/doc
--
local p = {}
local i18nDataset = 'I18n/Module:TNT.tab'
-- Forward declaration of the local functions
local sanitizeDataset, loadData, link, formatMessage
function p.msg(frame)
local dataset, id
local params = {}
local lang = nil
for k, v in pairs(frame.args) do
if k == 1 then
dataset = mw.text.trim(v)
elseif k == 2 then
id = mw.text.trim(v)
elseif type(k) == 'number' then
table.insert(params, mw.text.trim(v))
elseif k == 'lang' and v ~= '_' then
lang = mw.text.trim(v)
end
end
return formatMessage(dataset, id, params, lang)
end
-- Identical to p.msg() above, but used from other lua modules
-- Parameters: name of dataset, message key, optional arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, {...})
end
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatInLanguage', 1, lang, 'string')
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatInLanguage', 3, key, 'string')
return formatMessage(dataset, key, {...}, lang)
end
-- Obsolete function that adds a 'c:' prefix to the first param.
-- "Sandbox/Sample.tab" -> 'c:Data:Sandbox/Sample.tab'
function p.link(frame)
return link(frame.args[1])
end
function p.doc(frame)
local dataset = 'Templatedata/' .. sanitizeDataset(frame.args[1])
return frame:extensionTag('templatedata', p.getTemplateData(dataset)) ..
formatMessage(i18nDataset, 'edit_doc', {link(dataset)})
end
function p.getTemplateData(dataset)
-- TODO: add '_' parameter once lua starts reindexing properly for "all" languages
local data = loadData(dataset)
local names = {}
for _, field in pairs(data.schema.fields) do
table.insert(names, field.name)
end
local params = {}
local paramOrder = {}
for _, row in pairs(data.data) do
local newVal = {}
local name = nil
for pos, val in pairs(row) do
local columnName = names[pos]
if columnName == 'name' then
name = val
else
newVal[columnName] = val
end
end
if name then
params[name] = newVal
table.insert(paramOrder, name)
end
end
-- Work around json encoding treating {"1":{...}} as an [{...}]
params['zzz123']=''
local json = mw.text.jsonEncode({
params=params,
paramOrder=paramOrder,
description=data.description
})
json = string.gsub(json,'"zzz123":"",?', "")
return json
end
-- Local functions
sanitizeDataset = function(dataset)
if not dataset then
return nil
end
dataset = mw.text.trim(dataset)
if dataset == '' then
return nil
elseif string.sub(dataset,-4) ~= '.tab' then
return dataset .. '.tab'
else
return dataset
end
end
loadData = function(dataset, lang)
dataset = sanitizeDataset(dataset)
if not dataset then
error(formatMessage(i18nDataset, 'error_no_dataset', {}))
end
-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end
local data = mw.ext.data.get(dataset, lang)
if data == false then
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Missing Commons dataset ' .. i18nDataset)
else
error(formatMessage(i18nDataset, 'error_bad_dataset', {link(dataset)}))
end
end
return data
end
-- Given a dataset name, convert it to a title with the 'commons:data:' prefix
link = function(dataset)
return 'c:Data:' .. mw.text.trim(dataset or '')
end
formatMessage = function(dataset, key, params, lang)
for _, row in pairs(loadData(dataset, lang).data) do
local id, msg = unpack(row)
if id == key then
local result = mw.message.newRawMessage(msg, unpack(params or {}))
return result:plain()
end
end
if dataset == i18nDataset then
-- Prevent cyclical calls
error('Invalid message key "' .. key .. '"')
else
error(formatMessage(i18nDataset, 'error_bad_msgkey', {key, link(dataset)}))
end
end
return p
icfixo3zxiew6gqg3s5h19xr03x3wkh