Jump to content
Wikipedia The Free Encyclopedia

Module:Road data/browsetable

From Wikipedia, the free encyclopedia
Module documentation[view] [edit] [history] [purge]
This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing.
Page template-protected This module is currently protected from editing.
See the protection policy and protection log for more details. Please discuss any changes on the talk page; you may submit an edit request to ask an administrator to make an edit if it is uncontroversial or supported by consensus. You may also request that this page be unprotected.
Warning This Lua module is used on approximately 18,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.

This module exports the functions browsetable (for use from wikitext) and _browsetable (for use within Lua). The functions can serve as a container for the output of Module:Road data/browse while also adding padding between multiple instances of Module:Road data/browse.

Example

{{Box|width=20em|padding=8px|
{{#invoke:Road data/browsetable|browsetable|
{{oh browse|previous_type=SR|previous_route=222|route=OH|next_type=OH 1927|next_route=223|next_dab=1927-1930}}
{{mi browse|previous_type=M|previous_route=222|route=MI|next_type=M|next_route=227}}
}}
}}
SR 222 OH SR 223
M-222 MI M-227
The above documentation is transcluded from Module:Road data/browsetable/doc. (edit | history)
Editors can experiment in this module's sandbox (edit | diff) and testcases (edit) pages.
Subpages of this module.

 localp={}

 functionp._browsetable(content,styles)
 ifnotcontentthenreturnnilend

 localtbl=mw.html.create('table'):addClass('browse-table')
 tbl:wikitext(content)
 tbl:cssText(styles)

 returnmw.getCurrentFrame():extensionTag{
 name='templatestyles',args={src='Module:Road data/browsetable/styles.css'}
 }..tostring(tbl)
 end

 functionp.browsetable(frame)
 localgetArgs=require('Module:Arguments').getArgs
 localargs=getArgs(frame)
 returnp._browsetable(args[1],args.style)
 end

 returnp

AltStyle によって変換されたページ (->オリジナル) /