Wikipedia tnwiki https://tn.wikipedia.org/wiki/Main_Page MediaWiki 1.39.0-wmf.22 first-letter Pego Faphegileng Puisano Modirisi Puisano ya modirisi Wikipedia Puisano ya Wikipedia Setshwantsho Puisano ya setshwantsho MediaWiki Puisano ya MediaWiki Tempolete Puisano ya tempolete Thuso Puisano ya thuso Karolo Puisano ya karolo TimedText TimedText talk Module Module talk Gadget Gadget talk Gadget definition Gadget definition talk Tempolete:Fmbox 10 2737 27143 18364 2022-07-31T06:36:33Z Rebel Agent 9072 Ke Ntshafatso wikitext text/x-wiki {{#invoke:Message box|fmbox}}<noinclude> {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> q4qfnrd9je1n71bknyj9gdhs02g2rws Tempolete:Side box 10 2949 27140 12447 2022-07-31T06:26:53Z Rebel Agent 9072 Ntšhafatso wikitext text/x-wiki {{#invoke:Side box|main}}<noinclude> {{documentation}} <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude> s1zpy5c500y28mjgve7gykq14088u4e Tempolete:Botswana-geo-stub 10 3790 27150 26783 2022-07-31T07:10:34Z Rebel Agent 9072 Thanolo wikitext text/x-wiki {{asbox | image = Flag-map of Botswana.svg | pix = 30 | subject = Lefelo la [[Botswana]] | qualifier = | category = Botswana geography stubs | tempsort = * | name = Template:Botswana-geo-stub }} <noinclude> [[Category:Botswana stub templates]] </noinclude> oqzhvjmioinewipxohigt25vyqwwmqr Module:String 828 4061 27139 18451 2022-07-31T06:21:23Z Rebel Agent 9072 Ntshafatso Scribunto text/plain --[[ This module is intended to provide access to basic string functions. Most of the functions provided here can be invoked with named parameters, unnamed parameters, or a mixture. If named parameters are used, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. Depending on the intended use, it may be advantageous to either preserve or remove such whitespace. Global options ignore_errors: If set to 'true' or 1, any error condition will result in an empty string being returned rather than an error message. error_category: If an error occurs, specifies the name of a category to include with the error message. The default category is [Category:Errors reported by Module String]. no_category: If set to 'true' or 1, no category will be added if an error is generated. Unit tests for this module are available at Module:String/tests. ]] local str = {} --[[ len This function returns the length of the target string. Usage: {{#invoke:String|len|target_string|}} OR {{#invoke:String|len|s=target_string}} Parameters s: The string whose length to report If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. ]] function str.len( frame ) local new_args = str._getParameters( frame.args, {'s'} ) local s = new_args['s'] or '' return mw.ustring.len( s ) end --[[ sub This function returns a substring of the target string at specified indices. Usage: {{#invoke:String|sub|target_string|start_index|end_index}} OR {{#invoke:String|sub|s=target_string|i=start_index|j=end_index}} Parameters s: The string to return a subset of i: The fist index of the substring to return, defaults to 1. j: The last index of the string to return, defaults to the last character. The first character of the string is assigned an index of 1. If either i or j is a negative value, it is interpreted the same as selecting a character by counting from the end of the string. Hence, a value of -1 is the same as selecting the last character of the string. If the requested indices are out of range for the given string, an error is reported. ]] function str.sub( frame ) local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } ) local s = new_args['s'] or '' local i = tonumber( new_args['i'] ) or 1 local j = tonumber( new_args['j'] ) or -1 local len = mw.ustring.len( s ) -- Convert negatives for range checking if i < 0 then i = len + i + 1 end if j < 0 then j = len + j + 1 end if i > len or j > len or i < 1 or j < 1 then return str._error( 'String subset index out of range' ) end if j < i then return str._error( 'String subset indices out of order' ) end return mw.ustring.sub( s, i, j ) end --[[ This function implements that features of {{str sub old}} and is kept in order to maintain these older templates. ]] function str.sublength( frame ) local i = tonumber( frame.args.i ) or 0 local len = tonumber( frame.args.len ) return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) ) end --[[ _match This function returns a substring from the source string that matches a specified pattern. It is exported for use in other modules Usage: strmatch = require("Module:String")._match sresult = strmatch( s, pattern, start, match, plain, nomatch ) Parameters s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error. For information on constructing Lua patterns, a form of [regular expression], see: * http://www.lua.org/manual/5.1/manual.html#5.4.1 * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns ]] -- This sub-routine is exported for use in other modules function str._match( s, pattern, start, match_index, plain_flag, nomatch ) if s == '' then return str._error( 'Target string is empty' ) end if pattern == '' then return str._error( 'Pattern string is empty' ) end start = tonumber(start) or 1 if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then return str._error( 'Requested start is out of range' ) end if match_index == 0 then return str._error( 'Match index is out of range' ) end if plain_flag then pattern = str._escapePattern( pattern ) end local result if match_index == 1 then -- Find first match is simple case result = mw.ustring.match( s, pattern, start ) else if start > 1 then s = mw.ustring.sub( s, start ) end local iterator = mw.ustring.gmatch(s, pattern) if match_index > 0 then -- Forward search for w in iterator do match_index = match_index - 1 if match_index == 0 then result = w break end end else -- Reverse search local result_table = {} local count = 1 for w in iterator do result_table[count] = w count = count + 1 end result = result_table[ count + match_index ] end end if result == nil then if nomatch == nil then return str._error( 'Match not found' ) else return nomatch end else return result end end --[[ match This function returns a substring from the source string that matches a specified pattern. Usage: {{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}} OR {{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index |match=match_number|plain=plain_flag|nomatch=nomatch_output}} Parameters s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error. If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from each string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. If the match_number or start_index are out of range for the string being queried, then this function generates an error. An error is also generated if no match is found. If one adds the parameter ignore_errors=true, then the error will be suppressed and an empty string will be returned on any failure. For information on constructing Lua patterns, a form of [regular expression], see: * http://www.lua.org/manual/5.1/manual.html#5.4.1 * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns ]] -- This is the entry point for #invoke:String|match function str.match( frame ) local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} ) local s = new_args['s'] or '' local start = tonumber( new_args['start'] ) or 1 local plain_flag = str._getBoolean( new_args['plain'] or false ) local pattern = new_args['pattern'] or '' local match_index = math.floor( tonumber(new_args['match']) or 1 ) local nomatch = new_args['nomatch'] return str._match( s, pattern, start, match_index, plain_flag, nomatch ) end --[[ pos This function returns a single character from the target string at position pos. Usage: {{#invoke:String|pos|target_string|index_value}} OR {{#invoke:String|pos|target=target_string|pos=index_value}} Parameters target: The string to search pos: The index for the character to return If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. The first character has an index value of 1. If one requests a negative value, this function will select a character by counting backwards from the end of the string. In other words pos = -1 is the same as asking for the last character. A requested value of zero, or a value greater than the length of the string returns an error. ]] function str.pos( frame ) local new_args = str._getParameters( frame.args, {'target', 'pos'} ) local target_str = new_args['target'] or '' local pos = tonumber( new_args['pos'] ) or 0 if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then return str._error( 'String index out of range' ) end return mw.ustring.sub( target_str, pos, pos ) end --[[ str_find This function duplicates the behavior of {{str_find}}, including all of its quirks. This is provided in order to support existing templates, but is NOT RECOMMENDED for new code and templates. New code is recommended to use the "find" function instead. Returns the first index in "source" that is a match to "target". Indexing is 1-based, and the function returns -1 if the "target" string is not present in "source". Important Note: If the "target" string is empty / missing, this function returns a value of "1", which is generally unexpected behavior, and must be accounted for separatetly. ]] function str.str_find( frame ) local new_args = str._getParameters( frame.args, {'source', 'target'} ) local source_str = new_args['source'] or '' local target_str = new_args['target'] or '' if target_str == '' then return 1 end local start = mw.ustring.find( source_str, target_str, 1, true ) if start == nil then start = -1 end return start end --[[ find This function allows one to search for a target string or pattern within another string. Usage: {{#invoke:String|find|source_str|target_string|start_index|plain_flag}} OR {{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}} Parameters source: The string to search target: The string or pattern to find within source start: The index within the source string to start the search, defaults to 1 plain: Boolean flag indicating that target should be understood as plain text and not as a Lua style regular expression, defaults to true If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. In some circumstances this is desirable, in other cases one may want to preserve the whitespace. This function returns the first index >= "start" where "target" can be found within "source". Indices are 1-based. If "target" is not found, then this function returns 0. If either "source" or "target" are missing / empty, this function also returns 0. This function should be safe for UTF-8 strings. ]] function str.find( frame ) local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } ) local source_str = new_args['source'] or '' local pattern = new_args['target'] or '' local start_pos = tonumber(new_args['start']) or 1 local plain = new_args['plain'] or true if source_str == '' or pattern == '' then return 0 end plain = str._getBoolean( plain ) local start = mw.ustring.find( source_str, pattern, start_pos, plain ) if start == nil then start = 0 end return start end --[[ replace This function allows one to replace a target string or pattern within another string. Usage: {{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}} OR {{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string| count=replacement_count|plain=plain_flag}} Parameters source: The string to search pattern: The string or pattern to find within source replace: The replacement text count: The number of occurences to replace, defaults to all. plain: Boolean flag indicating that pattern should be understood as plain text and not as a Lua style regular expression, defaults to true ]] function str.replace( frame ) local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } ) local source_str = new_args['source'] or '' local pattern = new_args['pattern'] or '' local replace = new_args['replace'] or '' local count = tonumber( new_args['count'] ) local plain = new_args['plain'] or true if source_str == '' or pattern == '' then return source_str end plain = str._getBoolean( plain ) if plain then pattern = str._escapePattern( pattern ) replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences. end local result if count ~= nil then result = mw.ustring.gsub( source_str, pattern, replace, count ) else result = mw.ustring.gsub( source_str, pattern, replace ) end return result end --[[ simple function to pipe string.rep to templates. ]] function str.rep( frame ) local repetitions = tonumber( frame.args[2] ) if not repetitions then return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' ) end return string.rep( frame.args[1] or '', repetitions ) end --[[ escapePattern This function escapes special characters from a Lua string pattern. See [1] for details on how patterns work. [1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns Usage: {{#invoke:String|escapePattern|pattern_string}} Parameters pattern_string: The pattern string to escape. ]] function str.escapePattern( frame ) local pattern_str = frame.args[1] if not pattern_str then return str._error( 'No pattern string specified' ) end local result = str._escapePattern( pattern_str ) return result end --[[ count This function counts the number of occurrences of one string in another. ]] function str.count(frame) local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'}) local source = args.source or '' local pattern = args.pattern or '' local plain = str._getBoolean(args.plain or true) if plain then pattern = str._escapePattern(pattern) end local _, count = mw.ustring.gsub(source, pattern, '') return count end --[[ endswith This function determines whether a string ends with another string. ]] function str.endswith(frame) local args = str._getParameters(frame.args, {'source', 'pattern'}) local source = args.source or '' local pattern = args.pattern or '' if pattern == '' then -- All strings end with the empty string. return "yes" end if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then return "yes" else return "" end end --[[ join Join all non empty arguments together; the first argument is the separator. Usage: {{#invoke:String|join|sep|one|two|three}} ]] function str.join(frame) local args = {} local sep for _, v in ipairs( frame.args ) do if sep then if v ~= '' then table.insert(args, v) end else sep = v end end return table.concat( args, sep or '' ) end --[[ Helper function that populates the argument list given that user may need to use a mix of named and unnamed parameters. This is relevant because named parameters are not identical to unnamed parameters due to string trimming, and when dealing with strings we sometimes want to either preserve or remove that whitespace depending on the application. ]] function str._getParameters( frame_args, arg_list ) local new_args = {} local index = 1 local value for _, arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index] index = index + 1 end new_args[arg] = value end return new_args end --[[ Helper function to handle error messages. ]] function str._error( error_str ) local frame = mw.getCurrentFrame() local error_category = frame.args.error_category or 'Errors reported by Module String' local ignore_errors = frame.args.ignore_errors or false local no_category = frame.args.no_category or false if str._getBoolean(ignore_errors) then return '' end local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>' if error_category ~= '' and not str._getBoolean( no_category ) then error_str = '[[Category:' .. error_category .. ']]' .. error_str end return error_str end --[[ Helper Function to interpret boolean strings ]] function str._getBoolean( boolean_str ) local boolean_value if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower() if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == '' then boolean_value = false else boolean_value = true end elseif type( boolean_str ) == 'boolean' then boolean_value = boolean_str else error( 'No boolean value found' ) end return boolean_value end --[[ Helper function that escapes all pattern characters so that they will be treated as plain text. ]] function str._escapePattern( pattern_str ) return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ) end return str cufmbepw7ml3gut4lchtqrhtj5r63cp Alexandria, Kapa Botlhaba 0 5080 27130 25857 2022-07-31T05:58:43Z Rebel Agent 9072 Ga go tlhokege wikitext text/x-wiki {{Infobox settlement | name = Alexandria | native_name = | other_name = | settlement_type = Toropo | pushpin_map = South Africa | pushpin_map_caption = | latd = 33 |latm = 39.2 |lats = |latNS=S | longd = 26 |longm = 24.5 |longs = | image_skyline = Alexandria Dutch Reformed Church.JPG | image_caption = The Dutch Reformed Church, a Provincial Heritage Site,<ref>{{cite web|title=9/2/005/0004- Dutch Reformed Church Voortrekker Street Alexandria|url=http://196.35.231.29/sahra/HeritageSitesDetail.aspx?id=21457|publisher=South African Heritage Resource Agency}}</ref> in Alexandria | subdivision_type = Naga | subdivision_name = [[Aforika Borwa]] | subdivision_type1 = Profense | subdivision_name1 = [[Kapa Botlhaba]] | subdivision_type2 = [[Districts tsa Aforika Borwa|Karolwana]] | subdivision_name2 = [[Karolwana sa Sarah Baartman|Sarah Baartman]] | subdivision_type3 = Masepala | subdivision_name3 = Ndlambe | elevation_m = | area_footnotes = <ref name=census2011>Main Places [http://census2011.adrianfrith.com/place/265008 Alexandria] le [http://census2011.adrianfrith.com/place/265009 KwaNonkqubela] ''Census 2011''.</ref> | area_total_km2 = 3.53 | population_footnotes = <ref name=census2011 /> | population_total = 5252 | population_as_of = 2011 <!-- demographics (section 1) --> | demographics1_footnotes = <ref name=census2011 /> | demographics_type1 = Ditlhopha tsa batho | demographics1_title1 = [[Bantsho]] | demographics1_info1 = 77.4% | demographics1_title2 = [[MaKhalathi]] | demographics1_info2 = 16.3% | demographics1_title3 = [[MaIndia]] | demographics1_info3 = 0.3% | demographics1_title4 = [[Basweu]] | demographics1_info4 = 5.2% | demographics1_title5 = Ba bangwe | demographics1_info5 = 0.8% <!-- demographics (section 2) --> | demographics2_footnotes = <ref name=census2011 /> | demographics_type2 = Maleme | demographics2_title1 = [[Sethosa]] | demographics2_info1 = 72.8% | demographics2_title2 = [[Afrikaans]] | demographics2_info2 = 20.3% | demographics2_title3 = [[Sekgoga]] | demographics2_info3 = 4.2% | demographics2_title4 = | demographics2_info4 = | demographics2_title5 = Other | demographics2_info5 = 2.7% | postal_code_type = Nomoro ya poso | postal_code = 6185 | area_code_type = Nomoro ya mogala | area_code = 046 }} '''Alexandria''' ke setoropo sa [[Kapa Botlhaba]] mo [[Aforika Borwa]]. ==Metswedi== {{Reflist}} n29ptp0ywgqs4pof1wvfuk9ga49dqkk 27131 27130 2022-07-31T06:00:37Z Rebel Agent 9072 /* Metswedi */ wikitext text/x-wiki {{Infobox settlement | name = Alexandria | native_name = | other_name = | settlement_type = Toropo | pushpin_map = South Africa | pushpin_map_caption = | latd = 33 |latm = 39.2 |lats = |latNS=S | longd = 26 |longm = 24.5 |longs = | image_skyline = Alexandria Dutch Reformed Church.JPG | image_caption = The Dutch Reformed Church, a Provincial Heritage Site,<ref>{{cite web|title=9/2/005/0004- Dutch Reformed Church Voortrekker Street Alexandria|url=http://196.35.231.29/sahra/HeritageSitesDetail.aspx?id=21457|publisher=South African Heritage Resource Agency}}</ref> in Alexandria | subdivision_type = Naga | subdivision_name = [[Aforika Borwa]] | subdivision_type1 = Profense | subdivision_name1 = [[Kapa Botlhaba]] | subdivision_type2 = [[Districts tsa Aforika Borwa|Karolwana]] | subdivision_name2 = [[Karolwana sa Sarah Baartman|Sarah Baartman]] | subdivision_type3 = Masepala | subdivision_name3 = Ndlambe | elevation_m = | area_footnotes = <ref name=census2011>Main Places [http://census2011.adrianfrith.com/place/265008 Alexandria] le [http://census2011.adrianfrith.com/place/265009 KwaNonkqubela] ''Census 2011''.</ref> | area_total_km2 = 3.53 | population_footnotes = <ref name=census2011 /> | population_total = 5252 | population_as_of = 2011 <!-- demographics (section 1) --> | demographics1_footnotes = <ref name=census2011 /> | demographics_type1 = Ditlhopha tsa batho | demographics1_title1 = [[Bantsho]] | demographics1_info1 = 77.4% | demographics1_title2 = [[MaKhalathi]] | demographics1_info2 = 16.3% | demographics1_title3 = [[MaIndia]] | demographics1_info3 = 0.3% | demographics1_title4 = [[Basweu]] | demographics1_info4 = 5.2% | demographics1_title5 = Ba bangwe | demographics1_info5 = 0.8% <!-- demographics (section 2) --> | demographics2_footnotes = <ref name=census2011 /> | demographics_type2 = Maleme | demographics2_title1 = [[Sethosa]] | demographics2_info1 = 72.8% | demographics2_title2 = [[Afrikaans]] | demographics2_info2 = 20.3% | demographics2_title3 = [[Sekgoga]] | demographics2_info3 = 4.2% | demographics2_title4 = | demographics2_info4 = | demographics2_title5 = Other | demographics2_info5 = 2.7% | postal_code_type = Nomoro ya poso | postal_code = 6185 | area_code_type = Nomoro ya mogala | area_code = 046 }} '''Alexandria''' ke setoropo sa [[Kapa Botlhaba]] mo [[Aforika Borwa]]. ==Metswedi== {{Reflist}} ==Dikgolagano== f3gm39830060812xafy7b8k4xn93gr2 27132 27131 2022-07-31T06:02:11Z Rebel Agent 9072 /* Dikgolagano */Ke tsentse melaetsa wikitext text/x-wiki {{Infobox settlement | name = Alexandria | native_name = | other_name = | settlement_type = Toropo | pushpin_map = South Africa | pushpin_map_caption = | latd = 33 |latm = 39.2 |lats = |latNS=S | longd = 26 |longm = 24.5 |longs = | image_skyline = Alexandria Dutch Reformed Church.JPG | image_caption = The Dutch Reformed Church, a Provincial Heritage Site,<ref>{{cite web|title=9/2/005/0004- Dutch Reformed Church Voortrekker Street Alexandria|url=http://196.35.231.29/sahra/HeritageSitesDetail.aspx?id=21457|publisher=South African Heritage Resource Agency}}</ref> in Alexandria | subdivision_type = Naga | subdivision_name = [[Aforika Borwa]] | subdivision_type1 = Profense | subdivision_name1 = [[Kapa Botlhaba]] | subdivision_type2 = [[Districts tsa Aforika Borwa|Karolwana]] | subdivision_name2 = [[Karolwana sa Sarah Baartman|Sarah Baartman]] | subdivision_type3 = Masepala | subdivision_name3 = Ndlambe | elevation_m = | area_footnotes = <ref name=census2011>Main Places [http://census2011.adrianfrith.com/place/265008 Alexandria] le [http://census2011.adrianfrith.com/place/265009 KwaNonkqubela] ''Census 2011''.</ref> | area_total_km2 = 3.53 | population_footnotes = <ref name=census2011 /> | population_total = 5252 | population_as_of = 2011 <!-- demographics (section 1) --> | demographics1_footnotes = <ref name=census2011 /> | demographics_type1 = Ditlhopha tsa batho | demographics1_title1 = [[Bantsho]] | demographics1_info1 = 77.4% | demographics1_title2 = [[MaKhalathi]] | demographics1_info2 = 16.3% | demographics1_title3 = [[MaIndia]] | demographics1_info3 = 0.3% | demographics1_title4 = [[Basweu]] | demographics1_info4 = 5.2% | demographics1_title5 = Ba bangwe | demographics1_info5 = 0.8% <!-- demographics (section 2) --> | demographics2_footnotes = <ref name=census2011 /> | demographics_type2 = Maleme | demographics2_title1 = [[Sethosa]] | demographics2_info1 = 72.8% | demographics2_title2 = [[Afrikaans]] | demographics2_info2 = 20.3% | demographics2_title3 = [[Sekgoga]] | demographics2_info3 = 4.2% | demographics2_title4 = | demographics2_info4 = | demographics2_title5 = Other | demographics2_info5 = 2.7% | postal_code_type = Nomoro ya poso | postal_code = 6185 | area_code_type = Nomoro ya mogala | area_code = 046 }} '''Alexandria''' ke setoropo sa [[Kapa Botlhaba]] mo [[Aforika Borwa]]. ==Metswedi== {{Reflist}} ==Dikgolagano== {{Commons category|Alexandria, Eastern Cape}} {{Sarah Baartman District Municipality}} {{Authority control}} {{EasternCape-geo-stub}} nsxzl5h71xwwifcs9lr93fbe2jdf2jo 27153 27132 2022-07-31T07:27:48Z Rebel Agent 9072 /* Dikgolagano */Gongwe di tatla di dirwa morago, gompieno tla ke name ke dintshitse wikitext text/x-wiki {{Infobox settlement | name = Alexandria | native_name = | other_name = | settlement_type = Toropo | pushpin_map = South Africa | pushpin_map_caption = | latd = 33 |latm = 39.2 |lats = |latNS=S | longd = 26 |longm = 24.5 |longs = | image_skyline = Alexandria Dutch Reformed Church.JPG | image_caption = The Dutch Reformed Church, a Provincial Heritage Site,<ref>{{cite web|title=9/2/005/0004- Dutch Reformed Church Voortrekker Street Alexandria|url=http://196.35.231.29/sahra/HeritageSitesDetail.aspx?id=21457|publisher=South African Heritage Resource Agency}}</ref> in Alexandria | subdivision_type = Naga | subdivision_name = [[Aforika Borwa]] | subdivision_type1 = Profense | subdivision_name1 = [[Kapa Botlhaba]] | subdivision_type2 = [[Districts tsa Aforika Borwa|Karolwana]] | subdivision_name2 = [[Karolwana sa Sarah Baartman|Sarah Baartman]] | subdivision_type3 = Masepala | subdivision_name3 = Ndlambe | elevation_m = | area_footnotes = <ref name=census2011>Main Places [http://census2011.adrianfrith.com/place/265008 Alexandria] le [http://census2011.adrianfrith.com/place/265009 KwaNonkqubela] ''Census 2011''.</ref> | area_total_km2 = 3.53 | population_footnotes = <ref name=census2011 /> | population_total = 5252 | population_as_of = 2011 <!-- demographics (section 1) --> | demographics1_footnotes = <ref name=census2011 /> | demographics_type1 = Ditlhopha tsa batho | demographics1_title1 = [[Bantsho]] | demographics1_info1 = 77.4% | demographics1_title2 = [[MaKhalathi]] | demographics1_info2 = 16.3% | demographics1_title3 = [[MaIndia]] | demographics1_info3 = 0.3% | demographics1_title4 = [[Basweu]] | demographics1_info4 = 5.2% | demographics1_title5 = Ba bangwe | demographics1_info5 = 0.8% <!-- demographics (section 2) --> | demographics2_footnotes = <ref name=census2011 /> | demographics_type2 = Maleme | demographics2_title1 = [[Sethosa]] | demographics2_info1 = 72.8% | demographics2_title2 = [[Afrikaans]] | demographics2_info2 = 20.3% | demographics2_title3 = [[Sekgoga]] | demographics2_info3 = 4.2% | demographics2_title4 = | demographics2_info4 = | demographics2_title5 = Other | demographics2_info5 = 2.7% | postal_code_type = Nomoro ya poso | postal_code = 6185 | area_code_type = Nomoro ya mogala | area_code = 046 }} '''Alexandria''' ke setoropo sa [[Kapa Botlhaba]] mo [[Aforika Borwa]]. ==Metswedi== {{Reflist}} ==Dikgolagano== {{Commons category|Alexandria, Eastern Cape}} {{EasternCape-geo-stub}} [[Karolo:Mafelo]] 12dwpnxr3us1ju2ea0an8dzwcul0i4y Module:Asbox 828 6721 27146 25912 2022-07-31T06:54:37Z Rebel Agent 9072 Thanolo Scribunto text/plain --[[ This module was created by User:CodeHydro (Alexander Zhikun He). User:Jackmcbarn and User:Mr._Stradivarius provided a great deal of assistance in writting p.main() p.main() draw heavily from the following version of Template:Asbox of the English Wikipedia, authored primarily by User:Rich_Farmbrough https://en.wikipedia.org/w/index.php?title=Template:Asbox&oldid=619510287 p.templatepage() is derived from the following revision of Template:Asbox/templatepage, authored primarily by User:MSGJ https://en.wikipedia.org/w/index.php?title=Template:Asbox/templatepage&oldid=632914791 Both templates had significant contributions from numerous others listed in the revision history tab of their respective pages. --]] local WRAPPER_TEMPLATE, args = 'Template:Asbox' local templatestyles = 'Asbox/styles.css' local p, Buffer, stubCats = { --Prevents dupli-cats... get it? Maybe not? cats = setmetatable({}, {__newindex = function(t, i, v) if not rawget(t, i) then rawset(t, i, v) table.insert(t, i) end end}), --initializes variables required by both p.main and p.templatepage init = function(self, frame, page) args, page = args or require('Module:Arguments').getArgs(frame, { wrappers = WRAPPER_TEMPLATE }), page or mw.title.getCurrentTitle() --Ensures demo parameter will never affect category() output for articles self.demo = self.demo or page.namespace ~= 0 and args.demo return args, page end }, require('Module:Buffer') --[[ Formats category links. Stores them until called with cat.done=true Takes multiple or single categories in the form of 'cat' or a table of strings and/or tables containing parts. (See below) ]] local attention, catTag, catKey = Buffer'Stub message templates needing attention', '[[Category:%s]]', '%s|%s%s' local function category(cat) for _, v in ipairs((tostring(cat) == cat or cat.t) and {cat} or cat) do --[[ If v is a table: [1] = full category name; defaults to local attention if blank k = Category sort key. Prefix before v.t t = page.text or args.tempsort#; appended after k (or in its place if omitted). Required if v is not a string Basically the same as v = (v[1] or attention) .. ' | ' .. (v.k or '') .. v.t ]] if v and v ~= true then--reject v = nil, false, or true p.cats[catTag:format(tostring(v) == v and v or (v[1] and Buffer(v[1]) or attention):_in(v.k):_(v.t):_str(2, nil, nil, '|') )] = true end end return cat.done and table.concat(p.cats, p.demo and ' | ' or nil) or '' end --[[ Makes an ombox warning; Takes table {ifNot = Boolean, text, {cat. sort key, cat. sort name}} Will return an empty string instead when ifNot evaluates to true ]] local function ombox(v) if v.ifNot then return end p.ombox = p.ombox or require('Module:Message box').ombox category{v[2]} return p.ombox{ type = 'content', text = v[1] } end --[[ Unlike original template, module now takes unlimited cats! This function also performs most stub category error checks except for the ombox for when main |category= is omitted (See p.template()) ]] local function catStub(page, pageDoc) stubCats = {missing = {}, v = {}} -- zwj and zwnj have semantical use in other other wikis, don't remove them local zwj = '\226\128\141' -- U+200D, E2 80 8D local zwnj = '\226\128\140' -- U+200C, E2 80 8C local disallowedUnicodeChars = '[^%w%p%s' .. zwj .. zwnj .. ']' -- for i18n we make this a separate string local code for k, _ in pairs(args) do --Find category parameters and store the number (main cat = '') table.insert(stubCats, string.match(k, '^category(%d*)$')) end table.sort(stubCats) for k, v in ipairs(stubCats) do --Get category names and, if called by p.templatepage, the optional sort key local tsort, cat = args['tempsort' .. v], mw.ustring.gsub(args['category' .. v], disallowedUnicodeChars, '')--remove all hidden unicode chars --Do not place template in main category if |tempsort = 'no'. However, DO place articles of that template in the main category. table.insert(stubCats.v, page and (--p.templatepage passes page; p.main does not, i.e. articles are categorized without sort keys. v=='' and tsort == 'no'--if true, inserts 'true' in table, which category() will reject or tsort and {cat, k = ' ', t = tsort} or {cat, k = ' *', t = page.text}--note space in front of sort key ) or cat ) --Check category existance only if on the template page (i.e. stub documentation) if page then if not mw.title.new('Category:' .. cat).exists then code = code or mw.html.create'code':wikitext'|category' table.insert(stubCats.missing, tostring(mw.clone(code):wikitext(v))) end --[[ Checks non-demo stub template for documentation and flags if doc is present. All stub cats names are checked and flagged if it does not match 'Category: [] stub'. The main stub cat is exempt from the name check if the stub template has its own doc (presumably, this doc would have an explanation as to why the main stub cat is non-conforming). ]] table.insert(stubCats.v, v == '' and not p.demo and pageDoc.exists and 'Stub message templates with documentation subpages' or not cat:match' stubs$' and {k = 'S', t = page.text} ) end end --Add category names after loop is completed category(stubCats.v) return #stubCats.missing > 0 and ombox{ --Changed, original msg: --One or more of the stub categories defined in this template do not seem to exist! --Please double-check the parameters {{para|category}}, {{para|category1}} and {{para|category2}}. 'The following parameter' .. (#stubCats.missing == 1 and ' defines a stub category that does' or 's define stub categories that do') .. ' not exist: ' .. mw.text.listToText(stubCats.missing), {k = 'N', t = page.text} } end --Shows population of categories found by catStub(). Outputs demo values if none local function population() local wikitext, base = {}, '* [[:Category:%s]] (population: %s)\n' if not args.category and stubCats[1] ~= false then table.insert(stubCats, 1, false) end for _, v in ipairs(stubCats) do table.insert(wikitext, base:format( v and args['category' .. v] or '{{{category}}}', v and mw.site.stats.pagesInCategory(args['category' .. v], 'all') or 0 )) end return table.concat(wikitext) end --Includes standard stub documention and flags stub templates with bad parameter values. function p.templatepage(frame, page) args, page = p:init(frame, page) local tStubDoc = mw.title.new'Template:Stub documentation' local pageDoc = page:subPageTitle('doc') --Reorganization note: Original Asbox alternates between outputting categories and checking on params |category#=. --Rather than checking multiple times and switching tasks, all stub category param operations have been rolled into catStub() return Buffer( ombox{--Show ombox warnings for missing args. ifNot = args.category, 'The <code>|category</code> parameter is not set. Please add an appropriate stub category.', {k = 'C', t = page.text} }) :_(ombox{ ifNot = args.subject or args.article or args.qualifier, 'This stub template contains no description! At least one of the parameters <code>|subject</code>, <code>|article</code> or <code>|qualifier</code> must be defined.', {k = 'D', t = page.text} }) :_(catStub(page, pageDoc))--catStub() may also return an ombox if there are non-existing categories :_(category{ done = p.demo ~= 'doc',--Outputs categories if not doc demo 'Stub message templates', args.icon and 'Stub message templates using icon parameter' or args.image and ( mw.title.new('Media:' .. mw.text.split(args.image, '|')[1]).exists--do nothing if exists. category() will reject true or {k = 'B', t = page.text} ) or 'Stub message templates without images', args.imagealt and {k = 'I', t = page.text}, }) :_((not p.demo or p.demo == 'doc') and--Add standard stub template documentation require('Module:Documentation').main{ content = Buffer(page.text ~= 'Stub' and--This comparison performed in {{Asbox/stubtree}} before it invokes Module:Asbox stubtree require('Module:Asbox stubtree').subtree{args = {pagename = page.text}} ) :_in'\n== About this template ==\nThis template is used to identify a':_(args.subject):_'stub':_(args.qualifier):_out' '--space :_'. It uses {{[[Template:Asbox|asbox]]}}, which is a meta-template designed to ease the process of creating and maintaining stub templates.\n=== Usage ===\nTyping ' :_(mw.html.create'code' :wikitext('{{', page.text == 'Stub' and 'stub' or page.text, '}}') ) :_' produces the message shown at the beginning, and adds the article to the following categor' :_(#stubCats > 1 and 'ies' or 'y') :_':\n' :_(population()) :_(pageDoc.exists and--transclusion of /doc if it exists frame:expandTemplate{title = pageDoc.text} ) :_'\n== General information ==\n' :_(frame:expandTemplate{title = tStubDoc.text}) :_'\n\n'(), ['link box'] = Buffer'This documentation is automatically generated by [[Module:Asbox]].' :_in'The general information is transcluded from [[Template:Stub documentation]]. ' :_(mw.html.create'span' :cssText'font-size:smaller;font-style:normal;line-height:130%' :node(('([%s edit] | [%s history])'):format( tStubDoc:fullUrl('action=edit', 'relative'), tStubDoc:fullUrl('action=history', 'relative') )) ) :_out() :_(page.protectionLevels.edit and page.protectionLevels.edit[1] == 'sysop' and "This template is [[WP:PROTECT|fully protected]] and any [[WP:CAT|categories]] should be added to the template's [" .. pageDoc:fullUrl('action=edit&preload=Template:Category_interwiki/preload', 'relative') .. '| /doc] subpage, which is not protected.' )' <br/>' } )() end function p.main(frame, page) args, page = p:init(frame, page) local output = mw.html.create'div' :attr{role = 'note'} :addClass'metadata plainlinks asbox stub' :tag'table' :attr{role = 'presentation'} :tag'tr' :addClass'noresize' :node((args.icon or args.image) and mw.html.create'td' :wikitext(args.icon or ('[[File:%s|%spx|alt=%s]]'):format( args.image or '', args.pix or '40x30', args.imagealt or 'Stub icon' )) ) :tag'td' :tag'p' :addClass'asbox-body' :wikitext( Buffer'Tsebe':_(args.subject):_(args.article 'kana' 'pego'):_(args.qualifier)' ',--space ' e, e [[Wikipedia:Tsebe e nnyane|Nnyane]]. O ka thusa ka go e [', page:fullUrl('action=edit', 'relative'), ' oketsa].' ) :done() :node(args.note and mw.html.create() :tag'p' :addClass'asbox-note' :wikitext(args.note) :done() ) :allDone() :node(args.name and require'Module:Navbar'._navbar{ args.name, mini = 'yes', } ) --[[ Stub categories for templates include a sort key; this ensures that all stub tags appear at the beginning of their respective categories. Articles using the template do not need a sort key since they have unique names. When p.demo equals 'doc', the demo stub categories will appear as those for a stub template. Otherwise, any non-nil p.demo will emulate article space categories (plus any error cats unless set to 'art') ]] if page.namespace == 0 then -- Main namespace category'All stub articles' catStub() elseif p.demo then if p.demo ~= 'doc' then catStub() end --Unless p.demo is set to 'art', it will also include error categories normally only shown on --the template but not in the article. The elseif after namespace == 0 means demo cats will never show in article space. p.demodoc = p.demo ~= 'art' and p.templatepage(frame, page) output = mw.html.create() :node(output) :tag'small':wikitext( 'Demo categories: ', (category{done = true}:gsub('(%[%[)(Category:)([^|%]]-)(%|)', '%1%2%3|%2%3%4'):gsub('(%[%[)(Category:)', '%1:%2')) ):done() :wikitext(p.demo == 'doc' and p.demodoc or nil) else --Checks for valid name; emulates original template's check using {{FULLPAGENAME:{{{name|}}}}} local normalizedName = mw.title.new(args.name or '') if normalizedName and normalizedName.fullText == page.fullText then output = mw.html.create():node(output):wikitext(p.templatepage(frame, page)) elseif not page.isSubpage and page.namespace == 10 then-- Template namespace and not a subpage category{{k = args.name and 'E' or 'W', t = page.text}} end end return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(output:wikitext(not p.demo and category{done = true} or nil)) end return p ft0mcrwzcb4182s837et288y3dhz854 27147 27146 2022-07-31T06:57:16Z Rebel Agent 9072 Undo revision 27146 by [[Special:Contributions/Rebel Agent|Rebel Agent]] ([[User talk:Rebel Agent|talk]]) ga e bereke sentle Scribunto text/plain --[[ This module was created by User:CodeHydro (Alexander Zhikun He). User:Jackmcbarn and User:Mr._Stradivarius provided a great deal of assistance in writting p.main() p.main() draw heavily from the following version of Template:Asbox of the English Wikipedia, authored primarily by User:Rich_Farmbrough https://en.wikipedia.org/w/index.php?title=Template:Asbox&oldid=619510287 p.templatepage() is derived from the following revision of Template:Asbox/templatepage, authored primarily by User:MSGJ https://en.wikipedia.org/w/index.php?title=Template:Asbox/templatepage&oldid=632914791 Both templates had significant contributions from numerous others listed in the revision history tab of their respective pages. --]] local WRAPPER_TEMPLATE, args = 'Template:Asbox' local templatestyles = 'Asbox/styles.css' local p, Buffer, stubCats = { --Prevents dupli-cats... get it? Maybe not? cats = setmetatable({}, {__newindex = function(t, i, v) if not rawget(t, i) then rawset(t, i, v) table.insert(t, i) end end}), --initializes variables required by both p.main and p.templatepage init = function(self, frame, page) args, page = args or require('Module:Arguments').getArgs(frame, { wrappers = WRAPPER_TEMPLATE }), page or mw.title.getCurrentTitle() --Ensures demo parameter will never affect category() output for articles self.demo = self.demo or page.namespace ~= 0 and args.demo return args, page end }, require('Module:Buffer') --[[ Formats category links. Stores them until called with cat.done=true Takes multiple or single categories in the form of 'cat' or a table of strings and/or tables containing parts. (See below) ]] local attention, catTag, catKey = Buffer'Stub message templates needing attention', '[[Category:%s]]', '%s|%s%s' local function category(cat) for _, v in ipairs((tostring(cat) == cat or cat.t) and {cat} or cat) do --[[ If v is a table: [1] = full category name; defaults to local attention if blank k = Category sort key. Prefix before v.t t = page.text or args.tempsort#; appended after k (or in its place if omitted). Required if v is not a string Basically the same as v = (v[1] or attention) .. ' | ' .. (v.k or '') .. v.t ]] if v and v ~= true then--reject v = nil, false, or true p.cats[catTag:format(tostring(v) == v and v or (v[1] and Buffer(v[1]) or attention):_in(v.k):_(v.t):_str(2, nil, nil, '|') )] = true end end return cat.done and table.concat(p.cats, p.demo and ' | ' or nil) or '' end --[[ Makes an ombox warning; Takes table {ifNot = Boolean, text, {cat. sort key, cat. sort name}} Will return an empty string instead when ifNot evaluates to true ]] local function ombox(v) if v.ifNot then return end p.ombox = p.ombox or require('Module:Message box').ombox category{v[2]} return p.ombox{ type = 'content', text = v[1] } end --[[ Unlike original template, module now takes unlimited cats! This function also performs most stub category error checks except for the ombox for when main |category= is omitted (See p.template()) ]] local function catStub(page, pageDoc) stubCats = {missing = {}, v = {}} -- zwj and zwnj have semantical use in other other wikis, don't remove them local zwj = '\226\128\141' -- U+200D, E2 80 8D local zwnj = '\226\128\140' -- U+200C, E2 80 8C local disallowedUnicodeChars = '[^%w%p%s' .. zwj .. zwnj .. ']' -- for i18n we make this a separate string local code for k, _ in pairs(args) do --Find category parameters and store the number (main cat = '') table.insert(stubCats, string.match(k, '^category(%d*)$')) end table.sort(stubCats) for k, v in ipairs(stubCats) do --Get category names and, if called by p.templatepage, the optional sort key local tsort, cat = args['tempsort' .. v], mw.ustring.gsub(args['category' .. v], disallowedUnicodeChars, '')--remove all hidden unicode chars --Do not place template in main category if |tempsort = 'no'. However, DO place articles of that template in the main category. table.insert(stubCats.v, page and (--p.templatepage passes page; p.main does not, i.e. articles are categorized without sort keys. v=='' and tsort == 'no'--if true, inserts 'true' in table, which category() will reject or tsort and {cat, k = ' ', t = tsort} or {cat, k = ' *', t = page.text}--note space in front of sort key ) or cat ) --Check category existance only if on the template page (i.e. stub documentation) if page then if not mw.title.new('Category:' .. cat).exists then code = code or mw.html.create'code':wikitext'|category' table.insert(stubCats.missing, tostring(mw.clone(code):wikitext(v))) end --[[ Checks non-demo stub template for documentation and flags if doc is present. All stub cats names are checked and flagged if it does not match 'Category: [] stub'. The main stub cat is exempt from the name check if the stub template has its own doc (presumably, this doc would have an explanation as to why the main stub cat is non-conforming). ]] table.insert(stubCats.v, v == '' and not p.demo and pageDoc.exists and 'Stub message templates with documentation subpages' or not cat:match' stubs$' and {k = 'S', t = page.text} ) end end --Add category names after loop is completed category(stubCats.v) return #stubCats.missing > 0 and ombox{ --Changed, original msg: --One or more of the stub categories defined in this template do not seem to exist! --Please double-check the parameters {{para|category}}, {{para|category1}} and {{para|category2}}. 'The following parameter' .. (#stubCats.missing == 1 and ' defines a stub category that does' or 's define stub categories that do') .. ' not exist: ' .. mw.text.listToText(stubCats.missing), {k = 'N', t = page.text} } end --Shows population of categories found by catStub(). Outputs demo values if none local function population() local wikitext, base = {}, '* [[:Category:%s]] (population: %s)\n' if not args.category and stubCats[1] ~= false then table.insert(stubCats, 1, false) end for _, v in ipairs(stubCats) do table.insert(wikitext, base:format( v and args['category' .. v] or '{{{category}}}', v and mw.site.stats.pagesInCategory(args['category' .. v], 'all') or 0 )) end return table.concat(wikitext) end --Includes standard stub documention and flags stub templates with bad parameter values. function p.templatepage(frame, page) args, page = p:init(frame, page) local tStubDoc = mw.title.new'Template:Stub documentation' local pageDoc = page:subPageTitle('doc') --Reorganization note: Original Asbox alternates between outputting categories and checking on params |category#=. --Rather than checking multiple times and switching tasks, all stub category param operations have been rolled into catStub() return Buffer( ombox{--Show ombox warnings for missing args. ifNot = args.category, 'The <code>|category</code> parameter is not set. Please add an appropriate stub category.', {k = 'C', t = page.text} }) :_(ombox{ ifNot = args.subject or args.article or args.qualifier, 'This stub template contains no description! At least one of the parameters <code>|subject</code>, <code>|article</code> or <code>|qualifier</code> must be defined.', {k = 'D', t = page.text} }) :_(catStub(page, pageDoc))--catStub() may also return an ombox if there are non-existing categories :_(category{ done = p.demo ~= 'doc',--Outputs categories if not doc demo 'Stub message templates', args.icon and 'Stub message templates using icon parameter' or args.image and ( mw.title.new('Media:' .. mw.text.split(args.image, '|')[1]).exists--do nothing if exists. category() will reject true or {k = 'B', t = page.text} ) or 'Stub message templates without images', args.imagealt and {k = 'I', t = page.text}, }) :_((not p.demo or p.demo == 'doc') and--Add standard stub template documentation require('Module:Documentation').main{ content = Buffer(page.text ~= 'Stub' and--This comparison performed in {{Asbox/stubtree}} before it invokes Module:Asbox stubtree require('Module:Asbox stubtree').subtree{args = {pagename = page.text}} ) :_in'\n== About this template ==\nThis template is used to identify a':_(args.subject):_'stub':_(args.qualifier):_out' '--space :_'. It uses {{[[Template:Asbox|asbox]]}}, which is a meta-template designed to ease the process of creating and maintaining stub templates.\n=== Usage ===\nTyping ' :_(mw.html.create'code' :wikitext('{{', page.text == 'Stub' and 'stub' or page.text, '}}') ) :_' produces the message shown at the beginning, and adds the article to the following categor' :_(#stubCats > 1 and 'ies' or 'y') :_':\n' :_(population()) :_(pageDoc.exists and--transclusion of /doc if it exists frame:expandTemplate{title = pageDoc.text} ) :_'\n== General information ==\n' :_(frame:expandTemplate{title = tStubDoc.text}) :_'\n\n'(), ['link box'] = Buffer'This documentation is automatically generated by [[Module:Asbox]].' :_in'The general information is transcluded from [[Template:Stub documentation]]. ' :_(mw.html.create'span' :cssText'font-size:smaller;font-style:normal;line-height:130%' :node(('([%s edit] | [%s history])'):format( tStubDoc:fullUrl('action=edit', 'relative'), tStubDoc:fullUrl('action=history', 'relative') )) ) :_out() :_(page.protectionLevels.edit and page.protectionLevels.edit[1] == 'sysop' and "This template is [[WP:PROTECT|fully protected]] and any [[WP:CAT|categories]] should be added to the template's [" .. pageDoc:fullUrl('action=edit&preload=Template:Category_interwiki/preload', 'relative') .. '| /doc] subpage, which is not protected.' )' <br/>' } )() end function p.main(frame, page) args, page = p:init(frame, page) local output = mw.html.create'div' :attr{role = 'note'} :addClass'metadata plainlinks asbox stub' :tag'table' :attr{role = 'presentation'} :tag'tr' :addClass'noresize' :node((args.icon or args.image) and mw.html.create'td' :wikitext(args.icon or ('[[File:%s|%spx|alt=%s]]'):format( args.image or '', args.pix or '40x30', args.imagealt or 'Stub icon' )) ) :tag'td' :tag'p' :addClass'asbox-body' :wikitext( Buffer'This':_(args.subject):_(args.article or 'article'):_(args.qualifier)' ',--space ' is a [[Wikipedia:stub|stub]]. You can help Wikipedia by [', page:fullUrl('action=edit', 'relative'), ' expanding it].' ) :done() :node(args.note and mw.html.create() :tag'p' :addClass'asbox-note' :wikitext(args.note) :done() ) :allDone() :node(args.name and require'Module:Navbar'._navbar{ args.name, mini = 'yes', } ) --[[ Stub categories for templates include a sort key; this ensures that all stub tags appear at the beginning of their respective categories. Articles using the template do not need a sort key since they have unique names. When p.demo equals 'doc', the demo stub categories will appear as those for a stub template. Otherwise, any non-nil p.demo will emulate article space categories (plus any error cats unless set to 'art') ]] if page.namespace == 0 then -- Main namespace category'All stub articles' catStub() elseif p.demo then if p.demo ~= 'doc' then catStub() end --Unless p.demo is set to 'art', it will also include error categories normally only shown on --the template but not in the article. The elseif after namespace == 0 means demo cats will never show in article space. p.demodoc = p.demo ~= 'art' and p.templatepage(frame, page) output = mw.html.create() :node(output) :tag'small':wikitext( 'Demo categories: ', (category{done = true}:gsub('(%[%[)(Category:)([^|%]]-)(%|)', '%1%2%3|%2%3%4'):gsub('(%[%[)(Category:)', '%1:%2')) ):done() :wikitext(p.demo == 'doc' and p.demodoc or nil) else --Checks for valid name; emulates original template's check using {{FULLPAGENAME:{{{name|}}}}} local normalizedName = mw.title.new(args.name or '') if normalizedName and normalizedName.fullText == page.fullText then output = mw.html.create():node(output):wikitext(p.templatepage(frame, page)) elseif not page.isSubpage and page.namespace == 10 then-- Template namespace and not a subpage category{{k = args.name and 'E' or 'W', t = page.text}} end end return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(output:wikitext(not p.demo and category{done = true} or nil)) end return p 18jy1or6fzutqp3z3eusrstkz7liymn 27148 27147 2022-07-31T07:03:48Z Rebel Agent 9072 Trying to translate this module Scribunto text/plain --[[ This module was created by User:CodeHydro (Alexander Zhikun He). User:Jackmcbarn and User:Mr._Stradivarius provided a great deal of assistance in writting p.main() p.main() draw heavily from the following version of Template:Asbox of the English Wikipedia, authored primarily by User:Rich_Farmbrough https://en.wikipedia.org/w/index.php?title=Template:Asbox&oldid=619510287 p.templatepage() is derived from the following revision of Template:Asbox/templatepage, authored primarily by User:MSGJ https://en.wikipedia.org/w/index.php?title=Template:Asbox/templatepage&oldid=632914791 Both templates had significant contributions from numerous others listed in the revision history tab of their respective pages. --]] local WRAPPER_TEMPLATE, args = 'Template:Asbox' local templatestyles = 'Asbox/styles.css' local p, Buffer, stubCats = { --Prevents dupli-cats... get it? Maybe not? cats = setmetatable({}, {__newindex = function(t, i, v) if not rawget(t, i) then rawset(t, i, v) table.insert(t, i) end end}), --initializes variables required by both p.main and p.templatepage init = function(self, frame, page) args, page = args or require('Module:Arguments').getArgs(frame, { wrappers = WRAPPER_TEMPLATE }), page or mw.title.getCurrentTitle() --Ensures demo parameter will never affect category() output for articles self.demo = self.demo or page.namespace ~= 0 and args.demo return args, page end }, require('Module:Buffer') --[[ Formats category links. Stores them until called with cat.done=true Takes multiple or single categories in the form of 'cat' or a table of strings and/or tables containing parts. (See below) ]] local attention, catTag, catKey = Buffer'Stub message templates needing attention', '[[Category:%s]]', '%s|%s%s' local function category(cat) for _, v in ipairs((tostring(cat) == cat or cat.t) and {cat} or cat) do --[[ If v is a table: [1] = full category name; defaults to local attention if blank k = Category sort key. Prefix before v.t t = page.text or args.tempsort#; appended after k (or in its place if omitted). Required if v is not a string Basically the same as v = (v[1] or attention) .. ' | ' .. (v.k or '') .. v.t ]] if v and v ~= true then--reject v = nil, false, or true p.cats[catTag:format(tostring(v) == v and v or (v[1] and Buffer(v[1]) or attention):_in(v.k):_(v.t):_str(2, nil, nil, '|') )] = true end end return cat.done and table.concat(p.cats, p.demo and ' | ' or nil) or '' end --[[ Makes an ombox warning; Takes table {ifNot = Boolean, text, {cat. sort key, cat. sort name}} Will return an empty string instead when ifNot evaluates to true ]] local function ombox(v) if v.ifNot then return end p.ombox = p.ombox or require('Module:Message box').ombox category{v[2]} return p.ombox{ type = 'content', text = v[1] } end --[[ Unlike original template, module now takes unlimited cats! This function also performs most stub category error checks except for the ombox for when main |category= is omitted (See p.template()) ]] local function catStub(page, pageDoc) stubCats = {missing = {}, v = {}} -- zwj and zwnj have semantical use in other other wikis, don't remove them local zwj = '\226\128\141' -- U+200D, E2 80 8D local zwnj = '\226\128\140' -- U+200C, E2 80 8C local disallowedUnicodeChars = '[^%w%p%s' .. zwj .. zwnj .. ']' -- for i18n we make this a separate string local code for k, _ in pairs(args) do --Find category parameters and store the number (main cat = '') table.insert(stubCats, string.match(k, '^category(%d*)$')) end table.sort(stubCats) for k, v in ipairs(stubCats) do --Get category names and, if called by p.templatepage, the optional sort key local tsort, cat = args['tempsort' .. v], mw.ustring.gsub(args['category' .. v], disallowedUnicodeChars, '')--remove all hidden unicode chars --Do not place template in main category if |tempsort = 'no'. However, DO place articles of that template in the main category. table.insert(stubCats.v, page and (--p.templatepage passes page; p.main does not, i.e. articles are categorized without sort keys. v=='' and tsort == 'no'--if true, inserts 'true' in table, which category() will reject or tsort and {cat, k = ' ', t = tsort} or {cat, k = ' *', t = page.text}--note space in front of sort key ) or cat ) --Check category existance only if on the template page (i.e. stub documentation) if page then if not mw.title.new('Category:' .. cat).exists then code = code or mw.html.create'code':wikitext'|category' table.insert(stubCats.missing, tostring(mw.clone(code):wikitext(v))) end --[[ Checks non-demo stub template for documentation and flags if doc is present. All stub cats names are checked and flagged if it does not match 'Category: [] stub'. The main stub cat is exempt from the name check if the stub template has its own doc (presumably, this doc would have an explanation as to why the main stub cat is non-conforming). ]] table.insert(stubCats.v, v == '' and not p.demo and pageDoc.exists and 'Stub message templates with documentation subpages' or not cat:match' stubs$' and {k = 'S', t = page.text} ) end end --Add category names after loop is completed category(stubCats.v) return #stubCats.missing > 0 and ombox{ --Changed, original msg: --One or more of the stub categories defined in this template do not seem to exist! --Please double-check the parameters {{para|category}}, {{para|category1}} and {{para|category2}}. 'The following parameter' .. (#stubCats.missing == 1 and ' defines a stub category that does' or 's define stub categories that do') .. ' not exist: ' .. mw.text.listToText(stubCats.missing), {k = 'N', t = page.text} } end --Shows population of categories found by catStub(). Outputs demo values if none local function population() local wikitext, base = {}, '* [[:Category:%s]] (population: %s)\n' if not args.category and stubCats[1] ~= false then table.insert(stubCats, 1, false) end for _, v in ipairs(stubCats) do table.insert(wikitext, base:format( v and args['category' .. v] or '{{{category}}}', v and mw.site.stats.pagesInCategory(args['category' .. v], 'all') or 0 )) end return table.concat(wikitext) end --Includes standard stub documention and flags stub templates with bad parameter values. function p.templatepage(frame, page) args, page = p:init(frame, page) local tStubDoc = mw.title.new'Template:Stub documentation' local pageDoc = page:subPageTitle('doc') --Reorganization note: Original Asbox alternates between outputting categories and checking on params |category#=. --Rather than checking multiple times and switching tasks, all stub category param operations have been rolled into catStub() return Buffer( ombox{--Show ombox warnings for missing args. ifNot = args.category, 'The <code>|category</code> parameter is not set. Please add an appropriate stub category.', {k = 'C', t = page.text} }) :_(ombox{ ifNot = args.subject or args.article or args.qualifier, 'This stub template contains no description! At least one of the parameters <code>|subject</code>, <code>|article</code> or <code>|qualifier</code> must be defined.', {k = 'D', t = page.text} }) :_(catStub(page, pageDoc))--catStub() may also return an ombox if there are non-existing categories :_(category{ done = p.demo ~= 'doc',--Outputs categories if not doc demo 'Stub message templates', args.icon and 'Stub message templates using icon parameter' or args.image and ( mw.title.new('Media:' .. mw.text.split(args.image, '|')[1]).exists--do nothing if exists. category() will reject true or {k = 'B', t = page.text} ) or 'Stub message templates without images', args.imagealt and {k = 'I', t = page.text}, }) :_((not p.demo or p.demo == 'doc') and--Add standard stub template documentation require('Module:Documentation').main{ content = Buffer(page.text ~= 'Stub' and--This comparison performed in {{Asbox/stubtree}} before it invokes Module:Asbox stubtree require('Module:Asbox stubtree').subtree{args = {pagename = page.text}} ) :_in'\n== About this template ==\nThis template is used to identify a':_(args.subject):_'stub':_(args.qualifier):_out' '--space :_'. It uses {{[[Template:Asbox|asbox]]}}, which is a meta-template designed to ease the process of creating and maintaining stub templates.\n=== Usage ===\nTyping ' :_(mw.html.create'code' :wikitext('{{', page.text == 'Stub' and 'stub' or page.text, '}}') ) :_' produces the message shown at the beginning, and adds the article to the following categor' :_(#stubCats > 1 and 'ies' or 'y') :_':\n' :_(population()) :_(pageDoc.exists and--transclusion of /doc if it exists frame:expandTemplate{title = pageDoc.text} ) :_'\n== General information ==\n' :_(frame:expandTemplate{title = tStubDoc.text}) :_'\n\n'(), ['link box'] = Buffer'This documentation is automatically generated by [[Module:Asbox]].' :_in'The general information is transcluded from [[Template:Stub documentation]]. ' :_(mw.html.create'span' :cssText'font-size:smaller;font-style:normal;line-height:130%' :node(('([%s edit] | [%s history])'):format( tStubDoc:fullUrl('action=edit', 'relative'), tStubDoc:fullUrl('action=history', 'relative') )) ) :_out() :_(page.protectionLevels.edit and page.protectionLevels.edit[1] == 'sysop' and "This template is [[WP:PROTECT|fully protected]] and any [[WP:CAT|categories]] should be added to the template's [" .. pageDoc:fullUrl('action=edit&preload=Template:Category_interwiki/preload', 'relative') .. '| /doc] subpage, which is not protected.' )' <br/>' } )() end function p.main(frame, page) args, page = p:init(frame, page) local output = mw.html.create'div' :attr{role = 'note'} :addClass'metadata plainlinks asbox stub' :tag'table' :attr{role = 'presentation'} :tag'tr' :addClass'noresize' :node((args.icon or args.image) and mw.html.create'td' :wikitext(args.icon or ('[[File:%s|%spx|alt=%s]]'):format( args.image or '', args.pix or '40x30', args.imagealt or 'Stub icon' )) ) :tag'td' :tag'p' :addClass'asbox-body' :wikitext( Buffer'Pego':_(args.subject):_(args.tsebe or 'tsebe'):_(args.qualifier)' ',--space ' e [[Wikipedia:stub|Nnyane]]. O ka thusa Wikipedia kago [', page:fullUrl('action=edit', 'relative'), ' e oketsa].' ) :done() :node(args.note and mw.html.create() :tag'p' :addClass'asbox-note' :wikitext(args.note) :done() ) :allDone() :node(args.name and require'Module:Navbar'._navbar{ args.name, mini = 'yes', } ) --[[ Stub categories for templates include a sort key; this ensures that all stub tags appear at the beginning of their respective categories. Articles using the template do not need a sort key since they have unique names. When p.demo equals 'doc', the demo stub categories will appear as those for a stub template. Otherwise, any non-nil p.demo will emulate article space categories (plus any error cats unless set to 'art') ]] if page.namespace == 0 then -- Main namespace category'All stub articles' catStub() elseif p.demo then if p.demo ~= 'doc' then catStub() end --Unless p.demo is set to 'art', it will also include error categories normally only shown on --the template but not in the article. The elseif after namespace == 0 means demo cats will never show in article space. p.demodoc = p.demo ~= 'art' and p.templatepage(frame, page) output = mw.html.create() :node(output) :tag'small':wikitext( 'Demo categories: ', (category{done = true}:gsub('(%[%[)(Category:)([^|%]]-)(%|)', '%1%2%3|%2%3%4'):gsub('(%[%[)(Category:)', '%1:%2')) ):done() :wikitext(p.demo == 'doc' and p.demodoc or nil) else --Checks for valid name; emulates original template's check using {{FULLPAGENAME:{{{name|}}}}} local normalizedName = mw.title.new(args.name or '') if normalizedName and normalizedName.fullText == page.fullText then output = mw.html.create():node(output):wikitext(p.templatepage(frame, page)) elseif not page.isSubpage and page.namespace == 10 then-- Template namespace and not a subpage category{{k = args.name and 'E' or 'W', t = page.text}} end end return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(output:wikitext(not p.demo and category{done = true} or nil)) end return p bfumijybpk2piwwc5gdlrb21e9yoi8s 27149 27148 2022-07-31T07:09:19Z Rebel Agent 9072 Ke baakantse thanolo Scribunto text/plain --[[ This module was created by User:CodeHydro (Alexander Zhikun He). User:Jackmcbarn and User:Mr._Stradivarius provided a great deal of assistance in writting p.main() p.main() draw heavily from the following version of Template:Asbox of the English Wikipedia, authored primarily by User:Rich_Farmbrough https://en.wikipedia.org/w/index.php?title=Template:Asbox&oldid=619510287 p.templatepage() is derived from the following revision of Template:Asbox/templatepage, authored primarily by User:MSGJ https://en.wikipedia.org/w/index.php?title=Template:Asbox/templatepage&oldid=632914791 Both templates had significant contributions from numerous others listed in the revision history tab of their respective pages. --]] local WRAPPER_TEMPLATE, args = 'Template:Asbox' local templatestyles = 'Asbox/styles.css' local p, Buffer, stubCats = { --Prevents dupli-cats... get it? Maybe not? cats = setmetatable({}, {__newindex = function(t, i, v) if not rawget(t, i) then rawset(t, i, v) table.insert(t, i) end end}), --initializes variables required by both p.main and p.templatepage init = function(self, frame, page) args, page = args or require('Module:Arguments').getArgs(frame, { wrappers = WRAPPER_TEMPLATE }), page or mw.title.getCurrentTitle() --Ensures demo parameter will never affect category() output for articles self.demo = self.demo or page.namespace ~= 0 and args.demo return args, page end }, require('Module:Buffer') --[[ Formats category links. Stores them until called with cat.done=true Takes multiple or single categories in the form of 'cat' or a table of strings and/or tables containing parts. (See below) ]] local attention, catTag, catKey = Buffer'Stub message templates needing attention', '[[Category:%s]]', '%s|%s%s' local function category(cat) for _, v in ipairs((tostring(cat) == cat or cat.t) and {cat} or cat) do --[[ If v is a table: [1] = full category name; defaults to local attention if blank k = Category sort key. Prefix before v.t t = page.text or args.tempsort#; appended after k (or in its place if omitted). Required if v is not a string Basically the same as v = (v[1] or attention) .. ' | ' .. (v.k or '') .. v.t ]] if v and v ~= true then--reject v = nil, false, or true p.cats[catTag:format(tostring(v) == v and v or (v[1] and Buffer(v[1]) or attention):_in(v.k):_(v.t):_str(2, nil, nil, '|') )] = true end end return cat.done and table.concat(p.cats, p.demo and ' | ' or nil) or '' end --[[ Makes an ombox warning; Takes table {ifNot = Boolean, text, {cat. sort key, cat. sort name}} Will return an empty string instead when ifNot evaluates to true ]] local function ombox(v) if v.ifNot then return end p.ombox = p.ombox or require('Module:Message box').ombox category{v[2]} return p.ombox{ type = 'content', text = v[1] } end --[[ Unlike original template, module now takes unlimited cats! This function also performs most stub category error checks except for the ombox for when main |category= is omitted (See p.template()) ]] local function catStub(page, pageDoc) stubCats = {missing = {}, v = {}} -- zwj and zwnj have semantical use in other other wikis, don't remove them local zwj = '\226\128\141' -- U+200D, E2 80 8D local zwnj = '\226\128\140' -- U+200C, E2 80 8C local disallowedUnicodeChars = '[^%w%p%s' .. zwj .. zwnj .. ']' -- for i18n we make this a separate string local code for k, _ in pairs(args) do --Find category parameters and store the number (main cat = '') table.insert(stubCats, string.match(k, '^category(%d*)$')) end table.sort(stubCats) for k, v in ipairs(stubCats) do --Get category names and, if called by p.templatepage, the optional sort key local tsort, cat = args['tempsort' .. v], mw.ustring.gsub(args['category' .. v], disallowedUnicodeChars, '')--remove all hidden unicode chars --Do not place template in main category if |tempsort = 'no'. However, DO place articles of that template in the main category. table.insert(stubCats.v, page and (--p.templatepage passes page; p.main does not, i.e. articles are categorized without sort keys. v=='' and tsort == 'no'--if true, inserts 'true' in table, which category() will reject or tsort and {cat, k = ' ', t = tsort} or {cat, k = ' *', t = page.text}--note space in front of sort key ) or cat ) --Check category existance only if on the template page (i.e. stub documentation) if page then if not mw.title.new('Category:' .. cat).exists then code = code or mw.html.create'code':wikitext'|category' table.insert(stubCats.missing, tostring(mw.clone(code):wikitext(v))) end --[[ Checks non-demo stub template for documentation and flags if doc is present. All stub cats names are checked and flagged if it does not match 'Category: [] stub'. The main stub cat is exempt from the name check if the stub template has its own doc (presumably, this doc would have an explanation as to why the main stub cat is non-conforming). ]] table.insert(stubCats.v, v == '' and not p.demo and pageDoc.exists and 'Stub message templates with documentation subpages' or not cat:match' stubs$' and {k = 'S', t = page.text} ) end end --Add category names after loop is completed category(stubCats.v) return #stubCats.missing > 0 and ombox{ --Changed, original msg: --One or more of the stub categories defined in this template do not seem to exist! --Please double-check the parameters {{para|category}}, {{para|category1}} and {{para|category2}}. 'The following parameter' .. (#stubCats.missing == 1 and ' defines a stub category that does' or 's define stub categories that do') .. ' not exist: ' .. mw.text.listToText(stubCats.missing), {k = 'N', t = page.text} } end --Shows population of categories found by catStub(). Outputs demo values if none local function population() local wikitext, base = {}, '* [[:Category:%s]] (population: %s)\n' if not args.category and stubCats[1] ~= false then table.insert(stubCats, 1, false) end for _, v in ipairs(stubCats) do table.insert(wikitext, base:format( v and args['category' .. v] or '{{{category}}}', v and mw.site.stats.pagesInCategory(args['category' .. v], 'all') or 0 )) end return table.concat(wikitext) end --Includes standard stub documention and flags stub templates with bad parameter values. function p.templatepage(frame, page) args, page = p:init(frame, page) local tStubDoc = mw.title.new'Template:Stub documentation' local pageDoc = page:subPageTitle('doc') --Reorganization note: Original Asbox alternates between outputting categories and checking on params |category#=. --Rather than checking multiple times and switching tasks, all stub category param operations have been rolled into catStub() return Buffer( ombox{--Show ombox warnings for missing args. ifNot = args.category, 'The <code>|category</code> parameter is not set. Please add an appropriate stub category.', {k = 'C', t = page.text} }) :_(ombox{ ifNot = args.subject or args.article or args.qualifier, 'This stub template contains no description! At least one of the parameters <code>|subject</code>, <code>|article</code> or <code>|qualifier</code> must be defined.', {k = 'D', t = page.text} }) :_(catStub(page, pageDoc))--catStub() may also return an ombox if there are non-existing categories :_(category{ done = p.demo ~= 'doc',--Outputs categories if not doc demo 'Stub message templates', args.icon and 'Stub message templates using icon parameter' or args.image and ( mw.title.new('Media:' .. mw.text.split(args.image, '|')[1]).exists--do nothing if exists. category() will reject true or {k = 'B', t = page.text} ) or 'Stub message templates without images', args.imagealt and {k = 'I', t = page.text}, }) :_((not p.demo or p.demo == 'doc') and--Add standard stub template documentation require('Module:Documentation').main{ content = Buffer(page.text ~= 'Stub' and--This comparison performed in {{Asbox/stubtree}} before it invokes Module:Asbox stubtree require('Module:Asbox stubtree').subtree{args = {pagename = page.text}} ) :_in'\n== About this template ==\nThis template is used to identify a':_(args.subject):_'stub':_(args.qualifier):_out' '--space :_'. It uses {{[[Template:Asbox|asbox]]}}, which is a meta-template designed to ease the process of creating and maintaining stub templates.\n=== Usage ===\nTyping ' :_(mw.html.create'code' :wikitext('{{', page.text == 'Stub' and 'stub' or page.text, '}}') ) :_' produces the message shown at the beginning, and adds the article to the following categor' :_(#stubCats > 1 and 'ies' or 'y') :_':\n' :_(population()) :_(pageDoc.exists and--transclusion of /doc if it exists frame:expandTemplate{title = pageDoc.text} ) :_'\n== General information ==\n' :_(frame:expandTemplate{title = tStubDoc.text}) :_'\n\n'(), ['link box'] = Buffer'This documentation is automatically generated by [[Module:Asbox]].' :_in'The general information is transcluded from [[Template:Stub documentation]]. ' :_(mw.html.create'span' :cssText'font-size:smaller;font-style:normal;line-height:130%' :node(('([%s edit] | [%s history])'):format( tStubDoc:fullUrl('action=edit', 'relative'), tStubDoc:fullUrl('action=history', 'relative') )) ) :_out() :_(page.protectionLevels.edit and page.protectionLevels.edit[1] == 'sysop' and "This template is [[WP:PROTECT|fully protected]] and any [[WP:CAT|categories]] should be added to the template's [" .. pageDoc:fullUrl('action=edit&preload=Template:Category_interwiki/preload', 'relative') .. '| /doc] subpage, which is not protected.' )' <br/>' } )() end function p.main(frame, page) args, page = p:init(frame, page) local output = mw.html.create'div' :attr{role = 'note'} :addClass'metadata plainlinks asbox stub' :tag'table' :attr{role = 'presentation'} :tag'tr' :addClass'noresize' :node((args.icon or args.image) and mw.html.create'td' :wikitext(args.icon or ('[[File:%s|%spx|alt=%s]]'):format( args.image or '', args.pix or '40x30', args.imagealt or 'Stub icon' )) ) :tag'td' :tag'p' :addClass'asbox-body' :wikitext( Buffer'Pego e ya':_(args.subject):_(args.kana or 'kana tsebe e' ):_(args.qualifier)' ',--space ' e [[Wikipedia:stub|Nnyane]]. O ka thusa Wikipedia kago [', page:fullUrl('action=edit', 'relative'), ' e oketsa].' ) :done() :node(args.note and mw.html.create() :tag'p' :addClass'asbox-note' :wikitext(args.note) :done() ) :allDone() :node(args.name and require'Module:Navbar'._navbar{ args.name, mini = 'yes', } ) --[[ Stub categories for templates include a sort key; this ensures that all stub tags appear at the beginning of their respective categories. Articles using the template do not need a sort key since they have unique names. When p.demo equals 'doc', the demo stub categories will appear as those for a stub template. Otherwise, any non-nil p.demo will emulate article space categories (plus any error cats unless set to 'art') ]] if page.namespace == 0 then -- Main namespace category'All stub articles' catStub() elseif p.demo then if p.demo ~= 'doc' then catStub() end --Unless p.demo is set to 'art', it will also include error categories normally only shown on --the template but not in the article. The elseif after namespace == 0 means demo cats will never show in article space. p.demodoc = p.demo ~= 'art' and p.templatepage(frame, page) output = mw.html.create() :node(output) :tag'small':wikitext( 'Demo categories: ', (category{done = true}:gsub('(%[%[)(Category:)([^|%]]-)(%|)', '%1%2%3|%2%3%4'):gsub('(%[%[)(Category:)', '%1:%2')) ):done() :wikitext(p.demo == 'doc' and p.demodoc or nil) else --Checks for valid name; emulates original template's check using {{FULLPAGENAME:{{{name|}}}}} local normalizedName = mw.title.new(args.name or '') if normalizedName and normalizedName.fullText == page.fullText then output = mw.html.create():node(output):wikitext(p.templatepage(frame, page)) elseif not page.isSubpage and page.namespace == 10 then-- Template namespace and not a subpage category{{k = args.name and 'E' or 'W', t = page.text}} end end return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(output:wikitext(not p.demo and category{done = true} or nil)) end return p iwbk79kl00aurik8blj99k31zhb55nl 27151 27149 2022-07-31T07:16:42Z Rebel Agent 9072 Protected "[[Module:Asbox]]": Go isereletsa mo tshenyong ([Fetola=Allow only administrators] (indefinite) [Sutisa=Allow only administrators] (indefinite)) [cascading] Scribunto text/plain --[[ This module was created by User:CodeHydro (Alexander Zhikun He). User:Jackmcbarn and User:Mr._Stradivarius provided a great deal of assistance in writting p.main() p.main() draw heavily from the following version of Template:Asbox of the English Wikipedia, authored primarily by User:Rich_Farmbrough https://en.wikipedia.org/w/index.php?title=Template:Asbox&oldid=619510287 p.templatepage() is derived from the following revision of Template:Asbox/templatepage, authored primarily by User:MSGJ https://en.wikipedia.org/w/index.php?title=Template:Asbox/templatepage&oldid=632914791 Both templates had significant contributions from numerous others listed in the revision history tab of their respective pages. --]] local WRAPPER_TEMPLATE, args = 'Template:Asbox' local templatestyles = 'Asbox/styles.css' local p, Buffer, stubCats = { --Prevents dupli-cats... get it? Maybe not? cats = setmetatable({}, {__newindex = function(t, i, v) if not rawget(t, i) then rawset(t, i, v) table.insert(t, i) end end}), --initializes variables required by both p.main and p.templatepage init = function(self, frame, page) args, page = args or require('Module:Arguments').getArgs(frame, { wrappers = WRAPPER_TEMPLATE }), page or mw.title.getCurrentTitle() --Ensures demo parameter will never affect category() output for articles self.demo = self.demo or page.namespace ~= 0 and args.demo return args, page end }, require('Module:Buffer') --[[ Formats category links. Stores them until called with cat.done=true Takes multiple or single categories in the form of 'cat' or a table of strings and/or tables containing parts. (See below) ]] local attention, catTag, catKey = Buffer'Stub message templates needing attention', '[[Category:%s]]', '%s|%s%s' local function category(cat) for _, v in ipairs((tostring(cat) == cat or cat.t) and {cat} or cat) do --[[ If v is a table: [1] = full category name; defaults to local attention if blank k = Category sort key. Prefix before v.t t = page.text or args.tempsort#; appended after k (or in its place if omitted). Required if v is not a string Basically the same as v = (v[1] or attention) .. ' | ' .. (v.k or '') .. v.t ]] if v and v ~= true then--reject v = nil, false, or true p.cats[catTag:format(tostring(v) == v and v or (v[1] and Buffer(v[1]) or attention):_in(v.k):_(v.t):_str(2, nil, nil, '|') )] = true end end return cat.done and table.concat(p.cats, p.demo and ' | ' or nil) or '' end --[[ Makes an ombox warning; Takes table {ifNot = Boolean, text, {cat. sort key, cat. sort name}} Will return an empty string instead when ifNot evaluates to true ]] local function ombox(v) if v.ifNot then return end p.ombox = p.ombox or require('Module:Message box').ombox category{v[2]} return p.ombox{ type = 'content', text = v[1] } end --[[ Unlike original template, module now takes unlimited cats! This function also performs most stub category error checks except for the ombox for when main |category= is omitted (See p.template()) ]] local function catStub(page, pageDoc) stubCats = {missing = {}, v = {}} -- zwj and zwnj have semantical use in other other wikis, don't remove them local zwj = '\226\128\141' -- U+200D, E2 80 8D local zwnj = '\226\128\140' -- U+200C, E2 80 8C local disallowedUnicodeChars = '[^%w%p%s' .. zwj .. zwnj .. ']' -- for i18n we make this a separate string local code for k, _ in pairs(args) do --Find category parameters and store the number (main cat = '') table.insert(stubCats, string.match(k, '^category(%d*)$')) end table.sort(stubCats) for k, v in ipairs(stubCats) do --Get category names and, if called by p.templatepage, the optional sort key local tsort, cat = args['tempsort' .. v], mw.ustring.gsub(args['category' .. v], disallowedUnicodeChars, '')--remove all hidden unicode chars --Do not place template in main category if |tempsort = 'no'. However, DO place articles of that template in the main category. table.insert(stubCats.v, page and (--p.templatepage passes page; p.main does not, i.e. articles are categorized without sort keys. v=='' and tsort == 'no'--if true, inserts 'true' in table, which category() will reject or tsort and {cat, k = ' ', t = tsort} or {cat, k = ' *', t = page.text}--note space in front of sort key ) or cat ) --Check category existance only if on the template page (i.e. stub documentation) if page then if not mw.title.new('Category:' .. cat).exists then code = code or mw.html.create'code':wikitext'|category' table.insert(stubCats.missing, tostring(mw.clone(code):wikitext(v))) end --[[ Checks non-demo stub template for documentation and flags if doc is present. All stub cats names are checked and flagged if it does not match 'Category: [] stub'. The main stub cat is exempt from the name check if the stub template has its own doc (presumably, this doc would have an explanation as to why the main stub cat is non-conforming). ]] table.insert(stubCats.v, v == '' and not p.demo and pageDoc.exists and 'Stub message templates with documentation subpages' or not cat:match' stubs$' and {k = 'S', t = page.text} ) end end --Add category names after loop is completed category(stubCats.v) return #stubCats.missing > 0 and ombox{ --Changed, original msg: --One or more of the stub categories defined in this template do not seem to exist! --Please double-check the parameters {{para|category}}, {{para|category1}} and {{para|category2}}. 'The following parameter' .. (#stubCats.missing == 1 and ' defines a stub category that does' or 's define stub categories that do') .. ' not exist: ' .. mw.text.listToText(stubCats.missing), {k = 'N', t = page.text} } end --Shows population of categories found by catStub(). Outputs demo values if none local function population() local wikitext, base = {}, '* [[:Category:%s]] (population: %s)\n' if not args.category and stubCats[1] ~= false then table.insert(stubCats, 1, false) end for _, v in ipairs(stubCats) do table.insert(wikitext, base:format( v and args['category' .. v] or '{{{category}}}', v and mw.site.stats.pagesInCategory(args['category' .. v], 'all') or 0 )) end return table.concat(wikitext) end --Includes standard stub documention and flags stub templates with bad parameter values. function p.templatepage(frame, page) args, page = p:init(frame, page) local tStubDoc = mw.title.new'Template:Stub documentation' local pageDoc = page:subPageTitle('doc') --Reorganization note: Original Asbox alternates between outputting categories and checking on params |category#=. --Rather than checking multiple times and switching tasks, all stub category param operations have been rolled into catStub() return Buffer( ombox{--Show ombox warnings for missing args. ifNot = args.category, 'The <code>|category</code> parameter is not set. Please add an appropriate stub category.', {k = 'C', t = page.text} }) :_(ombox{ ifNot = args.subject or args.article or args.qualifier, 'This stub template contains no description! At least one of the parameters <code>|subject</code>, <code>|article</code> or <code>|qualifier</code> must be defined.', {k = 'D', t = page.text} }) :_(catStub(page, pageDoc))--catStub() may also return an ombox if there are non-existing categories :_(category{ done = p.demo ~= 'doc',--Outputs categories if not doc demo 'Stub message templates', args.icon and 'Stub message templates using icon parameter' or args.image and ( mw.title.new('Media:' .. mw.text.split(args.image, '|')[1]).exists--do nothing if exists. category() will reject true or {k = 'B', t = page.text} ) or 'Stub message templates without images', args.imagealt and {k = 'I', t = page.text}, }) :_((not p.demo or p.demo == 'doc') and--Add standard stub template documentation require('Module:Documentation').main{ content = Buffer(page.text ~= 'Stub' and--This comparison performed in {{Asbox/stubtree}} before it invokes Module:Asbox stubtree require('Module:Asbox stubtree').subtree{args = {pagename = page.text}} ) :_in'\n== About this template ==\nThis template is used to identify a':_(args.subject):_'stub':_(args.qualifier):_out' '--space :_'. It uses {{[[Template:Asbox|asbox]]}}, which is a meta-template designed to ease the process of creating and maintaining stub templates.\n=== Usage ===\nTyping ' :_(mw.html.create'code' :wikitext('{{', page.text == 'Stub' and 'stub' or page.text, '}}') ) :_' produces the message shown at the beginning, and adds the article to the following categor' :_(#stubCats > 1 and 'ies' or 'y') :_':\n' :_(population()) :_(pageDoc.exists and--transclusion of /doc if it exists frame:expandTemplate{title = pageDoc.text} ) :_'\n== General information ==\n' :_(frame:expandTemplate{title = tStubDoc.text}) :_'\n\n'(), ['link box'] = Buffer'This documentation is automatically generated by [[Module:Asbox]].' :_in'The general information is transcluded from [[Template:Stub documentation]]. ' :_(mw.html.create'span' :cssText'font-size:smaller;font-style:normal;line-height:130%' :node(('([%s edit] | [%s history])'):format( tStubDoc:fullUrl('action=edit', 'relative'), tStubDoc:fullUrl('action=history', 'relative') )) ) :_out() :_(page.protectionLevels.edit and page.protectionLevels.edit[1] == 'sysop' and "This template is [[WP:PROTECT|fully protected]] and any [[WP:CAT|categories]] should be added to the template's [" .. pageDoc:fullUrl('action=edit&preload=Template:Category_interwiki/preload', 'relative') .. '| /doc] subpage, which is not protected.' )' <br/>' } )() end function p.main(frame, page) args, page = p:init(frame, page) local output = mw.html.create'div' :attr{role = 'note'} :addClass'metadata plainlinks asbox stub' :tag'table' :attr{role = 'presentation'} :tag'tr' :addClass'noresize' :node((args.icon or args.image) and mw.html.create'td' :wikitext(args.icon or ('[[File:%s|%spx|alt=%s]]'):format( args.image or '', args.pix or '40x30', args.imagealt or 'Stub icon' )) ) :tag'td' :tag'p' :addClass'asbox-body' :wikitext( Buffer'Pego e ya':_(args.subject):_(args.kana or 'kana tsebe e' ):_(args.qualifier)' ',--space ' e [[Wikipedia:stub|Nnyane]]. O ka thusa Wikipedia kago [', page:fullUrl('action=edit', 'relative'), ' e oketsa].' ) :done() :node(args.note and mw.html.create() :tag'p' :addClass'asbox-note' :wikitext(args.note) :done() ) :allDone() :node(args.name and require'Module:Navbar'._navbar{ args.name, mini = 'yes', } ) --[[ Stub categories for templates include a sort key; this ensures that all stub tags appear at the beginning of their respective categories. Articles using the template do not need a sort key since they have unique names. When p.demo equals 'doc', the demo stub categories will appear as those for a stub template. Otherwise, any non-nil p.demo will emulate article space categories (plus any error cats unless set to 'art') ]] if page.namespace == 0 then -- Main namespace category'All stub articles' catStub() elseif p.demo then if p.demo ~= 'doc' then catStub() end --Unless p.demo is set to 'art', it will also include error categories normally only shown on --the template but not in the article. The elseif after namespace == 0 means demo cats will never show in article space. p.demodoc = p.demo ~= 'art' and p.templatepage(frame, page) output = mw.html.create() :node(output) :tag'small':wikitext( 'Demo categories: ', (category{done = true}:gsub('(%[%[)(Category:)([^|%]]-)(%|)', '%1%2%3|%2%3%4'):gsub('(%[%[)(Category:)', '%1:%2')) ):done() :wikitext(p.demo == 'doc' and p.demodoc or nil) else --Checks for valid name; emulates original template's check using {{FULLPAGENAME:{{{name|}}}}} local normalizedName = mw.title.new(args.name or '') if normalizedName and normalizedName.fullText == page.fullText then output = mw.html.create():node(output):wikitext(p.templatepage(frame, page)) elseif not page.isSubpage and page.namespace == 10 then-- Template namespace and not a subpage category{{k = args.name and 'E' or 'W', t = page.text}} end end return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(output:wikitext(not p.demo and category{done = true} or nil)) end return p iwbk79kl00aurik8blj99k31zhb55nl Bogobe 0 7298 27020 27001 2022-07-30T14:27:00Z Rebel Agent 9072 /* Dikotla */Thanolo wikitext text/x-wiki {{Short description|Food}} {{Infobox food | name = Bogobe | image = File:Oatmeal (1).jpg | image_size = 250px | caption = mogopo o nale bogobe | alternate_name = | region = | creator = | course = Dijo tsa phakela | type = | served = Di hisa | main_ingredient = Ditlhare (sekai; mmedi), metsi kana mašhi | variations = | calories = | other = }} '''Bogobe''' ke sejo se se dirwang ka go tshuba kana go bedisa, mmedi o swailweng kana o o direlweng bopi. Gantsi bo a apewa bo botsholwa ga mmogo le dišhabo, jaaka merogo kana, nama. '''Bogobe''' kgotsa '''motogo''' ke sejo se se apeilweng ka metsi kgotsa mashi a a belang go dirisiwa mabele. Fa metsi kana mashi a bela o tshela bopi kgotsa mabele o bo o faga. Bo natifisiwa ka sukiri kgotsa lemepe bo be bo tsholwa bo le bothito mo mogopong, kgotsa go tlhakanngwa le metswako e e natifisang.<ref>{{cite book |editor1-last=Welch |editor1-first=R.W. |date=1995 |title=The Oat Crop: Production and Utilization |url=https://books.google.com/books?id=wNTyCAAAQBAJ&pg=PA16 |location=Dordrecht |publisher=Springer Science & Business Media |pages=15–16 |isbn=978-0412373107 }}</ref> ==Dikotla== {{nutritional value | name=Bogobe, bo apeilwe ka metsi | kJ=297 | protein=2.5 g | fat=1.5 g | carbs=12 g | fiber=1.7 g | sugars=0.3 | calcium_mg=9 | iron_mg=0.9 | magnesium_mg=27 | phosphorus_mg=77 | potassium_mg=70 | sodium_mg=4 | zinc_mg=1 | manganese_mg=0.6 | vitC_mg=0 | thiamin_mg=0.08 | riboflavin_mg=0.02 | niacin_mg=0.23 | pantothenic_mg=0.197 | vitB6_mg=0.005 | folate_ug=6 | vitA_ug=0 | vitE_mg=0.08 | vitK_ug=0.3 | water=83.6 | source_usda = 1 | note=[https://fdc.nal.usda.gov/fdc-app.html#/food-details/173905/nutrients Kogolagano e yang ko USDA] }} ==Ka fa bo dirwang ka teng== Motogo ke sejo sese dirilweng ka go bidisa mabele a a sidilweng mo mashing, metsing kgotsa mogo tsone tshotlhe, mme gona le manetetsha a mangwe fa o bata, o jewa o santse o thuthafetse. O kanna wa natefitshiwa ka sukiri, lomepe o bo o jewa ole sukiri jalo kana wa tsenngwa sepaese le diguruntu, go dira sejo sese shabiwang. ==Metswedi== {{Reflist}} k6j1qm6ql9tkdcc3hnlyel3129p28up Tempolete:Commons category 10 7425 27133 2022-07-31T06:05:41Z Rebel Agent 9072 Ke dirile tempolete wikitext text/x-wiki {{Sister project | position = {{{position|}}} | project = commons | text = Wikimedia Commons e nale {{{alt-term|pego e amanang le}}} <span style="font-weight: bold; {{#ifeq:{{{nowrap|no}}}|yes|white-space:nowrap;}} {{#ifeq:{{{italic|yes}}}|yes|font-style: italic;}}">[[commons:{{#if:{{{1|}}}|Category:{{{1|}}}|{{if then show|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}|Category:{{PAGENAME}}}}}}|{{#ifeq:{{{lcf|{{{lcfirst|no}}}}}}|yes|{{lcfirst:{{{2|{{#if:{{{1|}}} | {{{1|}}} <!-- -->|{{if then show|{{#invoke:String|replace|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}|Category:|}}<!-- --> |{{PAGENAME}} }} }} }}} }}<!-- -->|{{{2|{{#if:{{{1|}}} | {{{1|}}} <!-- -->|{{if then show|{{#invoke:String|replace|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}|Category:|}}|{{PAGENAME}} }}<!-- -->}}}}}}}]]</span>.<!-- End of the template code, now add relevant tracking categories --><includeonly>{{#switch:{{NAMESPACE}}||{{ns:14}}=<!-- Only add tracking categories to articles and categories. -->{{#if:{{{1|}}}|{{#ifeq:Category:{{replace|{{{1|}}}|_|&#32;}}|{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}|<!-- -->[[Category:Commons category link is on Wikidata]]<!-- -->|{{#ifeq:{{replace|{{{1|}}}|_|&#32;}}|{{PAGENAME}}|<!-- ... the local parameter is the same as the local pagename -->[[Category:Commons category link is defined as the pagename]]{{preview warning|Commons category does not match the Commons sitelink on Wikidata – [[Template:Commons_category#Resolving_discrepancies|please check]]}}<!-- ... the local parameter is not the pagename -->|[[Category:Commons category link is locally defined]]{{preview warning|Commons category does not match the Commons sitelink on Wikidata – [[Template:Commons_category#Resolving_discrepancies|please check]]}}}} }}<!-- We don't have a locally-defined link -->|{{#if:{{#invoke:WikidataIB |getCommonsLink|qid={{{qid|}}}|onlycat=True|fallback=False}}|<!-- ... so we're using Wikidata -->[[Category:Commons category link from Wikidata]]<!-- <!-- ... or we're using the pagename -->|[[Category:Commons category link is the pagename]]{{preview warning|Commons category does not match the Commons sitelink on Wikidata – [[Template:Commons_category#Resolving_discrepancies|please check]]}} }} }} }}</includeonly> }}<noinclude> {{Documentation}} <!-- Add categories to the /doc subpage, not here! --> </noinclude> sejmcstwhng00uaknds6ynx0kg07tul Tempolete:If then show 10 7426 27134 2022-07-31T06:07:10Z Rebel Agent 9072 Ke dirile tempolete wikitext text/x-wiki {{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{3|}}}{{{1|}}}{{{4|}}}|{{{2|}}}}}<noinclude> {{Documentation}} </noinclude> 7d83cpur6ml0umb4qqvcpyge8uuck90 Tempolete:Preview warning 10 7427 27135 2022-07-31T06:09:31Z Rebel Agent 9072 Ke dirile tempolete wikitext text/x-wiki <includeonly>{{#invoke:If preview|pwarning}}</includeonly><noinclude> {{documentation}} </noinclude> nxkq4zpg9stmeov4qpup2a2gztlv1on Module:If preview 828 7428 27136 2022-07-31T06:13:21Z Rebel Agent 9072 Ke dirile module Scribunto text/plain local p = {} local cfg = mw.loadData('Module:If preview/configuration') --[[ main This function returns either the first argument or second argument passed to this module, depending on whether the page is being previewed. ]] function p.main(frame) if cfg.preview then return frame.args[1] or '' else return frame.args[2] or '' end end --[[ pmain This function returns either the first argument or second argument passed to this module's parent (i.e. template using this module), depending on whether it is being previewed. ]] function p.pmain(frame) return p.main(frame:getParent()) end local function warning_text(warning) return mw.ustring.format( cfg.warning_infrastructure, cfg.templatestyles, warning ) end function p._warning(args) local warning = args[1] and args[1]:match('^%s*(.-)%s*$') or '' if warning == '' then return warning_text(cfg.missing_warning) end if not cfg.preview then return '' end return warning_text(warning) end --[[ warning This function returns a "preview warning", which is the first argument marked up with HTML and some supporting text, depending on whether the page is being previewed. disabled since we'll implement the template version in general ]] --function p.warning(frame) -- return p._warning(frame.args) --end --[[ warning, but for pass-through templates like {{preview warning}} ]] function p.pwarning(frame) return p._warning(frame:getParent().args) end return p i2018hg2i8x3uajzdhhh7yzkknltvcf Module:If preview/configuration 828 7429 27137 2021-05-05T18:56:00Z en>Izno 0 Protected "[[Module:If preview/configuration]]": match parent ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)) Scribunto text/plain --[[ We perform the actual check for whether this is a preview here since preprocessing is relatively expensive. ]] local frame = mw.getCurrentFrame() local function is_preview() local revision_id = frame:preprocess('{{REVISIONID}}') -- {{REVISIONID}} is usually the empty string when previewed. -- I don't know why we're checking for nil but hey, maybe someday things -- would have broken return revision_id == nil or revision_id == '' end local function templatestyles() return frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:If preview/styles.css' } } end return { preview = is_preview(), templatestyles = templatestyles(), warning_infrastructure = '%s<div class="preview-warning"><strong>Preview warning:</strong> %s</div>', missing_warning = 'The template has no warning text. Please add a warning.' } 7ccf9c7e3yxw9p4ke6iw4ndcfniweno 27138 27137 2022-07-31T06:17:22Z Rebel Agent 9072 1 revision imported from [[:en:Module:If_preview/configuration]] Scribunto text/plain --[[ We perform the actual check for whether this is a preview here since preprocessing is relatively expensive. ]] local frame = mw.getCurrentFrame() local function is_preview() local revision_id = frame:preprocess('{{REVISIONID}}') -- {{REVISIONID}} is usually the empty string when previewed. -- I don't know why we're checking for nil but hey, maybe someday things -- would have broken return revision_id == nil or revision_id == '' end local function templatestyles() return frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:If preview/styles.css' } } end return { preview = is_preview(), templatestyles = templatestyles(), warning_infrastructure = '%s<div class="preview-warning"><strong>Preview warning:</strong> %s</div>', missing_warning = 'The template has no warning text. Please add a warning.' } 7ccf9c7e3yxw9p4ke6iw4ndcfniweno Module:Side box 828 7430 27141 2022-07-31T06:28:47Z Rebel Agent 9072 Ke dirile module Scribunto text/plain local yesno = require('Module:Yesno') local p = {} local function makeData(args) local data = {} -- Main table classes data.classes = {} if yesno(args.metadata) ~= false then table.insert(data.classes, 'metadata') end if args.position and args.position:lower() == 'left' then table.insert(data.classes, 'side-box-left') else table.insert(data.classes, 'side-box-right') end if args.collapsible then table.insert(data.classes, 'mw-collapsible') if args.collapsible == "collapsed" then table.insert(data.classes, 'mw-collapsed') end data.collapsible = true end table.insert(data.classes, args.class) -- Image if args.image and args.image ~= 'none' then data.image = args.image end -- Copy over data that does not need adjusting local argsToCopy = { -- aria qualities 'role', 'labelledby', -- Classes 'textclass', -- Styles 'style', 'textstyle', 'templatestyles', -- Above row 'above', 'abovestyle', -- Body row 'text', 'imageright', -- Below row 'below', } for i, key in ipairs(argsToCopy) do data[key] = args[key] end return data end local function renderSidebox(data) -- Renders the sidebox HTML. -- Table root local root = mw.html.create('div') root:attr('role', data.role) :attr('aria-labelledby', data.labelledby) :addClass('side-box') for i, class in ipairs(data.classes or {}) do root:addClass(class) end if data.style then root:cssText(data.style) end -- The "above" row if data.above then local above = root:newline():tag('div') above:addClass('side-box-abovebelow') :newline() :wikitext(data.above) if data.textstyle then above:cssText(data.textstyle) end if data.abovestyle then above:cssText(data.abovestyle) end end -- The body row local body = root:newline():tag('div') body:addClass('side-box-flex') :addClass(data.collapsible and 'mw-collapsible-content') :newline() if data.image then body:tag('div') :addClass('side-box-image') :wikitext(data.image) end local text = body:newline():tag('div') text:addClass('side-box-text') :addClass(data.textclass or 'plainlist') if data.textstyle then text:cssText(data.textstyle) end text:wikitext(data.text) if data.imageright then body:newline():tag('div') :addClass('side-box-imageright') :wikitext(data.imageright) end -- The below row if data.below then local below = root:newline():tag('div') below :addClass('side-box-abovebelow') :wikitext(data.below) if data.textstyle then below:cssText(data.textstyle) end end root:newline() local frame = mw.getCurrentFrame() local templatestyles = '' if data.templatestyles then templatestyles = frame:extensionTag{ name = 'templatestyles', args = { src = data.templatestyles } } end return frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:Side box/styles.css' } } .. templatestyles .. tostring(root) end function p._main(args) local data = makeData(args) return renderSidebox(data) end function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end return p egcspx2irukqbdg26nexp0sq0xy7sp0 Module:Side box/styles.css 828 7431 27142 2022-07-31T06:30:11Z Rebel Agent 9072 Ke dirile css sanitized-css text/css /* {{pp|small=y}} */ .side-box { margin: 4px 0; box-sizing: border-box; border: 1px solid #aaa; font-size: 88%; line-height: 1.25em; background-color: #f9f9f9; } .side-box-abovebelow, .side-box-text { padding: 0.25em 0.9em; } .side-box-image { /* @noflip */ padding: 2px 0 2px 0.9em; text-align: center; } .side-box-imageright { /* @noflip */ padding: 2px 0.9em 2px 0; text-align: center; } /* roughly the skin's sidebar + size of side box */ @media (min-width: 500px) { .side-box-flex { display: flex; align-items: center; } .side-box-text { flex: 1; } } @media (min-width: 720px) { .side-box { width: 238px; } .side-box-right { /* @noflip */ clear: right; /* @noflip */ float: right; /* @noflip */ margin-left: 1em; } /* derives from mbox classes, which do not float left in mbox-small-left * so far as I can tell, that was a deliberate decision, since only .ambox * supports mbox-left */ .side-box-left { /* @noflip */ margin-right: 1em; } } tgo3vjuu8j9tahz1x7359yicixmhme8 Module:Message box/fmbox.css 828 7432 27144 2022-07-31T06:38:18Z Rebel Agent 9072 Ke dirile module sanitized-css text/css /* {{pp|small=y}} */ .fmbox { clear: both; margin: 0.2em 0; width: 100%; border: 1px solid #a2a9b1; background-color: #f8f9fa; /* Default "system" gray */ box-sizing: border-box; } .fmbox-warning { border: 1px solid #bb7070; /* Dark pink */ background-color: #ffdbdb; /* Pink */ } .fmbox-editnotice { background-color: transparent; } .fmbox .mbox-text { border: none; /* @noflip */ padding: 0.25em 0.9em; width: 100%; } .fmbox .mbox-image { border: none; /* @noflip */ padding: 2px 0 2px 0.9em; text-align: center; } .fmbox .mbox-imageright { border: none; /* @noflip */ padding: 2px 0.9em 2px 0; text-align: center; } .fmbox .mbox-invalid-type { text-align: center; } ticrusgmgm1z0863raje40vjnas1a3q Module:Message box/ombox.css 828 7433 27145 2022-07-31T06:41:45Z Rebel Agent 9072 Ke dirile module sanitized-css text/css /* {{pp|small=y}} */ .ombox { margin: 4px 0; border-collapse: collapse; border: 1px solid #a2a9b1; /* Default "notice" gray */ background-color: #f8f9fa; box-sizing: border-box; } /* For the "small=yes" option. */ .ombox.mbox-small { font-size: 88%; line-height: 1.25em; } .ombox-speedy { border: 2px solid #b32424; /* Red */ background-color: #fee7e6; /* Pink */ } .ombox-delete { border: 2px solid #b32424; /* Red */ } .ombox-content { border: 1px solid #f28500; /* Orange */ } .ombox-style { border: 1px solid #fc3; /* Yellow */ } .ombox-move { border: 1px solid #9932cc; /* Purple */ } .ombox-protection { border: 2px solid #a2a9b1; /* Gray-gold */ } .ombox .mbox-text { border: none; /* @noflip */ padding: 0.25em 0.9em; width: 100%; } .ombox .mbox-image { border: none; /* @noflip */ padding: 2px 0 2px 0.9em; text-align: center; } .ombox .mbox-imageright { border: none; /* @noflip */ padding: 2px 0.9em 2px 0; text-align: center; } /* An empty narrow cell */ .ombox .mbox-empty-cell { border: none; padding: 0; width: 1px; } .ombox .mbox-invalid-type { text-align: center; } @media (min-width: 720px) { .ombox { margin: 4px 10%; } .ombox.mbox-small { /* @noflip */ clear: right; /* @noflip */ float: right; /* @noflip */ margin: 4px 0 4px 1em; width: 238px; } } gt34qcz2etl1lglsfax1xmoaasgmdxe Tempolete:EasternCape-geo-stub 10 7434 27152 2022-07-31T07:22:55Z Rebel Agent 9072 Ke dirile tempolete wikitext text/x-wiki {{asbox | image = Elephants_mating_ritual_2.jpg | pix = 70 | subject = Lefelo la [[Eastern Cape]] | qualifier = | category = Eastern Cape geography stubs | tempsort = | name = Template:EasternCape-geo-stub }}<noinclude>[[Category:South Africa stub templates]]</noinclude> 34qpu3ev10ipjglfj1vltwpw8d4q0hv Module:If preview/styles.css 828 7435 27154 2022-07-31T07:30:08Z Rebel Agent 9072 Ke dirile css sanitized-css text/css /* {{pp|small=yes}} */ .preview-warning { font-style: italic; /* @noflip */ padding-left: 1.6em; margin-bottom: 0.5em; color: red; } /* The templatestyles element inserts a link element before hatnotes. * TODO: Remove link if/when WMF resolves T200206 */ .preview-warning + link + .preview-warning { margin-top: -0.5em; } gaiz1uhqgmf5elgq82yqqfll7kgcbwe