The Queen's Gambit Wiki
Explore
Main Page
Discuss
All Pages
Community
Interactive Maps
Recent Blog Posts
About the series
Characters
Elizabeth Harmon
Mrs. Alma Wheatley
Benny Watts
Jolene
Harry Beltik
William Shaibel
Episodes
1 - Openings
2 - Exchanges
3 - Doubled Pawns
4 - Middle Game
5 - Fork
6 - Adjournment
7 - End Game
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
The Queen's Gambit wiki
64
pages
Explore
Main Page
Discuss
All Pages
Community
Interactive Maps
Recent Blog Posts
About the series
Characters
Elizabeth Harmon
Mrs. Alma Wheatley
Benny Watts
Jolene
Harry Beltik
William Shaibel
Episodes
1 - Openings
2 - Exchanges
3 - Doubled Pawns
4 - Middle Game
5 - Fork
6 - Adjournment
7 - End Game
Editing
Module:Formatlist
Back to page
Edit source
View history
Talk (0)
Edit Page
Module:Formatlist
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
--[[ -- Module:Formatlist -- -- Module for manipulating lists -- -- author: .jun ]] local p = {} --[[ -- Accepts a list of items and formats it into an unordered list -- Used in infobox lists -- -- {{#invoke: Formatlist|bold|List item 1|List item 2 (descriptive text)|''List item 3''}} -- -- * '''List item 1''' -- * '''List item 2''' (descriptive text) -- * '''''List item 3''''' ]] function p.bold(frame) args = frame:getParent().args local str = '' for i, v in ipairs(args) do local pattern = '( +%([^%)]+%))$' local a = '*' .. '\'\'\'' .. mw.ustring.gsub(v, pattern, '') .. '\'\'\'' if mw.ustring.find(v, pattern) then a = a .. mw.ustring.sub(v, mw.ustring.find(v, pattern)) end a = a .. '\n' str = str .. a end return str end --[[ -- Accepts a list of item with an index and formats it into an ordered list beginning from that index -- -- {{#invoke: Formatlist|ol|12|List item 1|List item 2}} -- -- 12. List item 1 -- 13. List item 2 ]] function p.ol(frame) frame = frame.args local index = frame['index'] or 1 local str = '<ol start="' .. index .. '">' local args = 0 for i, v in ipairs(frame) do args = args + 1 end for i = 1, args do str = str .. '<li>' .. frame[i] .. '</li>' end str = str .. '</ol>' return str end return p
Summary:
Please note that all contributions to the The Queen's Gambit Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Formatlist/doc
(
edit
)
Follow on IG
TikTok
Join Fan Lab