Это страница документации Амодуль:OutputBuffer.
Ахәҭаҷ/асекциа адырра апроцесс аԥсуа бызшәа аиҭагара ахь. Абызшәа адырра шәазҟазазар, ишәылшоит шәхы алашәырхәыр. |
This module provides an easy and efficient way to generate lengthy strings.
First, load the module.
local newBuffer = require('Module:OutputBuffer')
Then, create the buffer and the functions that act on it.
local getBuffer, print, printf = newBuffer()
local text = getBuffer(sep)
Returns the contents of the buffer, with an optional separator string sep.
print(s)
Adds the string s to the buffer.
printf(s, ...)
Adds the string s to the buffer. The string is formatted with any subsequent arguments, following the rules used for string.format.
local newBuffer = require('Module:OutputBuffer') local p = {} function p.main() local getBuffer, print, printf = newBuffer() print('Welcome to the English Wiki Аԥсуа.') printf('There are currently %d articles on this site.', mw.site.stats.articles) return getBuffer(' ') end return p -- Assuming this module's name is "TestModule", and that mw.site.stats.articles returns 4500000, -- {{#invoke:TestModule|main}} would output: -- "Welcome to the English Wiki Аԥсуа. There are currently 4500000 articles on this site."
This article uses material from the Wikipedia Аԥсуа article doc, which is released under the Creative Commons Attribution-ShareAlike 3.0 license ("CC BY-SA 3.0"); additional terms may apply (view authors). Если не указано иное, содержание доступно по лицензии CC BY-SA 4.0. Images, videos and audio are available under their respective licenses.
®Wikipedia is a registered trademark of the Wiki Foundation, Inc. Wiki Аԥсуа (DUHOCTRUNGQUOC.VN) is an independent company and has no affiliation with Wiki Foundation.