Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Find sources/doc
(section)
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
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!
== Usage == === From wikitext === Usually, from wikitext this module should be used via a template, e.g. {{tl|find sources}}. However, it is also possible to use it directly from #invoke, like this: {{#invoke:Find sources|''template''|''search term 1''|''search term 2''|...}} * <var>template</var> is the name of the template that should be called. It must be the full page name of the template, without the namespace, and with the correct capitalisation. So, for [[Template:Find sources]], the template name should be "Find sources"; "find sources" with a lower-case "f" would cause an error. This parameter is required. * <var>search term 1</var>, <var>search term 2</var>, etc., are the terms to be searched for in each of the search engine links. The first search term will appear in quotation marks, and subsequent search terms will be added without quotation marks. Each term will be separated by spaces. These parameters are all optional. If no parameters are given, the current page name will be used as a search term. Alternatively the following can be used, which will convert any title to a search query, with the main portion of the title in quotation marks, and any parenthetical disambiguator outside quotation marks. {{#invoke:Find sources|''template''|title=''title''}} * <var>template</var> as above, is the name of the template that should be called. It must be the full page name of the template, without the namespace, and with the correct capitalisation. So, for [[Template:Find sources]], the template name should be "Find sources"; "find sources" with a lower-case "f" would cause an error. This parameter is required. * <var>title</var> the title to be converted to a search query. This is processed in the same way as the subpage name of the page if no parameters are used. === From Lua === Load the module with the following code: <syntaxhighlight lang="lua"> local mFindSources = require('Module:Find sources') </syntaxhighlight> You can then produce the list of search links like this: <syntaxhighlight lang="lua"> mFindSources._main(template, searchTerms) </syntaxhighlight> * <var>template</var> is the template name, as outlined in the [[#From wikitext]] section above. This parameter is required. * <var>searchTerms</var> is an array of search terms. Each item in the array corresponds to a numbered search term as outlined in the [[#From wikitext]] section above. Alternatively, an empty table with the <code>title</code> key set will automatically generate a query as described above. This parameter is optional. Example syntax: <syntaxhighlight lang="lua"> mFindSources._main('Find sources', {'Albert Einstein', '-"Marilyn Monroe"', 'relativity', 'science'}) </syntaxhighlight> === Available templates === The following templates are available for use: {{#invoke:Find sources/autodoc|templateTable}}
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)