打开/关闭搜索
搜索
打开/关闭菜单
14
3
270
269
普罗百科
导航
首页
最近更改
需要的页面
所有页面
随机页面
招聘
特殊页面
上传文件
内容
条目
文章
档案馆
引言
关于
关于普罗百科
原则
參與貢獻
赞助
社群
Lemmygrad
Twitter
Reddit
Facebook group
Discord server
Matrix space
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
讨论
贡献
登录
请求账号
查看“Module:网络引用”的源代码
来自普罗百科,无产者的百科全书
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
Module:网络引用
因为以下原因,您没有权限编辑本页:
您没有权限编辑
Module
命名空间内的页面。
您可以查看和复制此页面的源代码。
local p = {} local function is_set (var) return not (var == nil or var == ''); end local function italics (var) return "''" .. var .. "''" end function p.cite( frame ) local pframe = frame:getParent() local Author = pframe.args['作者'] or pframe.args.author local Date = pframe.args['日期'] or pframe.args['date'] local Title = pframe.args['标题'] or pframe.args.title local URL = pframe.args.url local Newspaper = pframe.args['报纸'] or pframe.args.newspaper local ArchiveURL = pframe.args['存档-url'] local ArchiveDate = pframe.args['存档日期'] or pframe.args['archive-date'] local Retrieved = pframe.args['搜索日期'] or pframe.args.retrieved local Quote = pframe.args['引用'] or pframe.args.quote local Image = pframe.args['图片'] or pframe.args.image local ImageCaption = pframe.args['image-caption'] if is_set (Author) then if is_set (Date) then first_part = Author .. " (" .. Date .. ")." else first_part = Author .. "." end else first_part = "" end if is_set (Image) then local span = mw.html.create ( 'span' ) span :wikitext('[[File:' .. Image .. '|center|300px|frameless]]') local br = mw.html.create ('br', selfClosing) if is_set(ImageCaption) then local caption = mw.html.create ('div') caption :attr("style", "text-align:center;font-size:85%;") :wikitext(ImageCaption) first_part = tostring(span) .. tostring(caption) .. first_part else first_part = tostring(span) .. first_part end end if is_set (Title) then if is_set (URL) then Title = "[" .. URL .. " " .. "\"" .. Title .. "\"" .. "]" end if not is_set (Author) then if is_set (Date) then Title = Title .. " (" .. Date .. ")." else Title = Title .. "." end end second_part = Title else second_part = "" end if is_set(Newspaper) then third_part = "''" .. Newspaper .. "''." else third_part = "" end if is_set(ArchiveURL) then if is_set(ArchiveDate) then fourth_part = "[" .. ArchiveURL .. " " .. "Archived" .. "]" .. " " .. " from the original on" .. " " .. ArchiveDate .. "." else fourth_part = "[" .. ArchiveURL .. " " .. "Archived" .. "]" .. " from the original." end else fourth_part = "" end if is_set (Retrieved) then fifth_part = "Retrieved" .. " " .. Retrieved .. "." else fifth_part = "" end if is_set (Quote) then Quote = string.gsub(Quote,"\n","<br>") Quote = "“" .. Quote .. "”" local div = mw.html.create ('div') div :attr("style", "width:80%; margin-left:10%;") :wikitext(Quote) local br = mw.html.create ('br', selfClosing) first_part = italics(tostring(div)) .. tostring(br) .. first_part end if is_set (first_part) then first_part = first_part .. " " end if is_set (second_part) then second_part = second_part .. " " end if is_set (third_part) then third_part = third_part .. " " end if is_set (fourth_part) then fourth_part = fourth_part .. " " end Render = first_part .. second_part .. third_part .. fourth_part .. fifth_part return Render end return p
本页使用的模板:
Module:网络引用/doc
(
查看源代码
)
返回
Module:网络引用
。