Yiɣi chaŋ yɛligu maŋamaŋa puuni

Module:Buffer

Diyila Dagbani Wikipedia

This was originally developed to optimize string concatenation as a helper method within Module:Asbox, but has been generalized for all modules.

The interface for Module:Buffer objects is similar to that of Tɛmplet:Scribunto/helper objects in that you may build complex strings with independent child nodes. In most cases, you may use Buffer objects like a normal string, including using .. operator. See also: #String, mw.ustring, and mw.text libraries

Additionally, there are several specialized forms and extended objects, described further in their respective sections:

Last but not least, this module has an ordered __pairs which can be more thorough than Tɛmplet:Scribunto/helper and Tɛmplet:Scribunto/helper. (Even reads nil keys!) The logical uniqueness of this iterator may be reason enough to Tɛmplet:Scribunto/helper Module:Buffer.

require'Module:Buffer'

[mali mi di yibu sheena n-niŋ]
Tɛmplet:Luaself

Creates a new Module:Buffer object when the module returned by Tɛmplet:Scribunto/helper is called as a functionTɛmplet:--i.e., there is no 'main'.

Because Tɛmplet:Scribunto/helper are a pet peeve of this developer, this forwards arguments to Tɛmplet:Luaself; if that op is not desired, you may chain a Buffer object function directly to the module and the self-action will be redirected to a new Buffer objectTɛmplet:--i.e require'Module:Buffer':_inHTML'table' is equivalent to require'Module:Buffer'():_inHTML'table'.[note 1]

The global variable Tɛmplet:Scribunto/helper is "magic" when passed as the first arg. Such enables the global functions and, if followed by a name string, will declare the new Buffer with that name in the global scope. If the argument following name is a table with no metatable, it and any other Tɛmplet:Scribunto/helper are forwarded to Tɛmplet:Luaself; otherwise, as long as the first vararg is not nil or false, this passes them to Tɛmplet:Luaself.[note 2] The _G passed may also gain a __call Tɛmplet:Scribunto/helper (details at _G object).

As a final note, if you Tɛmplet:Scribunto/helper text from a module which returns a Buffer object, it may be more efficient to create a new Buffer via chaining Tɛmplet:Luaself after a require statement for the other module and use Tɛmplet:Luaself at the point where you would append the required text. (Best add --:_in == indirect require Module:Buffer so future editors won't hunt for function ...:_in at the other module)

Tɛmplet:Luaself

Get a Buffer as a Tɛmplet:Scribunto/helper via a function call on the Buffer object (as opposed to a call on the module). This is basically shorthand for Tɛmplet:Scribunto/helper, or, with no args, Tɛmplet:Scribunto/helper. However, if this Buffer is in raw mode[note 3] or contains at least one Tɛmplet:Scribunto/helper index, this reconstructs the Buffer by creating a new table, coercing it contents to strings and appending them sequentially to the temporary "buffer" via new-Tɛmplet:Luaself (or a similar process).

Unconventionally, any Tɛmplet:Scribunto/helper-type position passed as i or j are treated as relative to length; that is, Tɛmplet:Luaself is equivalent to Tɛmplet:Luaself (which obviates the need to Tɛmplet:Scribunto/helper Buffer just to use the Tɛmplet:Scribunto/helper). Moreover, unlike table.concat, this automatically adjusts numerical[note 4] positions to be within the range of the lowest and greatest indicies.

Note you may append a Buffer object without tostring coercion to an Tɛmplet:Scribunto/helper object via Tɛmplet:Scribunto/helper (though not mw.html:wikitext because of type checking).

Buffer.last_concat
[mali mi di yibu sheena n-niŋ]

When strung without a (valid) sep, the result is cached at Buffer.last_concat. Until purged, future calls to return that Buffer as a string will return this index instead.[note 5]

This should clear automatically whenever a Buffer object function changes the contents of a Buffer. You may manually purge the cache by setting this key to nil, as well as by passing nothing to Tɛmplet:Luaself.

Tɛmplet:Luaself

Appends a value to the Buffer. In rough terms, Buffer:_'string1':_'string2' is the same as Buffer = Buffer..'string1'..'string2'. (It may help to imagine :_ as a .. that has stood up and is now casting a shadow.)

If passed an invalid value listed below, this is a no-op:

A table with no __tostring will pass through Tɛmplet:Scribunto/helper before insertion. An Tɛmplet:Scribunto/helper may be thrown if the table would cause table.concat to error. (Use Tɛmplet:Luaself instead for such tables.)

When passed pos of type Tɛmplet:Scribunto/helper, the argument is identical to pos for Tɛmplet:Scribunto/helper. In fact, assuming a valid value, Tɛmplet:Luaself is exactly the same as Tɛmplet:Scribunto/helper.

Just like with the position arguments of Buffer(), any pos of type Tɛmplet:Scribunto/helper would be treated as relative to length.

Set raw to true to force append a value without tostring coercion, including invalid values. If given only two (non-self) arguments with the second being a boolean, then the second is read as raw instead.

Tɛmplet:Luaself

Removes the value buffered at pos. As with Tɛmplet:Luaself, a string pos string is treated as #Buffer + pos.

If a non-boolean replacement is provided, then it will replace the value indexed at pos. Passing a boolean as the second argument is a no-op.

When replacement is nil, the op is basically Tɛmplet:Scribunto/helper. As with the positional arguments of other Buffer methods, any numerical string pos is added to length, such that Tɛmplet:Luaself removes the last item. Note the only type check on replacement is a direct comparison to both booleans (nil is implied). Any other type, including strings, sets the Buffer to raw mode.

A pos that is omitted, nil, or false has the same effect as though '0' (or Tɛmplet:Luaself) were passed. Given only one non-numerical argument which evaluates true but Tɛmplet:Scribunto/helper would return it as nil, this treats it as though it were passed as the second. If passed a non-numerical pos with any other argument, including nil, this is effectively a no op (though may still purge the cache).

Tɛmplet:Luaself

Takes a table value, iterates through all number keys Tɛmplet:Scribunto/helper, appending each valid value to the end of the Buffer. In contrast to Tɛmplet:Scribunto/helper, this starts at the most negative key (down to Tɛmplet:Scribunto/helper) and ends at the most positive index, continuing through any nil keys and includes non-integer number keys.

A table value that has no metatable will have its contents iterated by this function before moving on to the next value. All other data types are processed by Tɛmplet:Luaself.

By default, this ignores non-number keys unless nanKeys evaluates true. If so, non-number keys are processed after number keys. Keep in mind such keys are iterated in Tɛmplet:Scribunto/helper order, though an order may be imposed by wrapping each pair in a table indexed at a number key.

If given a value = pos pair, defined as a number or number string indexed at a non-number key, then they will be passed as the value and pos arguments for Tɛmplet:Luaself. Thus,

Tɛmplet:Luaself

produces the same result as:

Buffer:_(1):_(2):_(3)
if variable then
	Buffer:_(4)
else
	Buffer:_'four':_('zero',1)--vs :_all{four='1',zero=1}; less redundant would be
end                           --   :_all{'four',zero=1}, but that doesn't demo string numbers
Buffer:_'... done'
--returns "1234... done" if variable evaluates true or "zero123four... done" if false

If a non-number key points to a value that cannot be coerced into a Tɛmplet:Scribunto/helper then the pair may be treated as functionName = args, when functionName matches a Buffer object function and args is not boolean. If args is such that value[1] evaluates true, then this will pass the return of Tɛmplet:Scribunto/helper to the named function; otherwise, the value is passed as is.[note 6]

Tɛmplet:Luaself

Passes any arguments to Module:Buffer to create a new Buffer object, sets an external reference to the parent Buffer and returns the child.[note 7]

This does not append the child to the parent. (See Tɛmplet:Luaself)

Also, be aware that Buffer parent references are Tɛmplet:Scribunto/helper. Thus, if you were to (re-)set a local variable that is currently set to the parent, such could trigger immediate garbage collection on the parent.

Tɛmplet:Luaself

Joins a Buffer with sep and appends result to its parent, which is returned. If no parent is found, this is a no-op and returns the same Buffer.

When given two or more arguments, this reads the first as opsTɛmplet:--the number of :_out() operations to perform.[note 8] This applies the first sep in sep-list for the current Buffer, the second for its parent, the third for its grandparent, and so on.

If the last item is a Tɛmplet:Scribunto/helper, then any nil in sep-list default to table[1]; any false mean "no-sep".[note 9] The table may be the second arg (i.e. sep-list may be omitted). If it has other keys, then table[n] would apply instead of table[1], making these synonymous:

Tɛmplet:Luaself and Tɛmplet:Luaself.

The number 0 is "magic" when passed as the first arg (even by itself), joining and appending to the same Buffer after it has been Tɛmplet:Luaself. This is the only method by which a Buffer in raw mode may lose that status. Parent references are preserved.

Tɛmplet:Luaself

Joins a Buffer with sep and returns the string.

This uses the same helper method as Tɛmplet:Luaself to handle multiple arguments, with which, if provided, this creates a new temporary Buffer to which this appends the results of the number of generations specified by ops, with each ancestor in front of its descendants. This then performs one additional concat op using the sep at ops + 1 and returns the result. If a parent-less Buffer is reached before ops, then the sep that follows its op number will separate the generations.

When no valid sep is given, this returns a string identical to what would append to the next ancestor, if those arguments were passed to Buffer:_out instead and one additional :_out() op performed.

However, because this does not actually append child Buffers to their parent, the result may differ where this would insert the sep at ops + 1 and Buffer:_out would place the parent's sep between it and its child instead.

Tɛmplet:Luaself

Nils all keys of the table referenced by clear and unsets its metatable. If clear evaluates false, this simply purges the cache at Tɛmplet:Luaself.

If given a table to copy, this will duplicate all key-value pairs of copy into clear, cloning any table value recursively via Buffer:_cc(0, value). This returns the Buffer unless passed the number 0 as clear, which causes this to create a new table and return that instead. Passing true as copy is equivalent to passing the Buffer itself. If copy is not a table, then it will be set as the first item in clear as long as it is not false.

While this may resemble Tɛmplet:Scribunto/helper, there are several differences, namely that this:

To obtain the key-value pairs left as empty strings in the previous copy op in a table, simply call this again such with value such that rawequal(clear, copy) is true; call :getParent() on this table returns clear (useful after leeaving the local scope which referenced clear).

Tɛmplet:Luaself

Resembling the reverse of Tɛmplet:Luaself, this calls Tɛmplet:Luaself on the Buffer's parent with the arguments given and appends the strung ancestor(s) to the current Buffer, which is returned.

The parent is unaffected by this operation and may still be retrieved via Tɛmplet:Luaself or re-appended again with this function.

Tɛmplet:Luaself

Returns parent Buffer, or, if none exists, creates a new Buffer and returns it as the adopted parent. As with Tɛmplet:Luaself, this does not automatically append the adoptive child to the new parent.

Pass a non-false value and this performs an op on the parent object.

If passed anything other than value (including nil), this requires that value names a function available to the parent object, which this calls and forwards the additional Tɛmplet:Luaself.

Pass only a table value which has no metatable and this forwards value to the parent which calls Tɛmplet:Luaself.

Given only a string starting with _ and naming a parent function, this calls it on the parent without arguments. Any other valid singular argument appends to the end of the parent Buffer.[note 11]

Tɛmplet:Luaself

Unsets Buffer parent reference.

If passed any args, they are forwarded to the current parent, if one exists, via Buffer:getParent as a "parting gift". In either case, returns the current Buffer.

This is not necessary for Tɛmplet:Scribunto/helper since Buffer parent references are weak. Rather, use this when it is desirable to assign a new parent via Buffer:getParent or, for example, to prevent the inclusion of an ancestor when passing Tɛmplet:Scribunto/helper as ops for functions such as Tɛmplet:Luaself (more useful when recycling Module:Buffer from another Module).

Tɛmplet:Luaself

Switches a Buffer to stream mode. While streaming, the __call metamethod will append values to the end of the Buffer instead of the usual op.

Aside from that, there is only one other function: Tɛmplet:Luaself. Any args passed to Buffer:stream are forwarded to that function for a reason that should be evident when you finish reading this very short section.

No special action is needed to exit this mode. The normal call to string op is restored upon the use of any regular Buffer function or any operation which coerces the Buffer into a string (e.g. the .. operator).

Stream-Buffer object

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

Stream-Buffer objects accept only one argument which they append if valid. That is, the op is a streamlined version of Tɛmplet:Luaself sans the pos and raw args.

This also exploits Tɛmplet:Scribunto/helper to append a series of string literals (and tables) with nothing between them (or only Tɛmplet:Scribunto/helper if desired).

For example, both A and B will produce identical strings:

local A = require'Module:Buffer':stream'A string of text may flow''with nothing between each string' 'or perhaps only a space'
	'or even tab and line-break characters''and continue to append individually''for use with a joiner'
local B = require'Module:Buffer':_'A string of text may flow':_'with nothing between each string' :_ 'or perhaps only a space'
	:_'or even tab and line-break characters':_'and continue to append individually':_'for use with a joiner'
mw.log(A==B, A:_str' ')
true	A string of text may flow with nothing between each string or perhaps only a space or even tab and line-break characters and continue to append individually for use with a joiner

Stream-Buffer:each

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

Appends an undetermined number of valid values to the Buffer object.[note 12]

If the above line gives you Déjà vu, that is because it is drawn from Tɛmplet:Scribunto/helper. However, unlike mw.html:wikitext, this does not stop at the first nil value.[note 13]

HTML library extension

[mali mi di yibu sheena n-niŋ]

Upon the first call to Tɛmplet:Luaself, Module:Buffer clones the Tɛmplet:Scribunto/helper, adding Module:Buffer's __eq and __concat metamethods along with a few additional functions.

Objects with this modified metatable are referred to as Buffer-HTML objects. Yet, though dressed in bells and whistles, they are only named with Buffer as an adverb since they lack most Buffer object functions.

In contrast, the Element-Buffer (returned by the function call on a Buffer-HTML object) is a true Buffer object with specialized "tricks" allowing complex structures to be built via both mw.html and Buffer object methods as well as through a builder that perhaps marries the best of both worlds.

Buffer functions for HTML

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

Accepts the same parameters as Tɛmplet:Scribunto/helper to create and return a modified mw.html object. As with Tɛmplet:Luaself, this does not append the child object to the parent Buffer and instead sets a Buffer-style parent reference.

An exception to the above is when chaining this to an Element-Buffer and such produces a selfClosing tag; when both conditions are met, this appends the tag and returns to the same Buffer.[note 14]

Unlike mw.html.create, if args has keys other than args.parent and args.selfClosing, it will pass for further processing through Tɛmplet:Luaself (a cousin of Tɛmplet:Luaself that handles mw.html functions). Moreover, if passed a table where mw.html.create expects tagName, this treats it as args instead.

Finally, this does not automatically set the mw.html.parent reference, making this an alternative to mw.html:tag

Tɛmplet:Luaself

Available only after Tɛmplet:Luaself is used the first time.

Accepts the same arguments as Tɛmplet:Luaself, however this instead return the last Buffer-HTML object ("lastHTML") created, or, if available, the lastHTML passed to any of the following functions:

Tɛmplet:Luaself

Available only after Tɛmplet:Luaself is used the first time.

This (re-)appends the last Buffer-HTML object to the current Buffer object. The raw and pos args are generally the same as those in Tɛmplet:Luaself.

When called with no arguments on an Element-Buffer, this appends lastHTML without string coercion. Be warned however that if the Element-Buffer belongs to lastHTML or one of its tags, such will cause an infinite loop, which can be avoided by passing an explicit nil to append lastHTML as a string.[note 15]

HTML object functions

[mali mi di yibu sheena n-niŋ]

Buffer-HTML objects may be used like any mw.html object. (In fact, merely replacing mw.html.create with require'Module:Buffer':_inHTML in an existing Module should produce the same output.)

Most mw.html functions are unchanged, except Tɛmplet:Scribunto/helper, Tɛmplet:Scribunto/helper, and Tɛmplet:Scribunto/helper are embedded in a wrapper function that checks whether they return a normal mw.html object. If so, switches the metatable to convert it to a Buffer-HTML object and sets a parent reference. [note 16]

As a side bonus, the .. may be used on Buffer-mw.html objects directly (no Tɛmplet:Scribunto/helper needed).

Buffer-HTML object

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

Call this object as a function to return its .nodes index[note 17], which this converts to an Tɛmplet:Luaself object, granting it the same metatable as regular Module:Buffer objects (as well as several additional "tricks") and assigning the Buffer-HTML as its parent Buffer.[note 18]

This takes one argument which is forwarded to its Element-Buffer. Tables pass to the specialized HTML builder Tɛmplet:Luaself. All other #valid values are appended to its Element-Buffer via Tɛmplet:Luaself.

Tɛmplet:TOC tab

You cannot chain call regular Buffer functions on a Buffer-HTML object; however, since mw.html functions cannot read Buffer-style parent references, modified versions of methods that return the parent Buffer are available to Buffer-HTML without having to call into the Element-Buffer. For convenience, Tɛmplet:Scribunto/helper is called automatically prior to the op, though after the lastHTML reference has been set for Tɛmplet:Luaself.[note 19]

Preferences are the seventy or so user options for browsing, editing, searching, notifications, and more. A link to your Preferences page is available at the top of every Wikipedia page when you have an account, alongside links to your other account services such as your Contributions. Another way to get there is by navigating to the Special:Preferences page.

Once at your Preferences page, you can control much of the Wikipedia user interface through the many feature settings provided by MediaWiki (the software of Wikipedia): skins, plug-ins, date formats, a signature, and more. For example, you can select to be prompted to enter an edit summary if you forget to. The Preferences page also presents a link to customize your CSS to adjust your page style details.

Plus, there are hundreds of user tools to explore, many listed at Wikipedia:Tools § Browsing and editing, that can override or tweak preferences provided by MediaWiki. Each account has its own Custom JavaScript page where the tools install themselves, and where you can help develop them.

At their site, MediaWiki maintains a browser compatibility matrix. The time you spend in getting an account, setting your preferences, finding tools and testing your browser (before you ever lose an edit) will pay off.

Feature requests can be made, and bugs reported, as described at Wikipedia:Phabricator. The current set of preferences are largely the result of issues raised by newcomers at places such as the Village pump, and driven by regulars who hold long discussions and collectively drive issues.

The Preferences page is accessible when you are logged-in, but you must have JavaScript enabled in your browser, since the page and all its tabs are an extensive JavaScript application.

You do not need to click Save on every tab on the Preferences page, as the Save button affects all changes on all Preferences tabs.[1] You can go from tab to tab setting all your preferences before saving, because Save remembers your changes on the other tabs. To forget unsaved changes, simply leave the page without saving. If you wish to undo your saved changes, you will need to reset them manually.

Clicking Restore all default settings will harmlessly load another page, which will then offer the button to reset all preferences in every tab to their default values. This includes a few items that are stored as a preference, but that aren't directly editable in Special:Preferences. If you do reset your preferences, you can restore your custom signature from the wikitext of a history page, update your custom CSS or JavaScript from Wikipedia:Tools § Browsing and editing, and then re-select and save your preferences.

The default settings are aimed at newcomers editing articles. Intermediate editors tend to activate more features, such as "warn me if I forgot an edit summary", and advanced editors and administrators use the special settings, gadgets, and editors for their tasks.

You have the same username and password on sister projects such as Wiktionary, at MediaWiki.org itself, and on the Wikipedia of other languages. Each of your account's preferences are independent because each wiki is a website, with their own administration (namespaces, settings, accounts, etc.). Even the word "Preferences" on the top may be set differently! On the Simple English Wikipedia, it says "My settings".

Preferences → User profile → Details = meta:Help:Preferences#User profile
  • Lists your account details and the number of edits you have made.
  • Allows you to view/manage your global account info.
  • Provides a link to change your password.

Internationalisation

[mali mi di yibu sheena n-niŋ]
  • Change the language of user-interface messages. It does not affect articles and other pages made by editors. Note that many interface messages have been customized at the English Wikipedia but usually only for the default "en - English" which may for example add links to relevant help pages, processes and policies. Editors are discouraged from selecting "en-GB - British English" or "en-CA - Canadian English", which make a few spelling changes but omit many useful customizations.[2] Foreign languages also omit customizations but may be preferred by users with poor English abilities.
  • Specify your preferred pronoun in order for the software to grammatically refer to you correctly. This is also visible to other users via certain tools, such as the they template and Navigation popups.
  • More language settings: allows you to set the language in which Wikipedia menus and fonts are displayed; additionally, an option to set the language you edit in (input tools must be enabled).
  • Displays the signature that will appear when you sign talk pages.
  • Allows you to edit the signature, either using wiki markup (the option must be checked), or just plain text.
  • An option to provide an email address. Although this is optional, please read the warning about losing your password and not having an email address on file.
  • Options about use of your email address: enabling email from other users, sending copies of emails you send to other users, and receiving email when a page or file on your watchlist is changed.
  • Before using email you must confirm your email address. See Help:Email confirmation
  • "Email me when a page or file on my watchlist is changed", see Help:Email notification
See Wikipedia:Growth Team features § Newcomer homepage
Preferences → Appearance → Details = meta:Help:Preferences#Appearance

Change the web browser experience.

  • Choose the "skin", or "theme" of how Wikipedia is displayed.
  • Access your Custom CSS or Custom JavaScript for individual skins and for global settings that apply to all skins. If the links are blue, you have created these special pages and this is a quick way to access and edit them. If the links are red, clicking the link will create the special page. You can also access your cross-wiki CSS and JavaScript pages from this section, but the color of the links will always be that of external links.

Reading Preferences

[mali mi di yibu sheena n-niŋ]
  • Option to set your date and time preferences; this is how dates will appear in article History pages, logs, etc. If set to "No preference", the format is HH:MM, DD MMMM YYYY (UTC), for example: 15:24, 22 Silimin gɔli December 2024 (UTC).
  • Shows the server time (UTC) and the local time based on the optional Time zone setting. You may opt to use the server time (UTC), have the offset calculated by the clock in your computer, or specify an offset from UTC in hours or by location.
  • This does not affect times saved in editable pages, such as timestamps in signatures. For that, see Wikipedia:Comments in Local Time.
  • The images in an article are just a thumbnail (a preview). These will always be one of eight possible Thumbnail sizes. For the larger screen sizes choose the maximum, and for the smaller screen sizes choose the minimum thumbnail size. The default 220px is a midrange thumbnail-size. Have you changed your font size? Then you should match that font size to your chosen thumbnail size to increase caption readability.
  • While viewing an article, if you click a thumbnail you will activate Media Viewer. Media Viewer is JavaScript, and it uses processing resources. It loads all the images in the article at high resolution, and this uses networking resources. This is the default. You can turn off Media Viewer to save resources: 1) to control all image sizing, 2) to navigate directly to a file page (instead) when you click on a thumbnail.
  • You can target the Image size limit of the file page main image, (displayed in the front matter). On a faster network choose a larger size, and on a slower network choose a smaller Image size limit. The default 800×600px is a midrange Image size limit. File pages are on Commons wiki, and if logged in there, going there overrides your settings here.
  • Note that you can both turn off Media Viewer and set a small Image size limit, and yet you will not limit your ability to avail yourself of any high resolution images listed at the bottom of that file page, when wanted. Doing so you can get full manual control of any unwanted, automatic bogging-down of your surfing speed caused by automated choices concerning File namespace interactions initiated by clicking on an image.
  • Option to not show page content below the diffs; checking this will suppress the page preview of the difference you're viewing.
  • Option to omit a diff after performing a rollback
  • Choose to display hyperlinks with underlines in your browser window always, never, or by browser or Wikipedia-skin default.
  • Format links as stub links when the article they link to is smaller than the threshold you set on file size. Stub link formatting changes the link color to the dark brown displayed in this option's text. This option can help you see links to small articles (more likely to be stubs) so that you might expand them. It is also useful for spotting links to disambiguation pages, which are also relatively small. They are usually linked to in error, but often contain on their list a link to the correct article, making this error easy to fix.
  • Show hidden categories.
Preferences → Editing → Details = meta:Help:Preferences#Editing

Concerning the edit page, its initiation, and look and feel, Wikipedia offers a high number of options. Some of them are:

  • "Teemi ma n yi ti bi sabi lahabali jia (bee din pun ku bɛni ka labisim lahabali ji' maa)" into the database. (Habit-forming.)
  • "Enable VisualEditor". Get a word processor interface. No markup language at all.
  • "Wuhimi johi lihi amaa ka di pa a lan yɛn labimi yooi". Get a dynamic web page. Browser reloading now gives a glimpse at the live original without having to leave the edit page. And there is no longer any need to create an entirely new page for each preview requested; live preview just reloads parts of its page, and so it offers no browser history backwards, but disturbs no history forward either. Saves some network bandwidth and lots of browser cache. Just save your edits before disabling JavaScript.[3] (First-time users should perform a simple compatibility test.[4])

The font size for the edit box can be set in Wikipedia editing preferences or in the browser. In Firefox, there are two font-size settings at Options → Content → "Default font" Advanced…, one for the edit box, and one for the rest of the page. If you just want uniformity, check to see if it allows Wikipedia to choose its own font; then you set Wikipedia's "Edit Area Font Style" to "Serif" or "Sans Serif", and the font size in the edit box will match the rest of the page.

The number of rows in the edit box is no longer set in preferences. For a temporary change, when the edit box is displayed, drag up or down the small square in the bottom right corner of the edit box. Alternatively, make the change stick by adding this line to your CSS file (in Preferences, Appearance), usually Special:MyPage/common.css:

#wpTextbox1 {height: 25em;}

where 25em is an example (and typical), height.

Two editing toolbars are offered that will span the top of the edit box. (Wikipedia:Reftoolbar shows versions.)

To use more of your favorite text editor instead of just the edit box and toolbars, see Wikipedia:Text editor support. Also see the Gadgets tab.

Preferences → Recent changes → Display options & Advanced options = meta:Help:Preferences#Recent changes

Recent changes refer to changes of pages in the database. Every time a wiki page is edited, and changes were actually made, a record is kept of the difference. For example, a page history shows the revisions for that particular page. But recent changes can report on more than just the revisions of a page, or an entire wiki, they can also report on the recent changes of an editor (their contributions). The user preferences for recent changes are the style in which these lists of revisions will appear:

  • Length of the list
  • Time window of the list
  • Grouping methods of the list

The watchlist has even more finely tuned preferences, because like the edit window, it is often a core tool for editors.

More information about these various histories can be found at the following places. For global changes to Wikipedia pages, see Help:Recent changes. For user contributions, see Help:User contributions. For page histories, see Help:Page history. For other types of logs see Help:Log.

Preferences → Recent changes → Pending changes = meta:Help:Preferences#Pending changes/Edit review

These settings are for advanced editors who have a detailed understanding of the five pillars and of the templates used to mark judgments on the page. Pending changes refers to the style of the presentation of

  • new page "curation" tools: curation toolbar and new pages feed, and
  • how recent changes appear on the page history of certain pages that have been configured for protection by reviewing any changes before they are applied to the public version of the page.

For an example of a page history showing the pending changes feature, click on the history of a page listed at Special:PendingChanges.

Preferences → Watchlist → Details = meta:Help:Preferences#Watchlist

The watchlist options include which pages, and what "recent" means to you. If your Preferences has "Email me when a page or file on my watchlist is changed" set (at the bottom of the "User profile" tab), then only by visiting a page will you actually set its email notification flag. Once you miss the email for a particular page change or don't visit the page (or ignore the email), you will not receive any more emails for that page. You can still dutifully monitor that page by its watchlist edit-summaries, but its particular email notification flag will remain unset until you visit it. This facilitates monitoring a large watchlist while preventing potentially useless emails to you.

In case you want to set all email notifications anyway, you can at any time mark all pages "visited". If your Preferences → Gadgets has "Display pages on your watchlist that have changed since your last visit in bold", then your watchlist will have a button labeled "Mark all pages visited". That button will effectively set all of your email notification flags.

Preferences → Notifications

These settings alter the Special:Notifications tool. The options for Notifications were first added in May 2013. See Wikipedia Signpost topic "English-language Wikipedia to be first to receive Echo deployment" for a brief overview.

For a full explanation of the specific preferences, see Wikipedia:Notifications § Preferences and settings.

Email options
  • Choose whether to opt-in or opt-out of email notifications (you must confirm your email address on your Preferences → User profile → Email options). You can also choose how often to receive email notifications, from single emails for each event to daily or weekly digests.
  • Choose whether to receive plain text or HTML email.
Notify me about these events

You can enable (or disable) individual types of notifications by checking (or unchecking) the boxes next to it. You can enable (or disable) notifications on the web or by email for most notification types (note that some notifications cannot be disabled, such as changes to your user rights or new talk page messages: these notifications are too important to be dismissed).

Wikipedia:Notifications § Types of notifications has a general list of the types of notifications. Special:DisplayNotificationsConfiguration lists all notification types available and how they are configured.

Muted users

You can mute on-site notifications from individual users by enter their username into the box. You will still receive notifications if a muted user writes on your user talk page or reviews a page you have created. The muted user will still receive a successful mention notification, if they've enabled that preference.

Muting pages

You can mute "page linked" notifications for specific pages by typing each page's name into the box.

Preferences → Gadgets → Details = Wikipedia:Gadget#Currently installed gadgets

Gadgets are the software contributed by users, not the software that runs Wikipedia, and so you'll see the group names Editing and Appearance are the same as the tab names on the preferences page. If you see tabs on the preferences page your web-browsers already has JavaScript enabled. The gadgets go through an authoritative process before they appear on the list. There are gadgets for, browsing, editing, appearance and for compatibility. A general overview of the select gadgetry available there is as follows.

Browsing
  • Language translating
  • Media files, search results, and diffs
  • Twinkle admin tools for the advancing editor
  • Teahouse for the new editor question
  • Mousing over or hovering over an inline citation to read it
Editing
  • Citation modifying/expediting/proving
  • Colorizing wikitext; Character toolsets
  • Categorizing; Reviewing new articles; Filing disputes
  • The Wiki Editor, WikEd, and WikEdDiff
Appearance
  • Editing the introductory section.
  • Admin tools; Changing and adding to page layouts and controls
  • Displaying diffs, or animations, or your very own local time on all timestamps
  • Enabling an external search engine for searching Wikipedia
  • Show the assessed class of an article, Featured, A, B, C, etc.
  • Justifying paragraphs
Compatibility
  • Font and JavaScript support
Advanced
  • Regular expression tools
  • Tracking software bugs
  • Patrolling recent changes

See much more customization available in the pages in the See also section, such as a search and replace dialog that understands JavaScript regular expressions.

Preferences → Beta features → Details = mw:Beta Features

Beta Features is a way for users to test new features on Wikipedia and other Wikimedia sites before they are released for everyone.

The MediaWiki preferences page offers a set of options for the generic user. If you discover a special role on Wikipedia, there is probably a powerful tool for it at Wikipedia:Tools § Browsing and editing.

Operating an account with a tool may carry side effects, such as popups, toolbars and frame objects on your browsing or editing page space that are sometimes burdensome, yet sometimes powerfully necessary. Rather than uninstalling, it is possible to just switch skins, because there are four skins, each with a pair of customizations. 1) Custom JavaScript has the tools. 2) Custom CSS can carry over your preferred fonts, colors, and frame borders to each skin, no matter what tools that skin may also be loaded with.

  1. It is true that each tab will create a URL in the browser history, but these URLs do not represent historical differences in the JavaScript instance that loaded with the Preferences page itself. The per-tab URLs only purpose is to serve the browser's back- and forward-navigation.
  2. Wikipedia:Village pump (proposals)/Archive 184#Discourage en-xx UI variants
  3. If you disable JavaScript for any page on MediaWiki.org or Wikipedia.org, you will lose all unsaved edits in all tabs; yet disabling JavaScript is a common troubleshooting technique when diagnosing some preference-related browser behaviors.
  4. The danger in using Live preview is on first use with an incompatible browser. Try a simple test: make a change to the edit box, then reload the page.
  5. Compiled by the Mozilla Contributors.

!

Preferences are the seventy or so user options for browsing, editing, searching, notifications, and more. A link to your Preferences page is available at the top of every Wikipedia page when you have an account, alongside links to your other account services such as your Contributions. Another way to get there is by navigating to the Special:Preferences page.

Once at your Preferences page, you can control much of the Wikipedia user interface through the many feature settings provided by MediaWiki (the software of Wikipedia): skins, plug-ins, date formats, a signature, and more. For example, you can select to be prompted to enter an edit summary if you forget to. The Preferences page also presents a link to customize your CSS to adjust your page style details.

Plus, there are hundreds of user tools to explore, many listed at Wikipedia:Tools § Browsing and editing, that can override or tweak preferences provided by MediaWiki. Each account has its own Custom JavaScript page where the tools install themselves, and where you can help develop them.

At their site, MediaWiki maintains a browser compatibility matrix. The time you spend in getting an account, setting your preferences, finding tools and testing your browser (before you ever lose an edit) will pay off.

Feature requests can be made, and bugs reported, as described at Wikipedia:Phabricator. The current set of preferences are largely the result of issues raised by newcomers at places such as the Village pump, and driven by regulars who hold long discussions and collectively drive issues.

The Preferences page is accessible when you are logged-in, but you must have JavaScript enabled in your browser, since the page and all its tabs are an extensive JavaScript application.

You do not need to click Save on every tab on the Preferences page, as the Save button affects all changes on all Preferences tabs.[1] You can go from tab to tab setting all your preferences before saving, because Save remembers your changes on the other tabs. To forget unsaved changes, simply leave the page without saving. If you wish to undo your saved changes, you will need to reset them manually.

Clicking Restore all default settings will harmlessly load another page, which will then offer the button to reset all preferences in every tab to their default values. This includes a few items that are stored as a preference, but that aren't directly editable in Special:Preferences. If you do reset your preferences, you can restore your custom signature from the wikitext of a history page, update your custom CSS or JavaScript from Wikipedia:Tools § Browsing and editing, and then re-select and save your preferences.

The default settings are aimed at newcomers editing articles. Intermediate editors tend to activate more features, such as "warn me if I forgot an edit summary", and advanced editors and administrators use the special settings, gadgets, and editors for their tasks.

You have the same username and password on sister projects such as Wiktionary, at MediaWiki.org itself, and on the Wikipedia of other languages. Each of your account's preferences are independent because each wiki is a website, with their own administration (namespaces, settings, accounts, etc.). Even the word "Preferences" on the top may be set differently! On the Simple English Wikipedia, it says "My settings".

Preferences → User profile → Details = meta:Help:Preferences#User profile
  • Lists your account details and the number of edits you have made.
  • Allows you to view/manage your global account info.
  • Provides a link to change your password.

Internationalisation

[mali mi di yibu sheena n-niŋ]
  • Change the language of user-interface messages. It does not affect articles and other pages made by editors. Note that many interface messages have been customized at the English Wikipedia but usually only for the default "en - English" which may for example add links to relevant help pages, processes and policies. Editors are discouraged from selecting "en-GB - British English" or "en-CA - Canadian English", which make a few spelling changes but omit many useful customizations.[2] Foreign languages also omit customizations but may be preferred by users with poor English abilities.
  • Specify your preferred pronoun in order for the software to grammatically refer to you correctly. This is also visible to other users via certain tools, such as the they template and Navigation popups.
  • More language settings: allows you to set the language in which Wikipedia menus and fonts are displayed; additionally, an option to set the language you edit in (input tools must be enabled).
  • Displays the signature that will appear when you sign talk pages.
  • Allows you to edit the signature, either using wiki markup (the option must be checked), or just plain text.
  • An option to provide an email address. Although this is optional, please read the warning about losing your password and not having an email address on file.
  • Options about use of your email address: enabling email from other users, sending copies of emails you send to other users, and receiving email when a page or file on your watchlist is changed.
  • Before using email you must confirm your email address. See Help:Email confirmation
  • "Email me when a page or file on my watchlist is changed", see Help:Email notification
See Wikipedia:Growth Team features § Newcomer homepage
Preferences → Appearance → Details = meta:Help:Preferences#Appearance

Change the web browser experience.

  • Choose the "skin", or "theme" of how Wikipedia is displayed.
  • Access your Custom CSS or Custom JavaScript for individual skins and for global settings that apply to all skins. If the links are blue, you have created these special pages and this is a quick way to access and edit them. If the links are red, clicking the link will create the special page. You can also access your cross-wiki CSS and JavaScript pages from this section, but the color of the links will always be that of external links.

Reading Preferences

[mali mi di yibu sheena n-niŋ]
  • Option to set your date and time preferences; this is how dates will appear in article History pages, logs, etc. If set to "No preference", the format is HH:MM, DD MMMM YYYY (UTC), for example: 15:24, 22 Silimin gɔli December 2024 (UTC).
  • Shows the server time (UTC) and the local time based on the optional Time zone setting. You may opt to use the server time (UTC), have the offset calculated by the clock in your computer, or specify an offset from UTC in hours or by location.
  • This does not affect times saved in editable pages, such as timestamps in signatures. For that, see Wikipedia:Comments in Local Time.
  • The images in an article are just a thumbnail (a preview). These will always be one of eight possible Thumbnail sizes. For the larger screen sizes choose the maximum, and for the smaller screen sizes choose the minimum thumbnail size. The default 220px is a midrange thumbnail-size. Have you changed your font size? Then you should match that font size to your chosen thumbnail size to increase caption readability.
  • While viewing an article, if you click a thumbnail you will activate Media Viewer. Media Viewer is JavaScript, and it uses processing resources. It loads all the images in the article at high resolution, and this uses networking resources. This is the default. You can turn off Media Viewer to save resources: 1) to control all image sizing, 2) to navigate directly to a file page (instead) when you click on a thumbnail.
  • You can target the Image size limit of the file page main image, (displayed in the front matter). On a faster network choose a larger size, and on a slower network choose a smaller Image size limit. The default 800×600px is a midrange Image size limit. File pages are on Commons wiki, and if logged in there, going there overrides your settings here.
  • Note that you can both turn off Media Viewer and set a small Image size limit, and yet you will not limit your ability to avail yourself of any high resolution images listed at the bottom of that file page, when wanted. Doing so you can get full manual control of any unwanted, automatic bogging-down of your surfing speed caused by automated choices concerning File namespace interactions initiated by clicking on an image.
  • Option to not show page content below the diffs; checking this will suppress the page preview of the difference you're viewing.
  • Option to omit a diff after performing a rollback
  • Choose to display hyperlinks with underlines in your browser window always, never, or by browser or Wikipedia-skin default.
  • Format links as stub links when the article they link to is smaller than the threshold you set on file size. Stub link formatting changes the link color to the dark brown displayed in this option's text. This option can help you see links to small articles (more likely to be stubs) so that you might expand them. It is also useful for spotting links to disambiguation pages, which are also relatively small. They are usually linked to in error, but often contain on their list a link to the correct article, making this error easy to fix.
  • Show hidden categories.
Preferences → Editing → Details = meta:Help:Preferences#Editing

Concerning the edit page, its initiation, and look and feel, Wikipedia offers a high number of options. Some of them are:

  • "Teemi ma n yi ti bi sabi lahabali jia (bee din pun ku bɛni ka labisim lahabali ji' maa)" into the database. (Habit-forming.)
  • "Enable VisualEditor". Get a word processor interface. No markup language at all.
  • "Wuhimi johi lihi amaa ka di pa a lan yɛn labimi yooi". Get a dynamic web page. Browser reloading now gives a glimpse at the live original without having to leave the edit page. And there is no longer any need to create an entirely new page for each preview requested; live preview just reloads parts of its page, and so it offers no browser history backwards, but disturbs no history forward either. Saves some network bandwidth and lots of browser cache. Just save your edits before disabling JavaScript.[3] (First-time users should perform a simple compatibility test.[4])

The font size for the edit box can be set in Wikipedia editing preferences or in the browser. In Firefox, there are two font-size settings at Options → Content → "Default font" Advanced…, one for the edit box, and one for the rest of the page. If you just want uniformity, check to see if it allows Wikipedia to choose its own font; then you set Wikipedia's "Edit Area Font Style" to "Serif" or "Sans Serif", and the font size in the edit box will match the rest of the page.

The number of rows in the edit box is no longer set in preferences. For a temporary change, when the edit box is displayed, drag up or down the small square in the bottom right corner of the edit box. Alternatively, make the change stick by adding this line to your CSS file (in Preferences, Appearance), usually Special:MyPage/common.css:

#wpTextbox1 {height: 25em;}

where 25em is an example (and typical), height.

Two editing toolbars are offered that will span the top of the edit box. (Wikipedia:Reftoolbar shows versions.)

To use more of your favorite text editor instead of just the edit box and toolbars, see Wikipedia:Text editor support. Also see the Gadgets tab.

Preferences → Recent changes → Display options & Advanced options = meta:Help:Preferences#Recent changes

Recent changes refer to changes of pages in the database. Every time a wiki page is edited, and changes were actually made, a record is kept of the difference. For example, a page history shows the revisions for that particular page. But recent changes can report on more than just the revisions of a page, or an entire wiki, they can also report on the recent changes of an editor (their contributions). The user preferences for recent changes are the style in which these lists of revisions will appear:

  • Length of the list
  • Time window of the list
  • Grouping methods of the list

The watchlist has even more finely tuned preferences, because like the edit window, it is often a core tool for editors.

More information about these various histories can be found at the following places. For global changes to Wikipedia pages, see Help:Recent changes. For user contributions, see Help:User contributions. For page histories, see Help:Page history. For other types of logs see Help:Log.

Preferences → Recent changes → Pending changes = meta:Help:Preferences#Pending changes/Edit review

These settings are for advanced editors who have a detailed understanding of the five pillars and of the templates used to mark judgments on the page. Pending changes refers to the style of the presentation of

  • new page "curation" tools: curation toolbar and new pages feed, and
  • how recent changes appear on the page history of certain pages that have been configured for protection by reviewing any changes before they are applied to the public version of the page.

For an example of a page history showing the pending changes feature, click on the history of a page listed at Special:PendingChanges.

Preferences → Watchlist → Details = meta:Help:Preferences#Watchlist

The watchlist options include which pages, and what "recent" means to you. If your Preferences has "Email me when a page or file on my watchlist is changed" set (at the bottom of the "User profile" tab), then only by visiting a page will you actually set its email notification flag. Once you miss the email for a particular page change or don't visit the page (or ignore the email), you will not receive any more emails for that page. You can still dutifully monitor that page by its watchlist edit-summaries, but its particular email notification flag will remain unset until you visit it. This facilitates monitoring a large watchlist while preventing potentially useless emails to you.

In case you want to set all email notifications anyway, you can at any time mark all pages "visited". If your Preferences → Gadgets has "Display pages on your watchlist that have changed since your last visit in bold", then your watchlist will have a button labeled "Mark all pages visited". That button will effectively set all of your email notification flags.

Preferences → Notifications

These settings alter the Special:Notifications tool. The options for Notifications were first added in May 2013. See Wikipedia Signpost topic "English-language Wikipedia to be first to receive Echo deployment" for a brief overview.

For a full explanation of the specific preferences, see Wikipedia:Notifications § Preferences and settings.

Email options
  • Choose whether to opt-in or opt-out of email notifications (you must confirm your email address on your Preferences → User profile → Email options). You can also choose how often to receive email notifications, from single emails for each event to daily or weekly digests.
  • Choose whether to receive plain text or HTML email.
Notify me about these events

You can enable (or disable) individual types of notifications by checking (or unchecking) the boxes next to it. You can enable (or disable) notifications on the web or by email for most notification types (note that some notifications cannot be disabled, such as changes to your user rights or new talk page messages: these notifications are too important to be dismissed).

Wikipedia:Notifications § Types of notifications has a general list of the types of notifications. Special:DisplayNotificationsConfiguration lists all notification types available and how they are configured.

Muted users

You can mute on-site notifications from individual users by enter their username into the box. You will still receive notifications if a muted user writes on your user talk page or reviews a page you have created. The muted user will still receive a successful mention notification, if they've enabled that preference.

Muting pages

You can mute "page linked" notifications for specific pages by typing each page's name into the box.

Preferences → Gadgets → Details = Wikipedia:Gadget#Currently installed gadgets

Gadgets are the software contributed by users, not the software that runs Wikipedia, and so you'll see the group names Editing and Appearance are the same as the tab names on the preferences page. If you see tabs on the preferences page your web-browsers already has JavaScript enabled. The gadgets go through an authoritative process before they appear on the list. There are gadgets for, browsing, editing, appearance and for compatibility. A general overview of the select gadgetry available there is as follows.

Browsing
  • Language translating
  • Media files, search results, and diffs
  • Twinkle admin tools for the advancing editor
  • Teahouse for the new editor question
  • Mousing over or hovering over an inline citation to read it
Editing
  • Citation modifying/expediting/proving
  • Colorizing wikitext; Character toolsets
  • Categorizing; Reviewing new articles; Filing disputes
  • The Wiki Editor, WikEd, and WikEdDiff
Appearance
  • Editing the introductory section.
  • Admin tools; Changing and adding to page layouts and controls
  • Displaying diffs, or animations, or your very own local time on all timestamps
  • Enabling an external search engine for searching Wikipedia
  • Show the assessed class of an article, Featured, A, B, C, etc.
  • Justifying paragraphs
Compatibility
  • Font and JavaScript support
Advanced
  • Regular expression tools
  • Tracking software bugs
  • Patrolling recent changes

See much more customization available in the pages in the See also section, such as a search and replace dialog that understands JavaScript regular expressions.

Preferences → Beta features → Details = mw:Beta Features

Beta Features is a way for users to test new features on Wikipedia and other Wikimedia sites before they are released for everyone.

The MediaWiki preferences page offers a set of options for the generic user. If you discover a special role on Wikipedia, there is probably a powerful tool for it at Wikipedia:Tools § Browsing and editing.

Operating an account with a tool may carry side effects, such as popups, toolbars and frame objects on your browsing or editing page space that are sometimes burdensome, yet sometimes powerfully necessary. Rather than uninstalling, it is possible to just switch skins, because there are four skins, each with a pair of customizations. 1) Custom JavaScript has the tools. 2) Custom CSS can carry over your preferred fonts, colors, and frame borders to each skin, no matter what tools that skin may also be loaded with.

  1. It is true that each tab will create a URL in the browser history, but these URLs do not represent historical differences in the JavaScript instance that loaded with the Preferences page itself. The per-tab URLs only purpose is to serve the browser's back- and forward-navigation.
  2. Wikipedia:Village pump (proposals)/Archive 184#Discourage en-xx UI variants
  3. If you disable JavaScript for any page on MediaWiki.org or Wikipedia.org, you will lose all unsaved edits in all tabs; yet disabling JavaScript is a common troubleshooting technique when diagnosing some preference-related browser behaviors.
  4. The danger in using Live preview is on first use with an incompatible browser. Try a simple test: make a change to the edit box, then reload the page.
  5. Compiled by the Mozilla Contributors.

!

Preferences are the seventy or so user options for browsing, editing, searching, notifications, and more. A link to your Preferences page is available at the top of every Wikipedia page when you have an account, alongside links to your other account services such as your Contributions. Another way to get there is by navigating to the Special:Preferences page.

Once at your Preferences page, you can control much of the Wikipedia user interface through the many feature settings provided by MediaWiki (the software of Wikipedia): skins, plug-ins, date formats, a signature, and more. For example, you can select to be prompted to enter an edit summary if you forget to. The Preferences page also presents a link to customize your CSS to adjust your page style details.

Plus, there are hundreds of user tools to explore, many listed at Wikipedia:Tools § Browsing and editing, that can override or tweak preferences provided by MediaWiki. Each account has its own Custom JavaScript page where the tools install themselves, and where you can help develop them.

At their site, MediaWiki maintains a browser compatibility matrix. The time you spend in getting an account, setting your preferences, finding tools and testing your browser (before you ever lose an edit) will pay off.

Feature requests can be made, and bugs reported, as described at Wikipedia:Phabricator. The current set of preferences are largely the result of issues raised by newcomers at places such as the Village pump, and driven by regulars who hold long discussions and collectively drive issues.

The Preferences page is accessible when you are logged-in, but you must have JavaScript enabled in your browser, since the page and all its tabs are an extensive JavaScript application.

You do not need to click Save on every tab on the Preferences page, as the Save button affects all changes on all Preferences tabs.[1] You can go from tab to tab setting all your preferences before saving, because Save remembers your changes on the other tabs. To forget unsaved changes, simply leave the page without saving. If you wish to undo your saved changes, you will need to reset them manually.

Clicking Restore all default settings will harmlessly load another page, which will then offer the button to reset all preferences in every tab to their default values. This includes a few items that are stored as a preference, but that aren't directly editable in Special:Preferences. If you do reset your preferences, you can restore your custom signature from the wikitext of a history page, update your custom CSS or JavaScript from Wikipedia:Tools § Browsing and editing, and then re-select and save your preferences.

The default settings are aimed at newcomers editing articles. Intermediate editors tend to activate more features, such as "warn me if I forgot an edit summary", and advanced editors and administrators use the special settings, gadgets, and editors for their tasks.

You have the same username and password on sister projects such as Wiktionary, at MediaWiki.org itself, and on the Wikipedia of other languages. Each of your account's preferences are independent because each wiki is a website, with their own administration (namespaces, settings, accounts, etc.). Even the word "Preferences" on the top may be set differently! On the Simple English Wikipedia, it says "My settings".

Preferences → User profile → Details = meta:Help:Preferences#User profile
  • Lists your account details and the number of edits you have made.
  • Allows you to view/manage your global account info.
  • Provides a link to change your password.

Internationalisation

[mali mi di yibu sheena n-niŋ]
  • Change the language of user-interface messages. It does not affect articles and other pages made by editors. Note that many interface messages have been customized at the English Wikipedia but usually only for the default "en - English" which may for example add links to relevant help pages, processes and policies. Editors are discouraged from selecting "en-GB - British English" or "en-CA - Canadian English", which make a few spelling changes but omit many useful customizations.[2] Foreign languages also omit customizations but may be preferred by users with poor English abilities.
  • Specify your preferred pronoun in order for the software to grammatically refer to you correctly. This is also visible to other users via certain tools, such as the they template and Navigation popups.
  • More language settings: allows you to set the language in which Wikipedia menus and fonts are displayed; additionally, an option to set the language you edit in (input tools must be enabled).
  • Displays the signature that will appear when you sign talk pages.
  • Allows you to edit the signature, either using wiki markup (the option must be checked), or just plain text.
  • An option to provide an email address. Although this is optional, please read the warning about losing your password and not having an email address on file.
  • Options about use of your email address: enabling email from other users, sending copies of emails you send to other users, and receiving email when a page or file on your watchlist is changed.
  • Before using email you must confirm your email address. See Help:Email confirmation
  • "Email me when a page or file on my watchlist is changed", see Help:Email notification
See Wikipedia:Growth Team features § Newcomer homepage
Preferences → Appearance → Details = meta:Help:Preferences#Appearance

Change the web browser experience.

  • Choose the "skin", or "theme" of how Wikipedia is displayed.
  • Access your Custom CSS or Custom JavaScript for individual skins and for global settings that apply to all skins. If the links are blue, you have created these special pages and this is a quick way to access and edit them. If the links are red, clicking the link will create the special page. You can also access your cross-wiki CSS and JavaScript pages from this section, but the color of the links will always be that of external links.

Reading Preferences

[mali mi di yibu sheena n-niŋ]
  • Option to set your date and time preferences; this is how dates will appear in article History pages, logs, etc. If set to "No preference", the format is HH:MM, DD MMMM YYYY (UTC), for example: 15:24, 22 Silimin gɔli December 2024 (UTC).
  • Shows the server time (UTC) and the local time based on the optional Time zone setting. You may opt to use the server time (UTC), have the offset calculated by the clock in your computer, or specify an offset from UTC in hours or by location.
  • This does not affect times saved in editable pages, such as timestamps in signatures. For that, see Wikipedia:Comments in Local Time.
  • The images in an article are just a thumbnail (a preview). These will always be one of eight possible Thumbnail sizes. For the larger screen sizes choose the maximum, and for the smaller screen sizes choose the minimum thumbnail size. The default 220px is a midrange thumbnail-size. Have you changed your font size? Then you should match that font size to your chosen thumbnail size to increase caption readability.
  • While viewing an article, if you click a thumbnail you will activate Media Viewer. Media Viewer is JavaScript, and it uses processing resources. It loads all the images in the article at high resolution, and this uses networking resources. This is the default. You can turn off Media Viewer to save resources: 1) to control all image sizing, 2) to navigate directly to a file page (instead) when you click on a thumbnail.
  • You can target the Image size limit of the file page main image, (displayed in the front matter). On a faster network choose a larger size, and on a slower network choose a smaller Image size limit. The default 800×600px is a midrange Image size limit. File pages are on Commons wiki, and if logged in there, going there overrides your settings here.
  • Note that you can both turn off Media Viewer and set a small Image size limit, and yet you will not limit your ability to avail yourself of any high resolution images listed at the bottom of that file page, when wanted. Doing so you can get full manual control of any unwanted, automatic bogging-down of your surfing speed caused by automated choices concerning File namespace interactions initiated by clicking on an image.
  • Option to not show page content below the diffs; checking this will suppress the page preview of the difference you're viewing.
  • Option to omit a diff after performing a rollback
  • Choose to display hyperlinks with underlines in your browser window always, never, or by browser or Wikipedia-skin default.
  • Format links as stub links when the article they link to is smaller than the threshold you set on file size. Stub link formatting changes the link color to the dark brown displayed in this option's text. This option can help you see links to small articles (more likely to be stubs) so that you might expand them. It is also useful for spotting links to disambiguation pages, which are also relatively small. They are usually linked to in error, but often contain on their list a link to the correct article, making this error easy to fix.
  • Show hidden categories.
Preferences → Editing → Details = meta:Help:Preferences#Editing

Concerning the edit page, its initiation, and look and feel, Wikipedia offers a high number of options. Some of them are:

  • "Teemi ma n yi ti bi sabi lahabali jia (bee din pun ku bɛni ka labisim lahabali ji' maa)" into the database. (Habit-forming.)
  • "Enable VisualEditor". Get a word processor interface. No markup language at all.
  • "Wuhimi johi lihi amaa ka di pa a lan yɛn labimi yooi". Get a dynamic web page. Browser reloading now gives a glimpse at the live original without having to leave the edit page. And there is no longer any need to create an entirely new page for each preview requested; live preview just reloads parts of its page, and so it offers no browser history backwards, but disturbs no history forward either. Saves some network bandwidth and lots of browser cache. Just save your edits before disabling JavaScript.[3] (First-time users should perform a simple compatibility test.[4])

The font size for the edit box can be set in Wikipedia editing preferences or in the browser. In Firefox, there are two font-size settings at Options → Content → "Default font" Advanced…, one for the edit box, and one for the rest of the page. If you just want uniformity, check to see if it allows Wikipedia to choose its own font; then you set Wikipedia's "Edit Area Font Style" to "Serif" or "Sans Serif", and the font size in the edit box will match the rest of the page.

The number of rows in the edit box is no longer set in preferences. For a temporary change, when the edit box is displayed, drag up or down the small square in the bottom right corner of the edit box. Alternatively, make the change stick by adding this line to your CSS file (in Preferences, Appearance), usually Special:MyPage/common.css:

#wpTextbox1 {height: 25em;}

where 25em is an example (and typical), height.

Two editing toolbars are offered that will span the top of the edit box. (Wikipedia:Reftoolbar shows versions.)

To use more of your favorite text editor instead of just the edit box and toolbars, see Wikipedia:Text editor support. Also see the Gadgets tab.

Preferences → Recent changes → Display options & Advanced options = meta:Help:Preferences#Recent changes

Recent changes refer to changes of pages in the database. Every time a wiki page is edited, and changes were actually made, a record is kept of the difference. For example, a page history shows the revisions for that particular page. But recent changes can report on more than just the revisions of a page, or an entire wiki, they can also report on the recent changes of an editor (their contributions). The user preferences for recent changes are the style in which these lists of revisions will appear:

  • Length of the list
  • Time window of the list
  • Grouping methods of the list

The watchlist has even more finely tuned preferences, because like the edit window, it is often a core tool for editors.

More information about these various histories can be found at the following places. For global changes to Wikipedia pages, see Help:Recent changes. For user contributions, see Help:User contributions. For page histories, see Help:Page history. For other types of logs see Help:Log.

Preferences → Recent changes → Pending changes = meta:Help:Preferences#Pending changes/Edit review

These settings are for advanced editors who have a detailed understanding of the five pillars and of the templates used to mark judgments on the page. Pending changes refers to the style of the presentation of

  • new page "curation" tools: curation toolbar and new pages feed, and
  • how recent changes appear on the page history of certain pages that have been configured for protection by reviewing any changes before they are applied to the public version of the page.

For an example of a page history showing the pending changes feature, click on the history of a page listed at Special:PendingChanges.

Preferences → Watchlist → Details = meta:Help:Preferences#Watchlist

The watchlist options include which pages, and what "recent" means to you. If your Preferences has "Email me when a page or file on my watchlist is changed" set (at the bottom of the "User profile" tab), then only by visiting a page will you actually set its email notification flag. Once you miss the email for a particular page change or don't visit the page (or ignore the email), you will not receive any more emails for that page. You can still dutifully monitor that page by its watchlist edit-summaries, but its particular email notification flag will remain unset until you visit it. This facilitates monitoring a large watchlist while preventing potentially useless emails to you.

In case you want to set all email notifications anyway, you can at any time mark all pages "visited". If your Preferences → Gadgets has "Display pages on your watchlist that have changed since your last visit in bold", then your watchlist will have a button labeled "Mark all pages visited". That button will effectively set all of your email notification flags.

Preferences → Notifications

These settings alter the Special:Notifications tool. The options for Notifications were first added in May 2013. See Wikipedia Signpost topic "English-language Wikipedia to be first to receive Echo deployment" for a brief overview.

For a full explanation of the specific preferences, see Wikipedia:Notifications § Preferences and settings.

Email options
  • Choose whether to opt-in or opt-out of email notifications (you must confirm your email address on your Preferences → User profile → Email options). You can also choose how often to receive email notifications, from single emails for each event to daily or weekly digests.
  • Choose whether to receive plain text or HTML email.
Notify me about these events

You can enable (or disable) individual types of notifications by checking (or unchecking) the boxes next to it. You can enable (or disable) notifications on the web or by email for most notification types (note that some notifications cannot be disabled, such as changes to your user rights or new talk page messages: these notifications are too important to be dismissed).

Wikipedia:Notifications § Types of notifications has a general list of the types of notifications. Special:DisplayNotificationsConfiguration lists all notification types available and how they are configured.

Muted users

You can mute on-site notifications from individual users by enter their username into the box. You will still receive notifications if a muted user writes on your user talk page or reviews a page you have created. The muted user will still receive a successful mention notification, if they've enabled that preference.

Muting pages

You can mute "page linked" notifications for specific pages by typing each page's name into the box.

Preferences → Gadgets → Details = Wikipedia:Gadget#Currently installed gadgets

Gadgets are the software contributed by users, not the software that runs Wikipedia, and so you'll see the group names Editing and Appearance are the same as the tab names on the preferences page. If you see tabs on the preferences page your web-browsers already has JavaScript enabled. The gadgets go through an authoritative process before they appear on the list. There are gadgets for, browsing, editing, appearance and for compatibility. A general overview of the select gadgetry available there is as follows.

Browsing
  • Language translating
  • Media files, search results, and diffs
  • Twinkle admin tools for the advancing editor
  • Teahouse for the new editor question
  • Mousing over or hovering over an inline citation to read it
Editing
  • Citation modifying/expediting/proving
  • Colorizing wikitext; Character toolsets
  • Categorizing; Reviewing new articles; Filing disputes
  • The Wiki Editor, WikEd, and WikEdDiff
Appearance
  • Editing the introductory section.
  • Admin tools; Changing and adding to page layouts and controls
  • Displaying diffs, or animations, or your very own local time on all timestamps
  • Enabling an external search engine for searching Wikipedia
  • Show the assessed class of an article, Featured, A, B, C, etc.
  • Justifying paragraphs
Compatibility
  • Font and JavaScript support
Advanced
  • Regular expression tools
  • Tracking software bugs
  • Patrolling recent changes

See much more customization available in the pages in the See also section, such as a search and replace dialog that understands JavaScript regular expressions.

Preferences → Beta features → Details = mw:Beta Features

Beta Features is a way for users to test new features on Wikipedia and other Wikimedia sites before they are released for everyone.

The MediaWiki preferences page offers a set of options for the generic user. If you discover a special role on Wikipedia, there is probably a powerful tool for it at Wikipedia:Tools § Browsing and editing.

Operating an account with a tool may carry side effects, such as popups, toolbars and frame objects on your browsing or editing page space that are sometimes burdensome, yet sometimes powerfully necessary. Rather than uninstalling, it is possible to just switch skins, because there are four skins, each with a pair of customizations. 1) Custom JavaScript has the tools. 2) Custom CSS can carry over your preferred fonts, colors, and frame borders to each skin, no matter what tools that skin may also be loaded with.

  1. It is true that each tab will create a URL in the browser history, but these URLs do not represent historical differences in the JavaScript instance that loaded with the Preferences page itself. The per-tab URLs only purpose is to serve the browser's back- and forward-navigation.
  2. Wikipedia:Village pump (proposals)/Archive 184#Discourage en-xx UI variants
  3. If you disable JavaScript for any page on MediaWiki.org or Wikipedia.org, you will lose all unsaved edits in all tabs; yet disabling JavaScript is a common troubleshooting technique when diagnosing some preference-related browser behaviors.
  4. The danger in using Live preview is on first use with an incompatible browser. Try a simple test: make a change to the edit box, then reload the page.
  5. Compiled by the Mozilla Contributors.

!

In addition to the above, global functions may be available to Buffer-HTML if enabled; these functions are the same for all Module:Buffer objectsTɛmplet:--i.e. the self action is never redirected.

Element-Buffer functions

[mali mi di yibu sheena n-niŋ]

Element-Buffer object

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

Sharing the same metatable as with regular Buffer objects, Element-Buffers concatenate the same way when called to produce a string analogous to the JavaScript DOM "innerHTML" property. In other words, when strung, it is generally the contents of the Buffer-HTML object without the "outerHTML" or tag.

There are exceptions to this "innerHTML" behavior. For instance, as appended to another object via Tɛmplet:Scribunto/helper, an Element-Buffer and its Buffer-HTML are interchangeable (though appending the former via Tɛmplet:Luaself only includes the inner result).

Also, using the concatenation operator .. on an Element-Buffer includes its tag in a manner depending on if it is selfClosing:

  • For most tags, the conjoined string is placed inside the tag, e.g. Buffer:_inHTML'p' 'inner text' .. 1 returns '<p>inner text1</p>'.
  • For selfClosers, the .. op redirects to its Buffer-HTML, e.g. insert :_add{selfClosing=true} in the above example before .. 1 to produce '<p />1'.

You may use most Buffer object functions normally, however if there is a Buffer-HTML version, it instead behaves as though chained on the outer HTML object.[note 20] You may also chain any mw.html object function. Unless otherwise indicated, such returns a wrapper method that merely redirects the self-action to the outside Buffer-HTML.[note 21]

As a final note, Element-Buffers are in permanent raw mode since it is expected that some mw.html method (e.g. :tag and :node) may or will append non-string elements.

Element-Buffer:done

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

When passed nothing, this should behave just like Tɛmplet:Scribunto/helper as called the "outer" HTML objectTɛmplet:--returning Buffer-HTML.parent, if available, or Buffer-HTML if not.

However, this has been re-designed to accept ops, the number of :done() operations to perform. Thus, ElementBuffer:done(4) is equivalent to BufferHTML:done():done():done():done().

Pass 0 (zero) as dones to return to the Element-Buffer's direct HTML container.

Finally, keep in mind that Buffer-HTML objects use the original mw.html:done (albeit in a light wrapper).

Element-Buffer:tag

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

This uses the same helper method as Tɛmplet:Luaself to handle arguments and produce new Buffer-HTML objects, selectively passing args to Tɛmplet:Luaself when it contains keys not used by Tɛmplet:Scribunto/helper.

As may be expected, this differs from Buffer:_inHTML in that this actually appends the tag and will set a mw.html-style parent reference. This also lacks the other function's "auto-done" feature for selfClosing tags.

As with the other Element-Buffer remake of an mw.html method, the features described here do not apply to the version used by Buffer-HTML objects.

Element-Buffer:_add

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

Takes a table as its only argument. This then thoroughly iterates all number keys from lowest to highest using this module's custom __pairs method. Most values append as wikitext if valid. If a table is indexed at a number key, this recursively iterates the table before moving on to the next key.

After processing all number key-value pairs, this then iterates the other (non-number) keys. For those naming a core Buffer object function, this selectively unpacks args in a manner described at Tɛmplet:Luaself when that function is passed the nanKey parameter (excepting that this does not read numbers as pos, i.e. treats them the same way as strings).

This also accepts keys naming HTML and global functions as well as mw.html arguments. Thus, ElementBuffer:_add{ tag = 'br', 'text'} appends a BR tag after the text and ElementBuffer:_add{ {tag = 'br' }, 'text'} appends the BR before the text. Note however that how this handles args for such keys depends on the particular function or argument named:

ElementBuffer:_add{ arg = value }

The effect of passing args with keys such as args.selfClosing and args.parent is the same as though args were passed to Tɛmplet:Scribunto/helper. This also takes one additional arg, i.e. args.tagName, which value replaces the original tagName of the HTML object (or, if false, removes the tag).

Note that these are the only keys for which a boolean arg would result in an op. (For Buffer object functions that do not no-op when passed only a boolean, place the boolean in an args table for unpacking.)

ElementBuffer:_add{ cssName = cssValue }

A non-number key and value pair may default as the cssName and cssValue parameters for Tɛmplet:Scribunto/helper when the key matches none of the three argName keys nor the name of any available function for Buffer and mw.html objects.

This sends non-boolean cssValue though Tɛmplet:Scribunto/helper prior to forwarding it to mw.html:css. Because this is the default, any typoed key goes to mw.html:css as cssName. Names of functions not yet loaded also end up there.

For convenience, any _ character in the key string is automatically substituted with the - character; thus border_bottom_style = is equivalent to ['border-bottom-style'] =.

The form Element-Buffer:_add{ css = { cssName = cssValue } } also works (or to clear a previously set value; see example at args.htmlFunction for more details).

ElementBuffer:_add{ tag = tagName }

ElementBuffer:_add{ tag = { tagName, argslist } }

Set the key args.tag to a string and this calls Tɛmplet:Scribunto/helper with it as the tagName argument. This then raw inserts the returned mw.html object ("tag"), emulating the effect of Tɛmplet:Scribunto/helper minus parent references, which are unnecessary.

Pair the args.tag key with a table value and this calls mw.html.create with table[1] as tagName (or nil if #invalid), appending it as described above for string values, but also pointing tag.parent to the Element-Buffer's parent as well as temporarily setting the tag as the parent Buffer of tag.nodes. This then treats tag.nodes as a pseudo-Element-Buffer, recursing tag.nodes as "self" and the table as args, though only iterating keys not equal to 1 (or less).[*]

Note this appends normal mw.html objects. That said, most Buffer functions named in args-list should still work as though the tag and tag.nodes were Buffer objects.[note 22]

Upon completing a recursive iteration for args.tag, this checks if the tag is selfClosing, in which case, this sets tag.nodes to nil. Likewise, if its tagName property evaluates false, this nils tag.styles and tag.attributes. Such presumes those properties will not be modified afterwards, so use mw.html:tag outside of Element-Buffer:_add if such is not the case.

ElementBuffer:_add{ done = wikitext }

ElementBuffer:_add{ done = { ops, argslist } }

Similar to args.tag, this treats the first index of the table as the ops argument of Tɛmplet:Luaself. After calling that function, this then iterates all subsequent keys in a recursive call on the Element-Buffer of the Buffer-HTML object returned.

ElementBuffer:_add{ allDone = wikitext }

ElementBuffer:_add{ allDone = { argslist } }

Similar to the previous two, except that the first index is not used as an argument; thus, the entire table is iterated.

ElementBuffer:_add{ globalFunction = name }

ElementBuffer:_add{ globalFunction = { name, save, argslist } }

ElementBuffer:_add{ _B = { var, argslist } }

If the global functions have been loaded and a key matches one, this calls the function with the first two arguments Tɛmplet:Scribunto/helpered from the paired args-list table. This then recursively iterates the list, excluding keys less than or equal to 2, with whatever object is returned as self. However, if the returned object has a metatable and object.nodes exists, the self will be object.nodes instead.

Because Tɛmplet:Luaself takes only one argument, args._B only unpacks the first index and starts the iteration after that key.

If neither of the first two keys evaluate true, this assumes the paired value is a string for use as the name argument for the function matching its key.[note 23] In that case, the current call stack's self (an Element-Buffer or tag.nodes if this was called indirectly) is self for the global function.

ElementBuffer:_add{ htmlFunction = object }

ElementBuffer:_add{ htmlFunction = { arg-list, name = value } }

If args.key matches an Tɛmplet:Scribunto/helper that does not have its own args section, this checks if the associated object is table. If not a table, or if object.nodes evaluates true, this calls the mw.html function with the object as the only argument.

For table objects without an object.nodes, this iterates the table (non-recursively), repeatedly calling the named mw.html function with one or two arguments depending on key's type in each loop. Non-number key-value pairs are both passed as arguments. For numeric indices, only the value is passed. Boolean values are a no-op.

Unlike with most implementions of Module:Buffer's __pairs, this first loops through non-number keys, followed by number keys (still ordered from lowest to highest). Thus, something like ElementBuffer:_add{ attr = { 'width', width = 20 } } is equivalent to ElementBuffer:attr( 'width', 20 ):attr( 'width' )(), setting then unsetting the width attribute and returning the Element-Buffer for a net no-op (though the practical purpose of such is a mystery for this developer).

For args.css only, this auto-replaces underscores with hypens for string keysTɛmplet:--i.e., you may save four keystrokes/pair by typing css_property = instead of ["css-property"] =. This does not apply to strings indexed at number keys.


Preferences are the seventy or so user options for browsing, editing, searching, notifications, and more. A link to your Preferences page is available at the top of every Wikipedia page when you have an account, alongside links to your other account services such as your Contributions. Another way to get there is by navigating to the Special:Preferences page.

Once at your Preferences page, you can control much of the Wikipedia user interface through the many feature settings provided by MediaWiki (the software of Wikipedia): skins, plug-ins, date formats, a signature, and more. For example, you can select to be prompted to enter an edit summary if you forget to. The Preferences page also presents a link to customize your CSS to adjust your page style details.

Plus, there are hundreds of user tools to explore, many listed at Wikipedia:Tools § Browsing and editing, that can override or tweak preferences provided by MediaWiki. Each account has its own Custom JavaScript page where the tools install themselves, and where you can help develop them.

At their site, MediaWiki maintains a browser compatibility matrix. The time you spend in getting an account, setting your preferences, finding tools and testing your browser (before you ever lose an edit) will pay off.

Feature requests can be made, and bugs reported, as described at Wikipedia:Phabricator. The current set of preferences are largely the result of issues raised by newcomers at places such as the Village pump, and driven by regulars who hold long discussions and collectively drive issues.

The Preferences page is accessible when you are logged-in, but you must have JavaScript enabled in your browser, since the page and all its tabs are an extensive JavaScript application.

You do not need to click Save on every tab on the Preferences page, as the Save button affects all changes on all Preferences tabs.[1] You can go from tab to tab setting all your preferences before saving, because Save remembers your changes on the other tabs. To forget unsaved changes, simply leave the page without saving. If you wish to undo your saved changes, you will need to reset them manually.

Clicking Restore all default settings will harmlessly load another page, which will then offer the button to reset all preferences in every tab to their default values. This includes a few items that are stored as a preference, but that aren't directly editable in Special:Preferences. If you do reset your preferences, you can restore your custom signature from the wikitext of a history page, update your custom CSS or JavaScript from Wikipedia:Tools § Browsing and editing, and then re-select and save your preferences.

The default settings are aimed at newcomers editing articles. Intermediate editors tend to activate more features, such as "warn me if I forgot an edit summary", and advanced editors and administrators use the special settings, gadgets, and editors for their tasks.

You have the same username and password on sister projects such as Wiktionary, at MediaWiki.org itself, and on the Wikipedia of other languages. Each of your account's preferences are independent because each wiki is a website, with their own administration (namespaces, settings, accounts, etc.). Even the word "Preferences" on the top may be set differently! On the Simple English Wikipedia, it says "My settings".

Preferences → User profile → Details = meta:Help:Preferences#User profile
  • Lists your account details and the number of edits you have made.
  • Allows you to view/manage your global account info.
  • Provides a link to change your password.

Internationalisation

[mali mi di yibu sheena n-niŋ]
  • Change the language of user-interface messages. It does not affect articles and other pages made by editors. Note that many interface messages have been customized at the English Wikipedia but usually only for the default "en - English" which may for example add links to relevant help pages, processes and policies. Editors are discouraged from selecting "en-GB - British English" or "en-CA - Canadian English", which make a few spelling changes but omit many useful customizations.[2] Foreign languages also omit customizations but may be preferred by users with poor English abilities.
  • Specify your preferred pronoun in order for the software to grammatically refer to you correctly. This is also visible to other users via certain tools, such as the they template and Navigation popups.
  • More language settings: allows you to set the language in which Wikipedia menus and fonts are displayed; additionally, an option to set the language you edit in (input tools must be enabled).
  • Displays the signature that will appear when you sign talk pages.
  • Allows you to edit the signature, either using wiki markup (the option must be checked), or just plain text.
  • An option to provide an email address. Although this is optional, please read the warning about losing your password and not having an email address on file.
  • Options about use of your email address: enabling email from other users, sending copies of emails you send to other users, and receiving email when a page or file on your watchlist is changed.
  • Before using email you must confirm your email address. See Help:Email confirmation
  • "Email me when a page or file on my watchlist is changed", see Help:Email notification
See Wikipedia:Growth Team features § Newcomer homepage
Preferences → Appearance → Details = meta:Help:Preferences#Appearance

Change the web browser experience.

  • Choose the "skin", or "theme" of how Wikipedia is displayed.
  • Access your Custom CSS or Custom JavaScript for individual skins and for global settings that apply to all skins. If the links are blue, you have created these special pages and this is a quick way to access and edit them. If the links are red, clicking the link will create the special page. You can also access your cross-wiki CSS and JavaScript pages from this section, but the color of the links will always be that of external links.

Reading Preferences

[mali mi di yibu sheena n-niŋ]
  • Option to set your date and time preferences; this is how dates will appear in article History pages, logs, etc. If set to "No preference", the format is HH:MM, DD MMMM YYYY (UTC), for example: 15:24, 22 Silimin gɔli December 2024 (UTC).
  • Shows the server time (UTC) and the local time based on the optional Time zone setting. You may opt to use the server time (UTC), have the offset calculated by the clock in your computer, or specify an offset from UTC in hours or by location.
  • This does not affect times saved in editable pages, such as timestamps in signatures. For that, see Wikipedia:Comments in Local Time.
  • The images in an article are just a thumbnail (a preview). These will always be one of eight possible Thumbnail sizes. For the larger screen sizes choose the maximum, and for the smaller screen sizes choose the minimum thumbnail size. The default 220px is a midrange thumbnail-size. Have you changed your font size? Then you should match that font size to your chosen thumbnail size to increase caption readability.
  • While viewing an article, if you click a thumbnail you will activate Media Viewer. Media Viewer is JavaScript, and it uses processing resources. It loads all the images in the article at high resolution, and this uses networking resources. This is the default. You can turn off Media Viewer to save resources: 1) to control all image sizing, 2) to navigate directly to a file page (instead) when you click on a thumbnail.
  • You can target the Image size limit of the file page main image, (displayed in the front matter). On a faster network choose a larger size, and on a slower network choose a smaller Image size limit. The default 800×600px is a midrange Image size limit. File pages are on Commons wiki, and if logged in there, going there overrides your settings here.
  • Note that you can both turn off Media Viewer and set a small Image size limit, and yet you will not limit your ability to avail yourself of any high resolution images listed at the bottom of that file page, when wanted. Doing so you can get full manual control of any unwanted, automatic bogging-down of your surfing speed caused by automated choices concerning File namespace interactions initiated by clicking on an image.
  • Option to not show page content below the diffs; checking this will suppress the page preview of the difference you're viewing.
  • Option to omit a diff after performing a rollback
  • Choose to display hyperlinks with underlines in your browser window always, never, or by browser or Wikipedia-skin default.
  • Format links as stub links when the article they link to is smaller than the threshold you set on file size. Stub link formatting changes the link color to the dark brown displayed in this option's text. This option can help you see links to small articles (more likely to be stubs) so that you might expand them. It is also useful for spotting links to disambiguation pages, which are also relatively small. They are usually linked to in error, but often contain on their list a link to the correct article, making this error easy to fix.
  • Show hidden categories.
Preferences → Editing → Details = meta:Help:Preferences#Editing

Concerning the edit page, its initiation, and look and feel, Wikipedia offers a high number of options. Some of them are:

  • "Teemi ma n yi ti bi sabi lahabali jia (bee din pun ku bɛni ka labisim lahabali ji' maa)" into the database. (Habit-forming.)
  • "Enable VisualEditor". Get a word processor interface. No markup language at all.
  • "Wuhimi johi lihi amaa ka di pa a lan yɛn labimi yooi". Get a dynamic web page. Browser reloading now gives a glimpse at the live original without having to leave the edit page. And there is no longer any need to create an entirely new page for each preview requested; live preview just reloads parts of its page, and so it offers no browser history backwards, but disturbs no history forward either. Saves some network bandwidth and lots of browser cache. Just save your edits before disabling JavaScript.[3] (First-time users should perform a simple compatibility test.[4])

The font size for the edit box can be set in Wikipedia editing preferences or in the browser. In Firefox, there are two font-size settings at Options → Content → "Default font" Advanced…, one for the edit box, and one for the rest of the page. If you just want uniformity, check to see if it allows Wikipedia to choose its own font; then you set Wikipedia's "Edit Area Font Style" to "Serif" or "Sans Serif", and the font size in the edit box will match the rest of the page.

The number of rows in the edit box is no longer set in preferences. For a temporary change, when the edit box is displayed, drag up or down the small square in the bottom right corner of the edit box. Alternatively, make the change stick by adding this line to your CSS file (in Preferences, Appearance), usually Special:MyPage/common.css:

#wpTextbox1 {height: 25em;}

where 25em is an example (and typical), height.

Two editing toolbars are offered that will span the top of the edit box. (Wikipedia:Reftoolbar shows versions.)

To use more of your favorite text editor instead of just the edit box and toolbars, see Wikipedia:Text editor support. Also see the Gadgets tab.

Preferences → Recent changes → Display options & Advanced options = meta:Help:Preferences#Recent changes

Recent changes refer to changes of pages in the database. Every time a wiki page is edited, and changes were actually made, a record is kept of the difference. For example, a page history shows the revisions for that particular page. But recent changes can report on more than just the revisions of a page, or an entire wiki, they can also report on the recent changes of an editor (their contributions). The user preferences for recent changes are the style in which these lists of revisions will appear:

  • Length of the list
  • Time window of the list
  • Grouping methods of the list

The watchlist has even more finely tuned preferences, because like the edit window, it is often a core tool for editors.

More information about these various histories can be found at the following places. For global changes to Wikipedia pages, see Help:Recent changes. For user contributions, see Help:User contributions. For page histories, see Help:Page history. For other types of logs see Help:Log.

Preferences → Recent changes → Pending changes = meta:Help:Preferences#Pending changes/Edit review

These settings are for advanced editors who have a detailed understanding of the five pillars and of the templates used to mark judgments on the page. Pending changes refers to the style of the presentation of

  • new page "curation" tools: curation toolbar and new pages feed, and
  • how recent changes appear on the page history of certain pages that have been configured for protection by reviewing any changes before they are applied to the public version of the page.

For an example of a page history showing the pending changes feature, click on the history of a page listed at Special:PendingChanges.

Preferences → Watchlist → Details = meta:Help:Preferences#Watchlist

The watchlist options include which pages, and what "recent" means to you. If your Preferences has "Email me when a page or file on my watchlist is changed" set (at the bottom of the "User profile" tab), then only by visiting a page will you actually set its email notification flag. Once you miss the email for a particular page change or don't visit the page (or ignore the email), you will not receive any more emails for that page. You can still dutifully monitor that page by its watchlist edit-summaries, but its particular email notification flag will remain unset until you visit it. This facilitates monitoring a large watchlist while preventing potentially useless emails to you.

In case you want to set all email notifications anyway, you can at any time mark all pages "visited". If your Preferences → Gadgets has "Display pages on your watchlist that have changed since your last visit in bold", then your watchlist will have a button labeled "Mark all pages visited". That button will effectively set all of your email notification flags.

Preferences → Notifications

These settings alter the Special:Notifications tool. The options for Notifications were first added in May 2013. See Wikipedia Signpost topic "English-language Wikipedia to be first to receive Echo deployment" for a brief overview.

For a full explanation of the specific preferences, see Wikipedia:Notifications § Preferences and settings.

Email options
  • Choose whether to opt-in or opt-out of email notifications (you must confirm your email address on your Preferences → User profile → Email options). You can also choose how often to receive email notifications, from single emails for each event to daily or weekly digests.
  • Choose whether to receive plain text or HTML email.
Notify me about these events

You can enable (or disable) individual types of notifications by checking (or unchecking) the boxes next to it. You can enable (or disable) notifications on the web or by email for most notification types (note that some notifications cannot be disabled, such as changes to your user rights or new talk page messages: these notifications are too important to be dismissed).

Wikipedia:Notifications § Types of notifications has a general list of the types of notifications. Special:DisplayNotificationsConfiguration lists all notification types available and how they are configured.

Muted users

You can mute on-site notifications from individual users by enter their username into the box. You will still receive notifications if a muted user writes on your user talk page or reviews a page you have created. The muted user will still receive a successful mention notification, if they've enabled that preference.

Muting pages

You can mute "page linked" notifications for specific pages by typing each page's name into the box.

Preferences → Gadgets → Details = Wikipedia:Gadget#Currently installed gadgets

Gadgets are the software contributed by users, not the software that runs Wikipedia, and so you'll see the group names Editing and Appearance are the same as the tab names on the preferences page. If you see tabs on the preferences page your web-browsers already has JavaScript enabled. The gadgets go through an authoritative process before they appear on the list. There are gadgets for, browsing, editing, appearance and for compatibility. A general overview of the select gadgetry available there is as follows.

Browsing
  • Language translating
  • Media files, search results, and diffs
  • Twinkle admin tools for the advancing editor
  • Teahouse for the new editor question
  • Mousing over or hovering over an inline citation to read it
Editing
  • Citation modifying/expediting/proving
  • Colorizing wikitext; Character toolsets
  • Categorizing; Reviewing new articles; Filing disputes
  • The Wiki Editor, WikEd, and WikEdDiff
Appearance
  • Editing the introductory section.
  • Admin tools; Changing and adding to page layouts and controls
  • Displaying diffs, or animations, or your very own local time on all timestamps
  • Enabling an external search engine for searching Wikipedia
  • Show the assessed class of an article, Featured, A, B, C, etc.
  • Justifying paragraphs
Compatibility
  • Font and JavaScript support
Advanced
  • Regular expression tools
  • Tracking software bugs
  • Patrolling recent changes

See much more customization available in the pages in the See also section, such as a search and replace dialog that understands JavaScript regular expressions.

Preferences → Beta features → Details = mw:Beta Features

Beta Features is a way for users to test new features on Wikipedia and other Wikimedia sites before they are released for everyone.

The MediaWiki preferences page offers a set of options for the generic user. If you discover a special role on Wikipedia, there is probably a powerful tool for it at Wikipedia:Tools § Browsing and editing.

Operating an account with a tool may carry side effects, such as popups, toolbars and frame objects on your browsing or editing page space that are sometimes burdensome, yet sometimes powerfully necessary. Rather than uninstalling, it is possible to just switch skins, because there are four skins, each with a pair of customizations. 1) Custom JavaScript has the tools. 2) Custom CSS can carry over your preferred fonts, colors, and frame borders to each skin, no matter what tools that skin may also be loaded with.

  1. It is true that each tab will create a URL in the browser history, but these URLs do not represent historical differences in the JavaScript instance that loaded with the Preferences page itself. The per-tab URLs only purpose is to serve the browser's back- and forward-navigation.
  2. Wikipedia:Village pump (proposals)/Archive 184#Discourage en-xx UI variants
  3. If you disable JavaScript for any page on MediaWiki.org or Wikipedia.org, you will lose all unsaved edits in all tabs; yet disabling JavaScript is a common troubleshooting technique when diagnosing some preference-related browser behaviors.
  4. The danger in using Live preview is on first use with an incompatible browser. Try a simple test: make a change to the edit box, then reload the page.
  5. Compiled by the Mozilla Contributors.

!

Preferences are the seventy or so user options for browsing, editing, searching, notifications, and more. A link to your Preferences page is available at the top of every Wikipedia page when you have an account, alongside links to your other account services such as your Contributions. Another way to get there is by navigating to the Special:Preferences page.

Once at your Preferences page, you can control much of the Wikipedia user interface through the many feature settings provided by MediaWiki (the software of Wikipedia): skins, plug-ins, date formats, a signature, and more. For example, you can select to be prompted to enter an edit summary if you forget to. The Preferences page also presents a link to customize your CSS to adjust your page style details.

Plus, there are hundreds of user tools to explore, many listed at Wikipedia:Tools § Browsing and editing, that can override or tweak preferences provided by MediaWiki. Each account has its own Custom JavaScript page where the tools install themselves, and where you can help develop them.

At their site, MediaWiki maintains a browser compatibility matrix. The time you spend in getting an account, setting your preferences, finding tools and testing your browser (before you ever lose an edit) will pay off.

Feature requests can be made, and bugs reported, as described at Wikipedia:Phabricator. The current set of preferences are largely the result of issues raised by newcomers at places such as the Village pump, and driven by regulars who hold long discussions and collectively drive issues.

The Preferences page is accessible when you are logged-in, but you must have JavaScript enabled in your browser, since the page and all its tabs are an extensive JavaScript application.

You do not need to click Save on every tab on the Preferences page, as the Save button affects all changes on all Preferences tabs.[1] You can go from tab to tab setting all your preferences before saving, because Save remembers your changes on the other tabs. To forget unsaved changes, simply leave the page without saving. If you wish to undo your saved changes, you will need to reset them manually.

Clicking Restore all default settings will harmlessly load another page, which will then offer the button to reset all preferences in every tab to their default values. This includes a few items that are stored as a preference, but that aren't directly editable in Special:Preferences. If you do reset your preferences, you can restore your custom signature from the wikitext of a history page, update your custom CSS or JavaScript from Wikipedia:Tools § Browsing and editing, and then re-select and save your preferences.

The default settings are aimed at newcomers editing articles. Intermediate editors tend to activate more features, such as "warn me if I forgot an edit summary", and advanced editors and administrators use the special settings, gadgets, and editors for their tasks.

You have the same username and password on sister projects such as Wiktionary, at MediaWiki.org itself, and on the Wikipedia of other languages. Each of your account's preferences are independent because each wiki is a website, with their own administration (namespaces, settings, accounts, etc.). Even the word "Preferences" on the top may be set differently! On the Simple English Wikipedia, it says "My settings".

Preferences → User profile → Details = meta:Help:Preferences#User profile
  • Lists your account details and the number of edits you have made.
  • Allows you to view/manage your global account info.
  • Provides a link to change your password.

Internationalisation

[mali mi di yibu sheena n-niŋ]
  • Change the language of user-interface messages. It does not affect articles and other pages made by editors. Note that many interface messages have been customized at the English Wikipedia but usually only for the default "en - English" which may for example add links to relevant help pages, processes and policies. Editors are discouraged from selecting "en-GB - British English" or "en-CA - Canadian English", which make a few spelling changes but omit many useful customizations.[2] Foreign languages also omit customizations but may be preferred by users with poor English abilities.
  • Specify your preferred pronoun in order for the software to grammatically refer to you correctly. This is also visible to other users via certain tools, such as the they template and Navigation popups.
  • More language settings: allows you to set the language in which Wikipedia menus and fonts are displayed; additionally, an option to set the language you edit in (input tools must be enabled).
  • Displays the signature that will appear when you sign talk pages.
  • Allows you to edit the signature, either using wiki markup (the option must be checked), or just plain text.
  • An option to provide an email address. Although this is optional, please read the warning about losing your password and not having an email address on file.
  • Options about use of your email address: enabling email from other users, sending copies of emails you send to other users, and receiving email when a page or file on your watchlist is changed.
  • Before using email you must confirm your email address. See Help:Email confirmation
  • "Email me when a page or file on my watchlist is changed", see Help:Email notification
See Wikipedia:Growth Team features § Newcomer homepage
Preferences → Appearance → Details = meta:Help:Preferences#Appearance

Change the web browser experience.

  • Choose the "skin", or "theme" of how Wikipedia is displayed.
  • Access your Custom CSS or Custom JavaScript for individual skins and for global settings that apply to all skins. If the links are blue, you have created these special pages and this is a quick way to access and edit them. If the links are red, clicking the link will create the special page. You can also access your cross-wiki CSS and JavaScript pages from this section, but the color of the links will always be that of external links.

Reading Preferences

[mali mi di yibu sheena n-niŋ]
  • Option to set your date and time preferences; this is how dates will appear in article History pages, logs, etc. If set to "No preference", the format is HH:MM, DD MMMM YYYY (UTC), for example: 15:24, 22 Silimin gɔli December 2024 (UTC).
  • Shows the server time (UTC) and the local time based on the optional Time zone setting. You may opt to use the server time (UTC), have the offset calculated by the clock in your computer, or specify an offset from UTC in hours or by location.
  • This does not affect times saved in editable pages, such as timestamps in signatures. For that, see Wikipedia:Comments in Local Time.
  • The images in an article are just a thumbnail (a preview). These will always be one of eight possible Thumbnail sizes. For the larger screen sizes choose the maximum, and for the smaller screen sizes choose the minimum thumbnail size. The default 220px is a midrange thumbnail-size. Have you changed your font size? Then you should match that font size to your chosen thumbnail size to increase caption readability.
  • While viewing an article, if you click a thumbnail you will activate Media Viewer. Media Viewer is JavaScript, and it uses processing resources. It loads all the images in the article at high resolution, and this uses networking resources. This is the default. You can turn off Media Viewer to save resources: 1) to control all image sizing, 2) to navigate directly to a file page (instead) when you click on a thumbnail.
  • You can target the Image size limit of the file page main image, (displayed in the front matter). On a faster network choose a larger size, and on a slower network choose a smaller Image size limit. The default 800×600px is a midrange Image size limit. File pages are on Commons wiki, and if logged in there, going there overrides your settings here.
  • Note that you can both turn off Media Viewer and set a small Image size limit, and yet you will not limit your ability to avail yourself of any high resolution images listed at the bottom of that file page, when wanted. Doing so you can get full manual control of any unwanted, automatic bogging-down of your surfing speed caused by automated choices concerning File namespace interactions initiated by clicking on an image.
  • Option to not show page content below the diffs; checking this will suppress the page preview of the difference you're viewing.
  • Option to omit a diff after performing a rollback
  • Choose to display hyperlinks with underlines in your browser window always, never, or by browser or Wikipedia-skin default.
  • Format links as stub links when the article they link to is smaller than the threshold you set on file size. Stub link formatting changes the link color to the dark brown displayed in this option's text. This option can help you see links to small articles (more likely to be stubs) so that you might expand them. It is also useful for spotting links to disambiguation pages, which are also relatively small. They are usually linked to in error, but often contain on their list a link to the correct article, making this error easy to fix.
  • Show hidden categories.
Preferences → Editing → Details = meta:Help:Preferences#Editing

Concerning the edit page, its initiation, and look and feel, Wikipedia offers a high number of options. Some of them are:

  • "Teemi ma n yi ti bi sabi lahabali jia (bee din pun ku bɛni ka labisim lahabali ji' maa)" into the database. (Habit-forming.)
  • "Enable VisualEditor". Get a word processor interface. No markup language at all.
  • "Wuhimi johi lihi amaa ka di pa a lan yɛn labimi yooi". Get a dynamic web page. Browser reloading now gives a glimpse at the live original without having to leave the edit page. And there is no longer any need to create an entirely new page for each preview requested; live preview just reloads parts of its page, and so it offers no browser history backwards, but disturbs no history forward either. Saves some network bandwidth and lots of browser cache. Just save your edits before disabling JavaScript.[3] (First-time users should perform a simple compatibility test.[4])

The font size for the edit box can be set in Wikipedia editing preferences or in the browser. In Firefox, there are two font-size settings at Options → Content → "Default font" Advanced…, one for the edit box, and one for the rest of the page. If you just want uniformity, check to see if it allows Wikipedia to choose its own font; then you set Wikipedia's "Edit Area Font Style" to "Serif" or "Sans Serif", and the font size in the edit box will match the rest of the page.

The number of rows in the edit box is no longer set in preferences. For a temporary change, when the edit box is displayed, drag up or down the small square in the bottom right corner of the edit box. Alternatively, make the change stick by adding this line to your CSS file (in Preferences, Appearance), usually Special:MyPage/common.css:

#wpTextbox1 {height: 25em;}

where 25em is an example (and typical), height.

Two editing toolbars are offered that will span the top of the edit box. (Wikipedia:Reftoolbar shows versions.)

To use more of your favorite text editor instead of just the edit box and toolbars, see Wikipedia:Text editor support. Also see the Gadgets tab.

Preferences → Recent changes → Display options & Advanced options = meta:Help:Preferences#Recent changes

Recent changes refer to changes of pages in the database. Every time a wiki page is edited, and changes were actually made, a record is kept of the difference. For example, a page history shows the revisions for that particular page. But recent changes can report on more than just the revisions of a page, or an entire wiki, they can also report on the recent changes of an editor (their contributions). The user preferences for recent changes are the style in which these lists of revisions will appear:

  • Length of the list
  • Time window of the list
  • Grouping methods of the list

The watchlist has even more finely tuned preferences, because like the edit window, it is often a core tool for editors.

More information about these various histories can be found at the following places. For global changes to Wikipedia pages, see Help:Recent changes. For user contributions, see Help:User contributions. For page histories, see Help:Page history. For other types of logs see Help:Log.

Preferences → Recent changes → Pending changes = meta:Help:Preferences#Pending changes/Edit review

These settings are for advanced editors who have a detailed understanding of the five pillars and of the templates used to mark judgments on the page. Pending changes refers to the style of the presentation of

  • new page "curation" tools: curation toolbar and new pages feed, and
  • how recent changes appear on the page history of certain pages that have been configured for protection by reviewing any changes before they are applied to the public version of the page.

For an example of a page history showing the pending changes feature, click on the history of a page listed at Special:PendingChanges.

Preferences → Watchlist → Details = meta:Help:Preferences#Watchlist

The watchlist options include which pages, and what "recent" means to you. If your Preferences has "Email me when a page or file on my watchlist is changed" set (at the bottom of the "User profile" tab), then only by visiting a page will you actually set its email notification flag. Once you miss the email for a particular page change or don't visit the page (or ignore the email), you will not receive any more emails for that page. You can still dutifully monitor that page by its watchlist edit-summaries, but its particular email notification flag will remain unset until you visit it. This facilitates monitoring a large watchlist while preventing potentially useless emails to you.

In case you want to set all email notifications anyway, you can at any time mark all pages "visited". If your Preferences → Gadgets has "Display pages on your watchlist that have changed since your last visit in bold", then your watchlist will have a button labeled "Mark all pages visited". That button will effectively set all of your email notification flags.

Preferences → Notifications

These settings alter the Special:Notifications tool. The options for Notifications were first added in May 2013. See Wikipedia Signpost topic "English-language Wikipedia to be first to receive Echo deployment" for a brief overview.

For a full explanation of the specific preferences, see Wikipedia:Notifications § Preferences and settings.

Email options
  • Choose whether to opt-in or opt-out of email notifications (you must confirm your email address on your Preferences → User profile → Email options). You can also choose how often to receive email notifications, from single emails for each event to daily or weekly digests.
  • Choose whether to receive plain text or HTML email.
Notify me about these events

You can enable (or disable) individual types of notifications by checking (or unchecking) the boxes next to it. You can enable (or disable) notifications on the web or by email for most notification types (note that some notifications cannot be disabled, such as changes to your user rights or new talk page messages: these notifications are too important to be dismissed).

Wikipedia:Notifications § Types of notifications has a general list of the types of notifications. Special:DisplayNotificationsConfiguration lists all notification types available and how they are configured.

Muted users

You can mute on-site notifications from individual users by enter their username into the box. You will still receive notifications if a muted user writes on your user talk page or reviews a page you have created. The muted user will still receive a successful mention notification, if they've enabled that preference.

Muting pages

You can mute "page linked" notifications for specific pages by typing each page's name into the box.

Preferences → Gadgets → Details = Wikipedia:Gadget#Currently installed gadgets

Gadgets are the software contributed by users, not the software that runs Wikipedia, and so you'll see the group names Editing and Appearance are the same as the tab names on the preferences page. If you see tabs on the preferences page your web-browsers already has JavaScript enabled. The gadgets go through an authoritative process before they appear on the list. There are gadgets for, browsing, editing, appearance and for compatibility. A general overview of the select gadgetry available there is as follows.

Browsing
  • Language translating
  • Media files, search results, and diffs
  • Twinkle admin tools for the advancing editor
  • Teahouse for the new editor question
  • Mousing over or hovering over an inline citation to read it
Editing
  • Citation modifying/expediting/proving
  • Colorizing wikitext; Character toolsets
  • Categorizing; Reviewing new articles; Filing disputes
  • The Wiki Editor, WikEd, and WikEdDiff
Appearance
  • Editing the introductory section.
  • Admin tools; Changing and adding to page layouts and controls
  • Displaying diffs, or animations, or your very own local time on all timestamps
  • Enabling an external search engine for searching Wikipedia
  • Show the assessed class of an article, Featured, A, B, C, etc.
  • Justifying paragraphs
Compatibility
  • Font and JavaScript support
Advanced
  • Regular expression tools
  • Tracking software bugs
  • Patrolling recent changes

See much more customization available in the pages in the See also section, such as a search and replace dialog that understands JavaScript regular expressions.

Preferences → Beta features → Details = mw:Beta Features

Beta Features is a way for users to test new features on Wikipedia and other Wikimedia sites before they are released for everyone.

The MediaWiki preferences page offers a set of options for the generic user. If you discover a special role on Wikipedia, there is probably a powerful tool for it at Wikipedia:Tools § Browsing and editing.

Operating an account with a tool may carry side effects, such as popups, toolbars and frame objects on your browsing or editing page space that are sometimes burdensome, yet sometimes powerfully necessary. Rather than uninstalling, it is possible to just switch skins, because there are four skins, each with a pair of customizations. 1) Custom JavaScript has the tools. 2) Custom CSS can carry over your preferred fonts, colors, and frame borders to each skin, no matter what tools that skin may also be loaded with.

  1. It is true that each tab will create a URL in the browser history, but these URLs do not represent historical differences in the JavaScript instance that loaded with the Preferences page itself. The per-tab URLs only purpose is to serve the browser's back- and forward-navigation.
  2. Wikipedia:Village pump (proposals)/Archive 184#Discourage en-xx UI variants
  3. If you disable JavaScript for any page on MediaWiki.org or Wikipedia.org, you will lose all unsaved edits in all tabs; yet disabling JavaScript is a common troubleshooting technique when diagnosing some preference-related browser behaviors.
  4. The danger in using Live preview is on first use with an incompatible browser. Try a simple test: make a change to the edit box, then reload the page.
  5. Compiled by the Mozilla Contributors.

!

Loadable convenience extensions

[mali mi di yibu sheena n-niŋ]

The methods here are loaded on demand or depend on subroutines which need initialization.

These methods can greatly simplify the structure of the modules which employ them by doing, in a fluent manner, many tasks which may otherwise force an awkward interruption in Buffer call chains.

Methods such as Tɛmplet:Scribunto/helper and Tɛmplet:Luaself traverse a node tree in only one direction. While fine for returning to an ancestor, they do not provide navigation to a non-ancestor (often necessary for templates with co-dependent parameters). Yet, repeated breaks in call chains to set local variables for several nodes of the same branch can look choppy if not confusing for nodes many generations removed from its declaration statement.[note 24]

Templates with several conditionally-appended nodes with similar, but not identical, parts may present another conundrum for coders who must decide between having awkward call chain interruptions to store potentially repeated components as local variables or constructing a somewhat redundant module that is more susceptible to maintenance errors by future editors who may patch one code segment but miss the sibling buried within a convoluted nesting of Tɛmplet:Scribunto/helper.

This module's global functions and added syntactic sugar for the _G object were formulated to simplify such node trees with multi-conditional or repeating structures by providing concise in-chain variable declaration. The extension is enabled by passing your global table to the moduleTɛmplet:--either in the initial call to require'Module:Buffer' (more instructions in that section) or to Tɛmplet:Luaself which forwards arguments to Module:Buffer.[note 25]

Tɛmplet:Luaself

Pass name and save to assign the object passed as save to a global variable via Tɛmplet:Scribunto/helper.[note 26]

Pass only name and this substitutes self for save to assign the Buffer object to _G[name] instead. Give an explicit nil as save to unset a global. This returns the Buffer object as well as any argument given after name.

This is a no-op when name is nil or a boolean, or, when save (eventually) evaluates true and Tɛmplet:Scribunto/helper also returns true.

If the named global already exists, this "backs up" the old value by moving it to the meta __index of the global table, setting a new metatable if none exists.[note 27] Retrieving the old value requires unsetting the new one via Tɛmplet:Luaself (more details in that section). If overwritten a third time, the first value is discarded and the second takes its place in the back up.

If a metaglobal variable exists but the global is nil, this sets the global without unsetting the metaglobal (i.e. does not back up a nil global). An exception is when this is given an explicit nil as save and only the metaglobal exists; thus, passing nil twice for the same name, unsets the key in both the global table and its metaindex.

Tɛmplet:Luaself

This Tɛmplet:Scribunto/helper with the global table as the first argument and name and save as the second and third, respectively, returning the Buffer object for call chaining.[example 1] This is a no-op if name is nil or a boolean.

Note that Buffer methods use a local variable new_G as a proxy for the global table _G; though not a global index, the string 'new_G' is a "magic word" that changes the destination for future save for this and Buffer:_G.

Pass a table as var (same place as save) to set as the new new_G. Any table such that var._G == _G is treated as a (former) new_G object. This Tɛmplet:Scribunto/helper of former proxies and Tɛmplet:Scribunto/helper with the Tɛmplet:Luaself __call method on non-new_G tables. Then, this, if third parameter metaindex equals:

  • nil Tɛmplet:-- backs up the current proxy as the metaindex of the next (though this no-ops if var equals new_G to avoid cyclical indexing).
  • false Tɛmplet:-- leaves the metaindex intact (replacing the current proxy without back-up)
  • true Tɛmplet:-- unsets the metaindex of the next proxy
  • any other value Tɛmplet:-- sets that value as the metaindex of the next proxy. (Note new_G._G is not set until it is returned by Tɛmplet:Luaself)

To omit or to pass nil/false as var has the same effect as Tɛmplet:Luaself. Pass true instead and this treats it as though passed as metaindex, creating a new proxy without backing up the incumbent.

Tɛmplet:Luaself

This returns the value indexed at key name in the global table. If it does not exist, this forwards both arguments to Tɛmplet:Luaself and returns the saved value (which may be itself).

In other words, Tɛmplet:Luaself is roughly equivalent to _G[name] = _G[name] or save or save==nil and Buffer.

The string 'new_G' will return the Module:Buffer local variable new_G, used as a proxy for the global variable _G. Given more than one argument, this forwards arguments to Tɛmplet:Luaself to assign another proxy global before returning the (newly-deposed) proxy. This then sets new_G._G to the original _G object for call chaining. (See § chain call in _G object).

Tɛmplet:Luaself

Takes only one argument and returns that argument.

Assuming the only X declared is Tɛmplet:Scribunto/helper and new_G equals _G, then Tɛmplet:Luaself and Tɛmplet:Luaself are equivalent.[note 28]

When passed a variable that does not exist, this returns the Buffer nil object:

Tɛmplet:Luaself

Tɛmplet:Luaself

The Buffer-nil object is unique. Calling this as a function returns nothing (in contrast, calling an empty Buffer object returns an empty string). This does however have the Module:Buffer __concat metamethod, which treats this the same way as any invalid object (i.e. ignores it).

Appending this via Tɛmplet:Scribunto/helper or Tɛmplet:Luaself has the same effect as appending nil. Passing this to Tɛmplet:Scribunto/helper returns nil instead of the string 'nil'.

The only real Buffer method in its meta __index is Tɛmplet:Luaself, however, any non-numerical key string retrieves a function that only returns the Buffer nil object for call chaining. In a sense, you can think of Buffer:_B(var):... as an if var~=nil then var:... block around the following chain that ends in the next :_B().

If Tɛmplet:Scribunto/helper, the clone will be a normal Buffer object.

The first _G variable passed to this module is given a __call metamethod that self-Tɛmplet:Scribunto/helpers and returns in a manner that depends on whether it was called directly or from a chain.[example 2] This module conserves any pre-existing metatable and alters no metamethod other than __call.

_G( k, v )

_G'string'

When called, the _G object self-sets any string passed as k with whatever is passed as v. This returns v, or nil if omitted (unlike with rawset, an explicit nil is not necessary to unset a variable with direct calls).

Note that k must be a string to declare or unset a global in this op. Tables passed as the first argument are treated as though this were executed via a call chain (discussed shortly). Passing k which is not one of those two types will throw an error.

chained-object:_G( k, v )

chained-object:_G'string'

When used in a call chain, this rawsets the key-value pair in the chained object and returns that object. The _G object may chain itself when returning _G is desired for another op instead of v.

In contrast to the direct op, the in-chain op will index non-string k values. Moreover, this only unsets object[k] when passed an explicitly nil v.

If v is omitted in-chain, this uses the chained object as the missing argument; thus, (chained) object:_G'string' has identical effect and return to _G('string', object).

The same __call method is given to new_G objects created by Buffer:_R, however the direct call only works if its metaindex is the _G object. Any table such that table._G points to the _G object may chain save to itself regardless of metaindex.

Though the behavior of the chain op when v is omitted may be a dead ringer to that of Buffer:_G when save is omitted and new_G is the chained object, mind that the Buffer object function sets keys in new_G variable rather than the chained (Buffer) object; in other words, this is unaffected by Buffer:_R reassigning new_G to another table. Also, this does not have the back up behavior of Buffer:_G.

Buffer-variable object

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

Raw appends a Buffer-variable object, which may appear as a different value each time the object (or its container) is converted to a string.[example 3]

Initialize a Buffer-variable object by passing as var a:

  • number - which, when strung the first time, appears as that number and reappears as var + change the next time it is strung.
  • string - that transforms into the next ASCII character via Tɛmplet:Scribunto/helper.
  • table - to return the first (non-nil) item, then the second, and so on as determined by Tɛmplet:Scribunto/helper, looping back to the first item after reaching the last. (Note the change argument does not apply to table-based Buffer-variables.)
  • custom function - to be set as the _build and __tostring method of a variable-object, though instructions for coding such functions are beyond the scope of this manual.

Re-append the same variable object by passing true as the only argument. For non-table-based variables, you may specify change to append a sister object which transforms the value at the rate specified. Changes are cumulative. Thus, if the original is re-strung after a sister, its value will differ from that of its last appearance by the sum of the original and sister rates and vice versa.

Apply a change without appending a new variable object to the Buffer by passing false. The shift is effective immediately and may affect previously appended variable objects not yet finalized. Pass only false (i.e., omit change) to produce the same effect as stringing the original once. Note that the false-change is the only change table-based Buffer variables will honor.[note 29]

Pass nothing to append a version which simply repeats the result of the last stringing. While generally identical in effect to the object generated by :_var(true, 0), the Buffer-variable will return nothing if strung before any of its sisters.

If passed an explicit nil as the first argument, this is no-op. If passed a boolean before any Buffer-variable has been initialized, this is also a no-op. Note that any op disables future caching at Tɛmplet:Luaself for all Buffer objects in your module (and in any module which may require it).

String, mw.ustring, and mw.text libraries

[mali mi di yibu sheena n-niŋ]

Buffer:functionName( ... )

You may directly chain any function from the following libraries on Buffer objects:

Functions from these libraries added to the Module:Buffer metatable on-demand and placed within a wrapper method that strings the Buffer object for the first argument and then forwards the remaining arguments.

Thus, the following are equivalent: Buffer:nowiki( ... ) and Tɛmplet:Scribunto/helper

If a name exists in both the string and mw.ustring libraries, the string version takes precedence. You may prefix the letter u on any mw.ustring functionTɛmplet:--e.g. Buffer:ulen returns the number of unicode characters and Buffer:len returns the number of bytes.

Buffer:gsub and Buffer:ugsub have a slightly different wrapper which substitutes the repl argument of Tɛmplet:Scribunto/helper and Tɛmplet:Scribunto/helper when it evaluates false or is omitted with an empty string (otherwise the originals would throw an error). This saves a few keystrokes when removing characters via Buffer:gsub'[pattern]' as opposed to Buffer:gsub( '[pattern]', '' ). All other arguments are handled the same as with the other on-demand methods.

Library functions which take a non-string as the first argument are not supported.

Empty Buffer interface

[mali mi di yibu sheena n-niŋ]

Tɛmplet:Luaself

To obtain the first return value as a Buffer object (as opposed to whatever type the original normally returns), simply chain the imported method immediately after creating the new Buffer via Buffer:_in. Only empty Buffer objects which have a parent object will append the result of their parent in this manner.

This syntactic sugar allows two things:

  • For appending additional objects after the op via Buffer object methods.
  • For chaining multiple Tɛmplet:Scribunto/helper methods not chainable to stringsTɛmplet:--e.g., this: Buffer:_in():uformat( ... ):_in():toNFD():encode'[<>#]':match'^(.-)==='
vs. the following which has the same order of operations albeit harder to see: mw.text.encode( mw.ustring.toNFD( Buffer:uformat( ... ) ), '[<>#]' ):match'^(.-)==='
Special case: Element-Buffer
[mali mi di yibu sheena n-niŋ]

emptyElementBuffer:functionName( ... )

ElementBuffer:_in():functionName( ... )

The 'empty' behavior is different when chained to empty Element-Buffer or an empty child Buffer of an Element-Buffer.

Library methods chained to an empty Buffer which parent is an Element-Buffer object will instead string the grandparent Buffer-HTML object for use as the first argument before appending the result to the new Buffer. This interface is provided because Buffer-HTML objects, which are not true Buffer objects, are unable to load these functions, making this the only chainable option for Scribunto methods that includes the outer tag of non-empty Element-Buffers.

Chained on an empty Element-Buffer, these methods will string the Buffer object which created its HTML tree via Tɛmplet:Luaself[note 30] and append the result to the Element-Buffer.[example 4]

Modified .. operator

[mali mi di yibu sheena n-niŋ]

All "true" Buffer objectsTɛmplet:--e.g., the regular, stream, and element varietiesTɛmplet:--share the same Tɛmplet:Scribunto/helper. Some Buffer-like classes, namely Tɛmplet:Luaselfs and the Tɛmplet:Luaself, also have this same metamethod.

The extended Tɛmplet:Scribunto/helper operator does not append to Buffer objects. In other words, Buffers generally remain the same as before the op excepting those effects that apply whenever Buffers are strung (See Tɛmplet:Luaself, Tɛmplet:Luaself, and Tɛmplet:Luaself).

Buffer .. value

value .. Buffer

Any non-table value may be joined a Buffer object with the concatenation operator .. without error.

With the exception of Element-Buffers (which are a special case), the op passes each object, ordered left-to-right, to Tɛmplet:Luaself which inserts validated items in a new table, which this returns through Tɛmplet:Scribunto/helper.

Concatenating an invalid value and a Buffer has generally the same effect as Tɛmplet:Scribunto/helper unless such involves:

Buffer .. table

table .. Buffer

The same general operation applies for tables as with non-tablesTɛmplet:--i.e., validated values are inserted left-to-right into a new table to be joined by table.concat. In fact, tables which have a metatable (including Buffer objects which are not an Element-Buffer) are forwarded to Buffer:_ and processed the same way as non-tables.

Given a table for which Tɛmplet:Scribunto/helper returns nil or false, this instead forwards the table to Tɛmplet:Luaself, which iterates every value indexed at a number key in sequential order, inserting those which are valid in the new table.

As a reminder, Buffer:_ validates tables with metatables that lack a __tostring method through table.concat, which throws an error on sequences containing one or more value that is neither a string nor a number. Such accounts for nearly all cases of breaking errors involving this op.

Note that the valKey parameter of Buffer:_all is not triggered.

for Element-Buffers

[mali mi di yibu sheena n-niŋ]

Element-Buffer .. value

value .. Element-Buffer

Element-Buffer .. Element-Buffer

To recap and expand upon § Element-Buffer-object, the behavior of this op depends on whether its parent Buffer-HTML is Tɛmplet:Scribunto/helper or if the other value is also an Element-Buffer. Also, the final result always includes the outer HTML object (i.e., the tag) in some manner.

For Element-Buffers of "open" tags, this op creates a table with a metaindex that references the parent of the Element-Buffer. The table is then effectively a "mirror" of the parent Buffer-HTML object except that it contains an empty table at table.nodesTɛmplet:-- the index of the Element-Buffer within its parent. This then populates the mirror's inner table with the string of the Element-Buffer and the other value, validated left-to-right, in a manner not unlike what this does with the temporary table it creates when concatenating non-element Buffers to another value. This then returns the mirror table through the __tostring metamethod of the mw.html library, yielding a string which resembles that of the parent tag but with value inserted in front of or behind the original inner text depending on whether value was to the left or right of the .. operator, respectively.

When the selfClosing property of the parent evaluates true, this operates on the parent instead of the Element-BufferTɛmplet:--i.e., the resulting string will have value on the outside as opposed to within the tag (placing it inside would be pointless since selfClosing tags do not show inner contents).

If both operated objects are Element-Buffers, this mirrors the parent of the first. The inner table of the mirror is then populated by inserting the string of the first Element-Buffer followed by the string the parent Buffer-HMTL of the second. The resulting string would be as though the parent of the second were the last node of the first parent. Note that this Element-to-Element rule does not apply when the first Buffer belongs to a selfClosing tag (in which case, this behaves as though the selfClosing parent were to the left of the operator, returning a string with the selfClosing tag inside the tag of the second Element-Buffer in front the latter's inner contents.)

Finally, this combines an Element-Buffer and a table value which has no metatable by passing the table as args for Tɛmplet:Luaself with the mirror of the Element-Buffer as the "self". This avoids permanently changing the parent Buffer-HTML by setting a new table at table.attributes or table.styles in the mirror the first time methods such as Tɛmplet:Scribunto/helper, Tɛmplet:Scribunto/helper, Tɛmplet:Scribunto/helper, etc. attempt to access those tables, copying the original's via the recursive form of Tɛmplet:Luaself. Note however that permanent changes may be made to other objects whenever methods such as via Tɛmplet:Luaself or Tɛmplet:Luaself are keyed to navigate beyond the mirror or "sandbox".

require'Module:Buffer'.__pairs

[mali mi di yibu sheena n-niŋ]

require'Module:Buffer'.__pairs( table, flag, ext )

Returns two values: an iterator function and the table. This is intended for use in the Tɛmplet:Scribunto/helper for.

One distinctive feature of this pairs method is that it splits keys into two groups: Tɛmplet:Scribunto/helpers and non-numbers. This indexes each group of keys in its own "map" object, traversed by its own iterator functionTɛmplet:--i.e, iterating both sets of keys requires two separate for loops. Numeric keys are served in an orderly fashion as with Tɛmplet:Scribunto/helper except that those which are negative, non-consecutive, and non-integer may be included. Moreover, this can find some keys paired with explicitly nil values.[example 5]

The flag argument selects the iterator method returned for that loop. When flag is an explicit nil or omitted, this returns an iterator for number keys. If given any non-nil flag (i.e., false or any value that evaluates true), this returns a method for looping non-numeric keys. Because both sets are mapped at the same time, you may avoid a redundant mapping op in a subsequent loop by passing an explicit nil or false as flagTɛmplet:--i.e., omitting flag or passing true indicate that re-mapping is desired.

This automatically selects certain tables for "mapless" iteration. Typically, mapless differs from mapped only in that it uses fewer server resources, though, as explained in the next section on mapping, it may "miss" keys in some cases.

Mapping behavior may be modified or extended by ext. To disable mapless iteration for the table, you may pass false as ext. If not nil or false, ext must be a pairs method that takes the table as its only argument and returns a function that may iterate its keys for mapping purposes. Note that re-mapping avoidance via flag does not apply if ext is explicitly given, though a nil ext does not disqualify a table from mapless iteration.

Tables are mapped in two stages.

The initial stage is a Tɛmplet:Scribunto/helper which inserts integers between 1 and #table in the number key map. Because nothing is checked in this step, this may map keys which the numeric map iterator would pair with nil values or with values from the table's Tɛmplet:Scribunto/helper.

The second stage explores the table's keys with an Tɛmplet:Scribunto/helper and Tɛmplet:Scribunto/helper as the default expression-list, or, if ext evaluates true, the expression returned by ext( table ). This ignores keys already mapped in the first stage and checks if any unmapped key is a number before indexing it in the appropriate map group. Upon completion, if any new number key were found in the second stage, this runs the numeric map through Tɛmplet:Scribunto/helper. No order is imposed on the non-numeric map.

Alternatively, a table may qualify for "mapless" iteration if Tɛmplet:Scribunto/helper is not nil, and Tɛmplet:Scribunto/helper returns nil. If either flag or ext are not nil, or if the table was previously mapped, such permanently disqualifies a table for mapless processing.

As a side note, if mapless numeric iteration occurs, this returns iterator, table, nil. In other words, you may use Tɛmplet:Scribunto/helper to confirm that the table qualifies for mapless iteration when it has a third explicit return (for debugging).

Tɛmplet:Luaself

One of four functions may be provided in the Tɛmplet:Scribunto/helper returned by this pairs method, depending on which group of keys (numeric or non-numeric) and which iteration process (map-based or mapless) is indicated.

When key is nil or unspecified, map iterators will return the key object referenced by the first index of the relevant map along with the value it indexes. If passed the first mapped key, these iterators then return the second index mapped, which if passed in turn may retrieve the third and so on until the last mapped key has been served.

For numeric iteration, the mapless method returns 1, table[1] when key is unspecified. If a key is given, it returns key + 1, table[ key + 1 ] unless key is greater or equal to the length of the table, upon which it returns nil. For non-numeric keys, the mapless "iterator" is actually a no-op (empty) function which takes nothing, does nothing, and returns nothingTɛmplet:--provided only to prevent an error when the for loop expects a function.

As mentioned (using different words), key-value pairs are served independently of whether or not table[key] exists and retrieved without using Tɛmplet:Scribunto/helper.

For example, take a look at table x as declared in the following statement: {{{1}}}. Table x has a length equal to 8. With ipairs, the for loop stops after the first pair. In contrast, this module's __pairs method will loop all 8 keys declaredTɛmplet:--i.e., (1, 1), (2, nil), ... (7, nil), (8, 8). That said, this only iterates two keys if table x were declared as {{{1}}} instead even though such is indistinguishable to Finally, the loop would continue to include any keys set to nil after the mapping process.</ref>

You may assign these iterators to a local variable to use them directly. If an unmapped table is given to a map iterator, it will forward the table to this pairs method for immediate mapping. Though no map table is produced for the mapless iteration, the pairs method does cache the length of the table at a map reference, which the iterator compares against key to determine when to stop. Unlike the map methods, the mapless iterator does not call the pairs method when such has been bypassed and instead compares key to the value returned by the Tɛmplet:Scribunto/helper, which may be unstable if the loop includes code that sets or unsets indicies within the table. Also, the mapless method will throw an error if given a table that has been mapped (when it attempts to compare key to a map object).

Tips and style recommendations

[mali mi di yibu sheena n-niŋ]
  • If joining Buffer with a string immediately after :_'text', place a space between 'string' and the separator and use double/single quote marks to . (i.e. :_'text' " " instead of :_'text'' ' or :_'text'(' '))
  • Saving Module:Buffer locally, e.g. local Buffer = Tɛmplet:Scribunto/helper, though fine, is often unnecessary since all Buffer objects can create new buffers via Tɛmplet:Luaself.

For Tɛmplet:Luaself

  • Treat :_ as though it were a .. op. Wrapping strings with unnecessary () is akin to ( 'string1' ) .. ( 'string2' ) .. ( 'string3' ).
  • To insert an empty string as a placeholder for a separator without setting raw, pass a table containing only an empty string, like so: Tɛmplet:Luaself.
  • Raw appending a non-table is pointless since no other Scribunto type can tostring differently afterwards. However, this developer believes you are smart enough that raw and type(v)=='table' is a waste of server resources. (Such checks are why Tɛmplet:Scribunto/helper takes twice as much time to append a list of strings as Tɛmplet:Luaself despite their near-identical roles in an Element-Stream-Buffer).

For Tɛmplet:Luaself and Tɛmplet:Luaself

  • Something like Buffer_str(2, false, A, false, {C, B}) will use variable A as the parent's separator, or B instead if A is nil, or C if both A and B are nil.

For Tɛmplet:Luaself

  • Appending values in multiple locations is one of the primary reasons why the nanKeys argument exists. While passing a boolean directly will cause an error, you can do something like...
this:Tɛmplet:SpBuffer:_all({condition and {_nil={'0', 'replacement'},Front=1,getParent='from child'}}}, true)
versus: Buffer:_nil('0', condition and 'replacement' or false):_(condition and 'Front', 1):getParent(condition and 'from child'):_B(child).

For Tɛmplet:Luaself

  • If the table reference passed as clear was appended raw in multiple positions, this is akin to performing Tɛmplet:Luaself at all positions simultaneously. (May be easier than trying to come up with a Tɛmplet:Scribunto/helper pattern)
  • Inserting a named empty table is raw as a placeholder to be populated later via this function may be easier than calculating pos argument of Tɛmplet:Luaself.

Non-literal interpretations of the source code (that is, more opinion than fact) are provided here to offer additional clarity. Overly technical details may be found here as well when including such caveats appears more likely to confuse than help those advanced-but-not-quite-fluent in Lua.

  • Module:Escape, a lightweight metamodule for customized string character escaping


A chirim ya: &It;ref> tuma maa yi laɣingu din yuli nyɛ "note", ka lee bi saɣiritiri $It;references group ="note"/> tuka maa bon nya
A chirim ya: &It;ref> tuma maa yi laɣingu din yuli nyɛ "example", ka lee bi saɣiritiri $It;references group ="example"/> tuka maa bon nya

--[[=============================
This Module was written by Alexander Zhikun He, also known as, User:Codehydro on the English Wikipedia

All methods were developed independently and any resemblance to other string buffer libraries would be coincidental.
Furthermore, many methods will not work when compiled by standard Lua libraries as they depend on behaviors unique to
the MediaMiki Scribunto mod, which, for example, has a getmetatable() method that always returns nil on non-tables.
https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual

Source code comments may be thin at some points because they are intended to be supplemented by the documentation page:
https://en.wikipedia.org/wiki/Module:Buffer/doc

Licensed under Creative Commons Attribution-ShareAlike 3.0 Unported License
https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License

https://en.wikipedia.org/wiki/Module:Buffer
https://en.wikipedia.org/wiki/User:Codehydro
=============================--]]
local function Valid(v)--type validation
	if v and v~=true then--reject nil/boolean; faster than 2 type() comparisons
		local str = tostring(v)--functions not filtered since unlikely passed by accident (Scribunto does not have userdata/thread types)
		if str~=v and str=='table' then return rawget(v, 1) and table.concat(v) end--tostring(string-type) returns same ref; same refs compare faster than type()
		if str~='' then return str end--numbers are coerced to string per table.concat op; appending in string form saves ops on repeat concat
	end
end
local noOp, MBpairs = function()end do local iMap, vMap, oMap, pIter, pOther, pFast, Next--Map
	local function init()--init = noOp after first run
		function Next(t) return next, t end--slightly faster to do this than to use select()
		function pIter(t, k) k = (iMap[t] or MBpairs(t, true) and iMap[t])[not k and 1 or vMap[t][k]] return k, t[k] end--don't use rawget; accepting unmapped tables does not measurably affect performance.
		function pOther(t, k) k = (oMap[t] or MBpairs(t, true) and oMap[t])[nil==k and 1 or vMap[t][k]] return k, t[k] end--comparison to nil because false is a valid key
		function pFast(t, k) k = not k and 1 or k < (vMap[t] or #t) and k + 1 or nil return k, t[k] end--mapless iterator; almost as fast as native ipairs; slight performance penalty when length not cached
							   --k and k < (vMap[t] or #t) and k + 1 or not k and 1 or nil return k, t[k] end--mapless iterator; almost as fast as native ipairs; slight performance penalty when length not cached
		local mk = {__mode = 'k'}--use mode 'k'; found that mode 'kv' sometimes garbage collects maps mid-loop (may not error because iterators auto re-map, but that's expensive)
		init, iMap, vMap, oMap = noOp, setmetatable({}, mk), setmetatable({}, mk), setmetatable({}, mk)--iMap is numeric keys, oMap is non-numeric keys, and vMap points to next key
	end
	function MBpairs(t, ...)--pairs always iterates in order
		local iter, ex = ...
		iter = iter==init()--nil
		if iter and not oMap[t] and ex==nil and rawget(t, 1)~=nil and next(t, #t)==nil then--while possible to miss keys, more thorough check would negate the benefit of pFast
			vMap[t] = #t return pFast, t, nil
		elseif ... or not vMap[t] or select('#', ...)~=1 then
			local ti, tn, to, n = {}, {}, {}, #t--reduces table lookups
			iMap[t], vMap[t], oMap[t] = ti, tn, to
			for k = 1, n do ti[k], tn[k] = k, k + 1 end--stage one avoids number type checking op in stage two for most numeric keys
			for k in (ex or Next)(t) do
				if not tn[k] then table.insert(tonumber(k)~=k and to or ti, k) end
			end
			if #ti~=n then
				table.sort(ti)
				for k = 1, #ti do tn[ti[k]] = k + 1 end--somewhat wasteful, but trying to avoid overwriting can be even more expensive
			end
			for k = 1, #to do tn[to[k]] = k + 1 end
		end
		return iter and pIter or oMap[t] and pOther or noOp, t--noOp for mapless
	end
end
local parent, rawkey, spec do--new scope for variables not reused outside (reduces number of var names that need to checked outside of scope)
	local mkv = {__mode='kv', __call=function(t,k,v)t[k]=v return k end}--shared meta for Buffer parent property, raw mode, and specialized functions
	parent, rawkey, spec = setmetatable({}, mkv), setmetatable({}, mkv), setmetatable({}, mkv)--shared meta less memory
end

local MB, MBi, MBmix, buffHTML, gfuncs, noCache, Element do--minimize number of locals per scope to reduce time spent sifting through irrelevant variable names
	local _stream do local stream--keep stream near top of scope
		local function init(f)--init = noOp after first run
			local function each(self, ...)
				for k = 1, select('#', ...) do
					k = Valid(select(k, ...))--slightly faster than table.insert(self, (Valid(select(k, ...))))
					if k then table.insert(self, k) end
				end
				return self
			end
			init, stream, _stream = noOp, {
				__call = function(t, v) v = v and Valid(v) return v and table.insert(t, v) or t end,--last_concat cleared before entering stream mode
				__index = function(t, i) return i=='each' and each or MB.__index(t, i) and setmetatable(t, MB)[i] end,--no table look up minimizes resources to retrieve the only stream function
				__tostring = function(t) return setmetatable(t, MB)() end
			} for k, v in next, MB do stream[k] = stream[k] or v end
			setmetatable(stream, getmetatable(MB))
		end
		function _stream(self, ...) self.last_concat = init() return setmetatable(self, stream):each(...) end
	end
	local function isMBfunc(Buffer, s, ...)--helper for :getParent()-like methods (including getBuffer which does not return a parent)
		return s and (select('#', ...)==0 and--eventually should figure out to make this work for :getHTML which is very similar
				(not rawkey[s] and tostring(s):match'^_.*' and MB.__index(Buffer, s) and MB.__index(Buffer, s)(Buffer) or MBmix(Buffer, s))--unprefixed function names append as a string
				or assert(MB.__index(Buffer, s), ('" %s " does not match any available Module:Buffer function'):format(s))(Buffer, ...)--getParent is a one-way trip so one-time assert not expensive
			) or Buffer
	end
	local function MBselect(n, ...)--helper for :_out and :_str
		local n, seps = n - 1, {select(2, ...)}
		if type(seps[n])=='table' then 
			if buffHTML and rawget(seps[n], buffHTML) then return ... end
			setmetatable(seps, {__index = setmetatable(seps[n], {__index = function(t) return rawget(t, 1) end})})[n] = nil
		end
		return ..., seps
	end
	local _inHTML do local lastBuffer, lastHTML
		local function init(...)--init replaced and new version called on return
			local create, mwFunc = mw.html.create do
				local mwHTMLmeta = getmetatable(create())
				buffHTML, mwFunc, _inHTML = setmetatable(mw.clone(mwHTMLmeta), getmetatable(MB)), mwHTMLmeta.__index--buffHTML declared near top of module; remove _inHTML from outer scope
				function init(nodes, ...)
					local name, args, tag = select(... and type(...)=='table' and 1 or 2, nil, ...)
					tag = create(Valid(name), args)
					if nodes then table.insert(nodes, tag.parent and tag or rawset(tag, 'parent', parent[nodes])) end
					if args then
						local a, b = args.selfClosing, args.parent
						args.selfClosing, args.parent = nil
						if next(args) then Element._add(parent(tag.nodes, tag), args) end
						args.selfClosing, args.parent = a, b--in case args is reused
					end
					return tag
				end
				for k, v in next, {[mw] = mwHTMLmeta,
					__call = function(h, v) return MBmix(spec[h.nodes] and h.nodes or spec(setmetatable(parent(h.nodes, h), MB), Element), v) end,
					__concat = false,--false means take from MB
					__eq = false
				} do buffHTML[k] = v or MB[k] end
			end
			local nonSelf, BHi = {tag=true,done=true,allDone=true}, buffHTML.__index do local g
				g = {__index = function(t, i)
					if gfuncs and gfuncs[i] then g.__index, gfuncs = gfuncs return g.__index[i] end
				end}
				setmetatable(nonSelf, g)
				setmetatable(BHi, g)
			end
			for k in next, nonSelf do--any HTML objects returned by these funcs will be granted Module:Buffer enhancements
				local func = mwFunc[k]
				BHi[k] = function(t, ...) local HTML = func(t, ...) return parent[HTML] and HTML or setmetatable(parent(HTML, t), buffHTML) end
			end
			do local function joinNode(HTML, sep)
					local nodes, join = HTML.nodes
					if noCache and rawkey[sep] or Valid(sep) then join, HTML.nodes = tostring(rawset(HTML, 'nodes', {MB.__call(nodes, sep)})), nodes end
					return join or tostring(HTML)
				end
				for k, v in next, {
					getParent = function(HTML, ...) lastHTML = HTML return MBi.getParent(HTML:allDone(), ...) end,--return to Buffer that created the HTML tree
					getBuffer = function(HTML, ...) lastHTML = HTML return isMBfunc(lastBuffer, ...) end,--return to last used
					killParent = function(HTML, ...) MBi.killParent(HTML:allDone(), ...) return HTML end,
					_out = function(HTML, ...)
						if ...==0 then MBi._out(HTML.nodes, ...) return HTML end
						lastHTML, HTML = HTML, HTML:allDone()
						local n, ops, seps = select('#', ...)
						if n > 1 then
							local ops, seps = MBselect(n, ...)
							return parent[HTML]:_in(joinNode(HTML, rawget(seps, 0))):_out(ops, rawset(seps, buffHTML, true))
						end
						return parent[HTML]:_(joinNode(HTML, ...))
					end,
					_str = function(HTML, ...)--does not set lastHTML
						if ...==0 then return joinNode(HTML, select(2, ...)) end--passing 0 strings without calling allDone()
						local HTML, n = HTML:allDone(), select('#', ...)
						if n > 1 then
							local ops, seps = MBselect(n, ...)
							return parent[HTML]:_in(joinNode(HTML, rawget(seps, 1))):_str(ops, rawset(seps, buffHTML, true))
						end
						return joinNode(HTML, ...)
					end,
					_parent = function(HTML, ...) table.insert(HTML.nodes, parent[HTML:allDone()]:_str(...)) return HTML end
				} do BHi[k] = v end
			end
			do local htmlArg, skip, outFuncs = {parent=true,selfClosing=true,tagName=true}, {}
				do local out local function func(nodes, ...) return out(parent[nodes], ...) end
					outFuncs = setmetatable({
						tag = function(nodes, ...) return parent(setmetatable(init(nodes, ...), buffHTML), parent[nodes]) end,
						done = function(b, ops)
							b = parent[b] 
							while b.parent and ops~=0 do b, ops = b.parent, ops and ops - 1 or 0 end
							return b
						end
					}, {__index = function(nodes, i)
						if rawget(BHi, i) then out = BHi[i] return func end--rawget to exclude globals
					end})
				end
				Element = {
					_add = function(nodes, t)
						for k, v in MBpairs(t), t, skip[t] do (v~=true and MBmix or noOp)(nodes, v) end
						local HTML = parent[nodes] for k, v in MBpairs(t, false) do
							if htmlArg[k] then HTML[k] = v
							elseif v and v~=true then
								if nonSelf[k] then
									if k=='tag' then
										if type(v)=='table' then
											skip[v], k = 1, rawset(create(Valid(v[1])), 'parent', HTML)
											Element._add(spec(parent(k.nodes, k, table.insert(nodes, k)), Element), v)
											if k.selfClosing then k.nodes = nil else spec[k.nodes], parent[k.nodes] = nil end--free memory/reduce clutter; parent ref will auto-unset when k.nodes is nil
											if not k.tagName then k.styles, k.attributes = nil end
										else table.insert(nodes, create(v)) end
									elseif mwFunc[k] then
										if k=='done' and tonumber(v)~=v and v[1] and tonumber(v[1])==v[1] then skip[v] = 1 end
										MBmix(outFuncs[k](nodes, skip[v] and v[1]).nodes, v)
									elseif v[1] or v[2] then
										k = MBi[k](nodes, unpack(v, 1, rawset(skip, v, k=='_B' and 1 or 2)[v]))
										Element._add(getmetatable(k) and rawget(k, 'nodes') or k, v)--if k is not a table, then v should not contain any extra keys or this may error.
									else MBi[k](nodes, v) end--k probably == '_G' or '_R'
								elseif mwFunc[k] then
									if type(v)~='table' or rawget(v, 'nodes') then mwFunc[k](HTML, v)
									else
										local css = k=='css'
										for x, y in MBpairs(v, true) do (y and y~=true and mwFunc[k] or noOp)(HTML, css and x:gsub('_', '-') or x, y) end--iterate non-numbers first
										for _, y in MBpairs(v, nil) do (y and y~=true and mwFunc[k] or noOp)(HTML, y) end--don't bother with gsub since text must be quoted anyhow
									end
								elseif rawget(Element, k) or rawget(MBi, k) then
									if tonumber(v)==v or v[1]==nil or getmetatable(v) then (Element[k] or MBi[k])(nodes, v)--v is probably string-able object, or a table to be handled by :_all
									else (Element[k] or MBi[k])(nodes, unpack(v, 1, table.maxn(v))) end--v is definately a table
								else mwFunc.css(HTML, k:gsub('_', '-', 1), tostring(v)) end--oddly enough, :_add clocked its fastest runtime after adding auto-gsub as a feature
								skip[v] = nil
							end
						end
						return nodes
					end
				}
				local tempMeta = {mode='v', copy={styles=true,attributes=true}}
				function tempMeta.__index(t, i) return tempMeta.copy[i] and rawset(t, i, MBi._cc(false, 0, t.orig[i]))[i] or t.orig[i] end
				rawkey[setmetatable(Element, {__index = outFuncs, __concat=function(Element, v) return setmetatable({nodes=spec({}, Element),orig=parent[v]}, tempMeta) end})] = math.huge
			end
			function MBi:getHTML(...)
				lastBuffer = self
				if ... then
					if select('#', ...)==1 then return not rawkey[s] and tostring(...):match'^_' and BHi[...] and BHi[...](lastHTML) or lastHTML(...)
					else return assert(BHi[...], ('" %s " does not match any mw.html or Buffer-mw.html function'):format(tostring(...)))(lastHTML, select(2, ...)) end
				end
				return lastHTML
			end
			function MBi:_html(...) return MBi._(self, lastHTML, select(spec[self]==Element and select('#', ...)==0 and 1 or 2, true, ...)) end
			return init(...)
		end
		function _inHTML(self, ...)
			local HTML = init(nil, ...)
			if HTML.selfClosing and spec[self]==Element then self.last_concat = table.insert(self, HTML) return self end
			lastBuffer, lastHTML = self, setmetatable(parent(HTML, self), buffHTML)--set after 'args' table processed by :_add
			return HTML
		end
	end
	local _var, unbuild do local prev, rebuild
		local function init(...)--init replaced before return
			local function pick(b, v) return b and table.insert(b, v) or v end
			local function c(a, num) return rawset(a.a or a, 0, a[0] and a[0] + a.c or num and a[1] or a[1]:byte())[0] end
			local same, build, alt = {__tostring = function(a, b) return a.a[0] and pick(b, a.a.string and string.char(a.a[0]) or a.a.table and a.a[1][a.a[0]] or a.a[0]) end}, {
				__index = {c = 1},
				__tostring = function(t) return t:_build() end,
				table = function(a, b) local i = next(a[1], a[0]) or a[0]==#a[1] and next(a[1]) return pick(b, rawset(a.a or a, 0, i)[1][i]) end,--change rate (a.c) ignored since users control the table's contents
				number = function(a, b) return pick(b, c(a, true)) end,
				string = function(a, b) return pick(b, string.char(c(a))) end
			}, {__index = function(a, i) return a.a[i] end, __tostring = function(a, b) return (rawget(a, 0) and a[0]==tostring(a[0]) and rawset(a, 0, a[0]:byte()) or a).a._build(a, b) end}
			local function shift(t, c)
				t[0] = t[0] and t[0] + c or t:_build() and t[0] - t.c + c
				if t.table then t[0] = (t[0] - 1) % #t[1] + 1 end
			end
			function rebuild(...)
				local v, c = ...
				if v or select('#', ...)==0 then
					if v and not c then return prev end
					local meta, c = select(v and 1 or 3, alt, c, same, 0)
					return setmetatable({a = prev, _build = meta.__tostring, c = c}, meta)
				elseif v==nil then--no-op
				elseif c then shift(prev, c)--v == false
				else prev:_build() end
			end
			init, noCache = function(v, c) prev = setmetatable({v, c = c, _build = build[type(v)] or v, [type(v)] = true, alt = {}}, build) return prev end, true
			return init(...)
		end
		function unbuild(sep)
			for k, v in MBpairs(sep, nil) do
				k = getmetatable(v) if k and (k==build or k==alt) then shift(v.a or v, -v.c) end
			end
		end
		function _var(self, ...)
			local obj if ... and ...~=true then obj = init(...)
			elseif prev then
				if ...~=false then obj = rebuild(...)
				else rebuild(...) end
			end
			return obj and MBi._(self, obj, nil, true) or self
		end
	end
	local lib; MBi = setmetatable({stream = _stream,
		_inHTML = _inHTML,
		_var = _var,
		_ = function(self, v, ...)
			local at, raw = select(select('#', ...)==1 and ...==true and 1 or 2, nil, ...)
			if raw then rawkey[self] = math.huge else v = Valid(v) end
			if v or raw then
				if at or rawkey[self] then raw = #self end--if length increases by more than one after table.insert, then set rawkey[self] = math.huge; rawkey[self] may be equal to a previous 'at'
				at, self.last_concat = at and (tonumber(at)~=at and raw + at or at)
				table.insert(self, select(at and 1 or 2, at, v))
				if at and at < 0 or raw and #self - raw > 1 then rawkey[self] = math.huge elseif at and #self==raw then rawkey[self] = rawkey[self] and math.max(rawkey[self], at) or at end
			end--above line looks bizarre because one table.insert op may make length jump from 0 to 8: local wtf={[2]=2,[4]=4,[8]=8}mw.log(#wtf,table.insert(wtf,1),#wtf)
			return self
		end,
		_nil = function(self, at, ...)
			if ...~=true and ...~=false then--faster than type(...) ~= 'boolean'
				if not at or at=='0' then
					self[#self] = ... if ... then rawkey[self] = math.huge end
				else
					local n, v = tonumber(at), ...
					if n~=at then 
						if n then n = #self + at
						elseif at~=true and select('#', ...)==0 then v, n = at, #self end
					end
					if n then 
						if v==nil and n > 0 then table.remove(self, n)
						else self[math.floor(n)], rawkey[self] = v, math.huge end--floor position for consistency with Table library
					end
				end
				self.last_concat = nil
			end
			return self
		end,
		_all = function(self, t, valKey)
			for k, v in MBpairs(t) do MBmix(self, v, valKey) end
			for k, v in valKey and MBpairs(t, false) or noOp, t do
				if tonumber(v) then MBi._(self, k, v)--self not always a buffer
				elseif rawget(MBi, k) and v and v~=true then
					if v[1]==nil or getmetatable(v) then MBi[k](self, v)
					else MBi[k](self, unpack(v, 1, table.maxn(v))) end
				end
			end
			return self
		end,
		_str = function(t, ...)
			local n = select('#', ...)
			if n > 1 then
				local k, ops, seps, r = 2, MBselect(n, ...)
				r = MB(t(seps[1]))
				while parent[t] and ops > 1 and r:_(parent[t](seps[k]), 1) do t, k, ops = parent[t], k + 1, ops - 1 end
				return table.concat(r, seps[k] or nil)
			end
			return MB.__call(t, ...)
		end,
		_in = function (self, ...) return parent(MB(...), self) end,
		_out = function(t, ...)
			if ...==0 then return parent(t, parent[t], MBi._cc(t, t, MB.__call(t, (select(2, ...))), getmetatable(t))) end--love how :_cc needed nothing new to implement this *self pat on back*
			local n = select('#', ...)
			if n > 1 then
				local k, ops, seps = 1, MBselect(n, ...)
				while parent[t] and ops > 0 do t, k, ops = parent[t]:_(t(seps[k])), k + 1, ops - 1 end
			elseif parent[t] then return parent[t]:_(t(...)) end
			return t
		end,
		_cc = function(self, clear, copy, meta)
			if clear then
				if rawequal(clear, copy) then return self, spec[MBi._cc] and setmetatable(spec[MBi._cc], MB)--rawequal to avoid re-string via __eq in case both are different Buffer objects
				elseif copy==true then copy = self end
				if clear~=0 then
					assert(type(clear)=='table', debug.traceback('Buffer:_cc can only "clear" tables. Did you forget to call with a colon?', 2))--errors can be hard to trace without this
					for k in self and next or noOp, clear do rawset(clear, k, nil) end
				else return MBi._cc(false, {unpack(copy)}, copy) end--copy length w/o empty strings; recursion to avoid self = false causing garbage collection (non-weak child may exist)
				if self==false or copy and type(copy)=='table' then--self==false means copy is a table (saves a type op for recursive calls)
					meta = meta or getmetatable(copy)
					if self and #copy > 1 then--preserves length with empty strings; developed from studying http://www.lua.org/source/5.1/ltable.c.html		
						local n, null, i, e = #copy, {}, math.ldexp(2, select(2, math.frexp(#copy)) - 2)
						e, spec[MBi._cc], parent[null] = i - 1, null, clear
						for k = 1, e do table.insert(clear, false) end
						while i<=n do table.insert(clear, i, '') i, null[i] = i + math.ldexp(2, select(2, math.frexp(n - i)) - 2), '' end
						for k = 1, e do rawset(clear, k, nil) end
					end
					for k, v in next, copy do rawset(clear, k, type(v)=='table' and MBi._cc(false, 0, v) or v) end
				elseif copy then rawset(clear, 1, (Valid(copy))) end
				rawkey[setmetatable(clear, meta)], parent[clear] = rawkey[copy], parent[copy]
			end
			return self and rawset(self, 'last_concat', nil) or clear
		end,
		_parent = function(self, ...) return parent[self] and MBi._(self, parent[self]:_str(...)) or self end,
		getParent = function(self, ...) return isMBfunc(parent[self] or parent[parent(self, setmetatable({}, MB))], ...) end,
		killParent = function(self, ...) return parent[self] and isMBfunc(parent[self], ...) and parent(self) or self end,
		_build = function(self, t) table.insert(t, self()) end,--for compatibility with mw.html:node()
		last_concat = false--prevent library check
	}, {__index = function(t, i)--import string, mw.text, and mw.ustring libraries on an as-needed basis
		local func = string[i] or mw.text[i] or mw.ustring[i] or type(i)=='string' and mw.ustring[i:match'^u(.+)'] if func then
			lib	= lib or function (s, f, ...)
				if parent[s] and next(s)==nil then return s:_((f(tostring(parent[Element and (spec[s]==Element and s:allDone() or spec[parent[s]]==Element and parent[s]) or s]), ...))) end
				return f(tostring(s), ...)--not using ternary/logical operators here to allow multiple return values
			end
			return rawset(t, i, i:match'^u?gsub' and function(self, p, r, ...)return lib(self, func, p, r or '', ...)end--Why are ugsub/gsub special? because empty strings are against my religion!
				or function(self, ...)return lib(self, func, ...)end)[i]
		end
	end})
end

function MBmix(t, v, ...) return v and ((type(v)~='table' or getmetatable(v)) and MBi._(t, v) or (select('#', ...)==0 and spec[t] and spec[t]._add or MBi._all)(t, v, ...)) or t end--:_all always passes two args

local _G, new_G = _G--localize _G for console testing (console _G ~= module _G)
return setmetatable({__index = function(t, i) return spec[t] and spec[t][i] or MBi[i] end,
	__call = function(t, ...)
		local rawsep, sep, i, j, raw = noCache and rawkey[...] and ..., ...
		if i or j or rawsep or Valid(sep) then
			raw, sep, i, j = rawkey[spec[t]] or rawkey[t], rawsep or Valid(sep), i and (i~=tonumber(i) and i + #t or i), j and (j~=tonumber(j) and j + #t or j)
			if rawsep or raw and (raw>=(j or #t) or i < 1) then
				raw, i, j = {}, i and math.floor(i), j and math.floor(j)--floor for consistency with table.concat(t, sep, i, j), which ignores decimals
				raw.lc, t.last_concat = t.last_concat--temporarily unset last_concat to prevent disqualification from mapless iteration
				for k, v in MBpairs(t) do
					if raw[1] or not i or k>=i then if j and k > j then break end
						if raw.s then raw.s = table.insert(raw, tostring(sep)) end--if sep contains v and v is a Buffer-variable, sep must be strung before v
						k = Valid(v) if k then
							raw.s = rawsep or sep and raw[1] and table.insert(raw, sep)
							table.insert(raw, k)
						end
					end
				end
				if rawsep and not raw.s then raw[#raw] = unbuild(sep) end--unbuild rawsep if final index in t was invalid
				t.last_concat = raw.lc return table.concat(raw)
			end
			return table.concat(t, sep, i and math.max(i, 1), j and math.min(j, #t))
		end
		return MB.__tostring(t)
	end,
	__tostring = function(t)
		if t.last_concat then return t.last_concat end
		local r = rawkey[spec[t]] or rawkey[t]
		r = table.concat(r and r>=#t and MBi._all({}, t) or t)
		return (noCache or rawset(t, 'last_concat', r)) and r
	end,
	__concat = function(a, b)
		if buffHTML then
			for k = 1, 2 do local v = select(k, a, b)--faster than for k, v in pairs{a, b} do
				if v and spec[v] and spec[v]==Element then
					if parent[v].selfClosing then
						if rawequal(a, b) then return (not noCache or parent[v].tagName) and v:_str(0):rep(2) or v:_str(0)..v:_str(0) end--rawequal avoids premature tostring of Buffer:_var objects;
						b, a = select(k, b, parent[v], a)
					else local temp = Element .. v --helper method; returns a mirror of parent[v]
						MBmix(MBmix(parent(temp.nodes, temp), a), k==1 and spec[b]==Element and parent[b] or b)
						return buffHTML.__tostring(setmetatable(temp, {__index=parent[v], __mode='v'}))--switch from tempMeta to avoid MBi._cc op of styles/attributes
					end
				end
			end
		end
		return table.concat(MBmix(MBmix({}, a), b))
	end,
	__pairs = MBpairs,
	__ipairs = MBpairs,
	__eq = function(a, b) return tostring(a)==tostring(b) end--avoid a==b in this module; use rawequal(a,b) when they may be different Buffers (premature tostring waste ops and is bad for Buffer:_var)
}, {__tostring = function()return''end,
	__call = function(self, ...) MB = MB or self
		if new_G then if ... and _G and ...==_G then new_G = ... end
		elseif ... and (...==_G or type(...)=='table' and (...)._G==...) then
			local Nil, mG = {}, (...):getmetatable() or (...):setmetatable{}:getmetatable()
			new_G, _G, gfuncs = ..., ..., {--gfuncs stored for Buffer:_inHTML; new_G is a is a Module:Buffer local declared just before the final return statement.
				_G = function(self, i, ...)
					local X, save = rawget(new_G, i), select('#', ...)==0 and self or ...
					if i and i~=true and not (X and save and rawequal(X, save)) and rawset(new_G, i, save) and (X~=nil or save==nil and new_G[i]~=nil) then--rawequal in case X is another buffer
						local mG = getmetatable(new_G) or {__call=mG.__call}
						if mG.__index then pcall(rawset, mG.__index, i, X)
						else mG.__index = setmetatable(new_G, mG) and {[i] = X} end
					end
					return self, ...--avoiding __eq with rawequal(self,save) is overkill since buffers can self-save without being passed as save
				end,
				_R = function(self, i, v, m)
					if i~='new_G' then if i and i~=true then rawset(new_G, i , v) end
					elseif not v or v==true or v._G~=_G then new_G = setmetatable(v~=true and v or {}, {__call = mG.__call, __index = v~=true and m~=true and (m or new_G) or nil})
					else new_G, (not m and (m~=nil or v==new_G) and Nil or getmetatable(v)).__index = v, m~=true and (m or new_G) or nil end--setting Nil.__index is noOp
					return self
				end,
				_2 = function(self, ...)
					if new_G[...]~=nil then return new_G[...] end--higher priority so Buffer:_G('new_G', ...) can prevent an overwrite
					if ...=='new_G' then return rawset((select('#', ...)~=1 and MBi._R(new_G, ...) or new_G), '_G', _G) end
					return select(select('#', ...)==1 and 1 or 2, self:_G(...))--return only one value; 'return select(2, self:_G(...)) or self' doesn't work for returning nil
				end,
				_B = function(self, v) return v or v==nil and Nil end
			} for k, v in next, gfuncs do MBi[k] = v end 
			setmetatable(Nil,{__concat=MB.__concat,__newindex=noOp,__call=noOp,__tostring=noOp,__metatable=MB,__index=setmetatable({_B=MBi._B,_=function()return Nil end,last_concat=''},
				{__index=function(t,i)return (MBi[i] or i and not tonumber(i)) and t._ or nil end})})
			function mG.__call(G, k, ...) return (k._G or G.type(k)=='table') and (G.select('#', ...)~=1 and G.rawset(k, ...) or G:rawset(..., k) and k) or G:rawset(k, (...)) and ... end
		end
		local new = setmetatable({}, self)
		if ... and (...)==new_G then return select(2, ...) and MBmix(new:_G((select(2, ...))), select(3, ...)) or new end
		return ... and MBi._(new, ...) or new
	end,
	__index = function(t, i)
		MB = MB or t return MBi[i] and function(...) return MBi[i](setmetatable({}, t), select(...==t and 2 or 1,...)) end
	end
})