Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Wikipedia fork
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
Move
General
What links here
Related changes
Special pages
Page information
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!
local mHatnote = require('Module:Hatnote') local mArguments = require('Module:Arguments') local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local p = {} function p.wikipedia_fork(frame) -- Get arguments from the frame local args = mArguments.getArgs(frame) return p._wikipedia_fork(args) end function p._wikipedia_fork(args) -- Check that args is a table checkType('_wikipedia_fork', 1, args, 'table', true) args = args or {} -- Retrieve the article name and import date local articleName = args.article_name or mw.title.getCurrentTitle().text local importDate = args.import_date or "an unknown date" -- Create the forked article message local message = string.format( "This article was forked from the [https://en.wikipedia.org/wiki/%s Wikipedia article] on %s.", mw.uri.encode(articleName, "PATH"), -- Encode the article name for URL importDate ) -- Define the hatnote options to enforce `<div>` and add classes local hnOptions = { selfref = args.selfref or false, inline = 0, -- Force `<div>` structure extraclasses = 'hatnote navigation-not-searchable' } -- Return the message wrapped in a hatnote return mHatnote._hatnote(message, hnOptions) end return p
Summary:
Please note that all contributions to Ikwipedia are considered to be released under the Creative Commons Attribution-ShareAlike (see
Ikwipedia:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, 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.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Wikipedia fork/doc
(
edit
)
Toggle limited content width