Module talk:Title

From Wikiversity
Jump to navigation Jump to search

Purpose

[edit source]

Demonstrates the use of Title object properties, as defined in the Lua reference manual.

Invoke

[edit source]
  • baseText: Title
  • canTalk: true
  • exists: true
  • fileExists:
  • fragment:
  • fullText: Module talk:Title
  • getContent: local p = {}

function p.canTalk(frame) local title = mw.title.getCurrentTitle() return title.canTalk end

function p.baseText(frame) local title = mw.title.getCurrentTitle() return title.baseText end

function p.exists(frame) local title = mw.title.getCurrentTitle() return title.exists end

function p.fileExists(frame) local title = mw.title.getCurrentTitle() return title.fileExists end

function p.fragment(frame) local title = mw.title.getCurrentTitle() return title.fragment end

function p.fullText(frame) local title = mw.title.getCurrentTitle() return title.fullText end

function p.getContent(frame) local text = mw.text.trim(frame.args[1]) local namespace = mw.text.trim(frame.args[2]) local title = mw.title.new(text, namespace) return title:getContent() end

function p.id(frame) local title = mw.title.getCurrentTitle(); return title.id end

function p.inNamespace(frame) local title = mw.title.getCurrentTitle(); return title:inNamespace(0) end

function p.inNamespaces(frame) local title = mw.title.getCurrentTitle(); return title:inNamespaces(0) end

function p.interwiki(frame) local title = mw.title.getCurrentTitle(); return title.interwiki end

function p.isContentPage(frame) local title = mw.title.getCurrentTitle(); return title.isContentPage end

function p.isExternal(frame) local title = mw.title.getCurrentTitle(); return title.isExternal end

function p.isLocal(frame) local title = mw.title.getCurrentTitle(); return title.isLocal end

function p.isRedirect(frame) local title = mw.title.getCurrentTitle(); return title.isRedirect end

function p.isSpecialPage(frame) local title = mw.title.getCurrentTitle(); return title.isSpecialPage end

function p.isSubpage(frame) local title = mw.title.getCurrentTitle(); return title.isSubpage end

function p.isTalkPage(frame) local title = mw.title.getCurrentTitle(); return title.isTalkPage end

function p.isSubpageOf(frame) local title = mw.title.getCurrentTitle(); local text = mw.text.trim(frame.args[1]) local namespace = mw.text.trim(frame.args[2]) local title2 = mw.title.new(text, namespace) return title:isSubpageOf(title2) end

function p.new(frame) local text = mw.text.trim(frame.args[1]) local namespace = mw.text.trim(frame.args[2]) local title = mw.title.new(text, namespace) return title.id end

function p.nsText(frame) local title = mw.title.getCurrentTitle(); return title.nsText end

function p.prefixedText(frame) local title = mw.title.getCurrentTitle() return title.prefixedText end

function p.rootText(frame) local title = mw.title.getCurrentTitle() return title.rootText end

function p.subjectNsText(frame) local title = mw.title.getCurrentTitle() return title.subjectNsText end

function p.subpageText(frame) local title = mw.title.getCurrentTitle() return title.subpageText end

function p.text(frame) local title = mw.title.getCurrentTitle() return title.text end

return p

  • id: 150788
  • inNamespace( ns ): false
  • inNamespaces( ... ): false
  • interwiki:
  • isContentPage: false
  • isExternal: false
  • isLocal: true
  • isRedirect: false
  • isSpecialPage: false
  • isSubpage: false
  • isTalkPage: true
  • isSubpageOf: false
  • new: 150787
  • nsText: Module_talk
  • prefixedText: Module talk:Title
  • rootText: Title
  • subjectNsText: Module
  • subpageText: Title
  • text: Title

Discussion

[edit source]