Modulis:IncrementParams
Moduļa dokumentācija[skatīt] [labot] [hronoloģija] [pārlādēt]
Usage
labot šo sadaļu{{subst:#invoke:IncrementParams|main}}
Ar pre
parametru
{{#invoke:IncrementParams|main|pre=yes}}
Output
labot šo sadaļu| label80 = | data80 = | label81 = | data81 = | label82 = | data82 = | label83 = | data83 = | label84 = | data84 = | label85 = | data85 = | label86 = | data86 = | label87 = | data87 = | label88 = | data88 = | label89 = | data89 = | label90 = | data90 = | label91 = | data91 = | label92 = | data92 = | label93 = | data93 = | label94 = | data94 = | label95 = | data95 = | label96 = | data96 = | label97 = | data97 = | label98 = | data98 = | label99 = | data99 = | label100 = | data100 = | label101 = | data101 = | label102 = | data102 = | label103 = | data103 = | label104 = | data104 = | label105 = | data105 = | label106 = | data106 = | label107 = | data107 = | label108 = | data108 = | label109 = | data109 = | label110 = | data110 = | label111 = | data111 = | label112 = | data112 = | label113 = | data113 = | label114 = | data114 = | label115 = | data115 = | label116 = | data116 = | label117 = | data117 = | label118 = | data118 = | label119 = | data119 = | label120 = | data120 = | label121 = | data121 = | label122 = | data122 = | label123 = | data123 = | label124 = | data124 = | label125 = | data125 = | label126 = | data126 = | label127 = | data127 = | label128 = | data128 = | label129 = | data129 = | label130 = | data130 = | label131 = | data131 = | label132 = | data132 = | label133 = | data133 = | label134 = | data134 = | label135 = | data135 = | label136 = | data136 = | label137 = | data137 = | label138 = | data138 = | label139 = | data139 = | label140 = | data140 = | label141 = | data141 = | label142 = | data142 = | label143 = | data143 = | label144 = | data144 = | label145 = | data145 = | label146 = | data146 = | label147 = | data147 = | label148 = | data148 = | label149 = | data149 = | label150 = | data150 = | label151 = | data151 = | label152 = | data152 = | label153 = | data153 = | label154 = | data154 = | label155 = | data155 = | label156 = | data156 = | label157 = | data157 = | label158 = | data158 =
Dokumentācija iekļauta no Modulis:IncrementParams/doc (labot | hronoloģija) Vari eksperimentēt šī moduļa smilšu kastes (izveidot | spoguļversija) un testu (izveidot) lapā Moduļa apakšlapas. |
-- STEP 1: Click on the "edit" tab at the top of the page to edit this module.
-- STEP 2: if you want to increment by a number other than 1, put that number below, after the equals sign.
local increment = 79
-- STEP 3: Replace the example template text with the template text that you wish to increment.
local templatetext = [==========[
| label1 =
| data1 =
| label2 =
| data2 =
| label3 =
| data3 =
| label4 =
| data4 =
| label5 =
| data5 =
| label6 =
| data6 =
| label7 =
| data7 =
| label8 =
| data8 =
| label9 =
| data9 =
| label10 =
| data10 =
| label11 =
| data11 =
| label12 =
| data12 =
| label13 =
| data13 =
| label14 =
| data14 =
| label15 =
| data15 =
| label16 =
| data16 =
| label17 =
| data17 =
| label18 =
| data18 =
| label19 =
| data19 =
| label20 =
| data20 =
| label21 =
| data21 =
| label22 =
| data22 =
| label23 =
| data23 =
| label24 =
| data24 =
| label25 =
| data25 =
| label26 =
| data26 =
| label27 =
| data27 =
| label28 =
| data28 =
| label29 =
| data29 =
| label30 =
| data30 =
| label31 =
| data31 =
| label32 =
| data32 =
| label33 =
| data33 =
| label34 =
| data34 =
| label35 =
| data35 =
| label36 =
| data36 =
| label37 =
| data37 =
| label38 =
| data38 =
| label39 =
| data39 =
| label40 =
| data40 =
| label41 =
| data41 =
| label42 =
| data42 =
| label43 =
| data43 =
| label44 =
| data44 =
| label45 =
| data45 =
| label46 =
| data46 =
| label47 =
| data47 =
| label48 =
| data48 =
| label49 =
| data49 =
| label50 =
| data50 =
| label51 =
| data51 =
| label52 =
| data52 =
| label53 =
| data53 =
| label54 =
| data54 =
| label55 =
| data55 =
| label56 =
| data56 =
| label57 =
| data57 =
| label58 =
| data58 =
| label59 =
| data59 =
| label60 =
| data60 =
| label61 =
| data61 =
| label62 =
| data62 =
| label63 =
| data63 =
| label64 =
| data64 =
| label65 =
| data65 =
| label66 =
| data66 =
| label67 =
| data67 =
| label68 =
| data68 =
| label69 =
| data69 =
| label70 =
| data70 =
| label71 =
| data71 =
| label72 =
| data72 =
| label73 =
| data73 =
| label74 =
| data74 =
| label75 =
| data75 =
| label76 =
| data76 =
| label77 =
| data77 =
| label78 =
| data78 =
| label79 =
| data79 =
]==========]
-- STEP 4: Save this module.
-- STEP 5: You can now output the incremented text with the following code:
-- {{subst:#invoke:IncrementParams|main}}
-- Or you can simply copy and paste the text from this module's documentation.
-- STEP 6: Check the output! In rare cases this module might produce false positives.
-- For example, it will change the text "[[Some link|foo3=bar]]" to "[[Some link|foo4=bar]]".
-- You can use the "show changes" function in the edit window of the template you are editing
-- to find any false positives.
-- STEP 7: When you are finished, undo your changes to this page, so that the next person
-- won't be confused by seeing any non-default values. Thanks for using this module!
local p = {}
local function replace(prefix, num, suffix)
return '|' .. prefix .. tostring(tonumber(num) + increment) .. suffix .. '='
end
function p.main(frame)
-- Increment the template text.
templatetext = mw.ustring.gsub(templatetext, '|(%s*%a?[%a_%-]-%s*)([1-9]%d*)(%s*[%a_%-]-%a?%s*)=', replace)
-- Add pre tags and escape html etc. if the pre option is set.
if frame and frame.args and frame.args.pre and frame.args.pre ~= '' then
templatetext = mw.text.nowiki(templatetext)
templatetext = '<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; '
.. 'white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;">'
.. templatetext .. '</pre>'
end
return templatetext
end
return p