Module:Commons link/doc

For testing the sandbox, see Module:Commons link/sandbox/testcases.

Usage

 * Use wikidata to find Commons gallery corresponding to this article. If unable to find gallery in wikidata, default to searching for PAGENAME in Commons.


 * Link to Commons gallery at . Optionally, use   as displayed link text.


 * Link to Commons search for . Optionally, use   as displayed link text.


 * Use wikidata first, then if failure, use Commons search for . Optionally, use   as displayed link text.


 * Use wikidata to find Commons category corresponding to this article. If unable to find category in wikidata, default to searching for Category:PAGENAME in Commons.


 * Link to Commons category at . Optionally, use   as displayed link text.


 * Link to Commons search for . Optionally, use   as displayed link text.


 * Use wikidata first, then if failure, use Commons search for . Optionally, use   as displayed link text.


 * Use wikidata to find "best" single Commons link: try gallery first, fall back to category. Other arguments as above.


 * Lua to implement commons and category: return Commons gallery, Commons category, or both (if both found)


 * Either GalleryName or CategoryName or both can be supplied, will override wikidata search


 * Format of first link can be specified (any combination of bold, italic, nowrap, and lower-case first character)


 * Text in the first link, and the second (category) link can be overridden, also.


 * Module can generate tracking categories for mismatch between supplied arguments and Wikidata.