Template:Metatemplate

From Library
Jump to navigation Jump to search

(Purpose: to create new templates in a consistent format)


(Purpose: to create template pages for temporary transclusions as article markup ‘cheat sheets’)

To do; from 4 August 2022

(Move to: Library:Daily notes/Unresolved/To do/2022-08-04; perhaps better to a named section, such as Library:Daily notes#Unresolved#2022-08-04??)

To do:

* Make template and prototype ‘subst’ statement to create an HTML comment in wikitext
  (make it language-neutral, e.g.:
    - Template:Subst produces: < ! - - comment - - > (without spaces, of course)
    - Template:Subst   produces: // comment
    - Template:Subst produces: # comment
    - Template:Subst    produces: /* comment */
    - Template:Subst   produces: ??
* Make similar templates for other types of markup and elements, e.g.:
    - URL links for setext / wikitext HTML / bbCode / GFM markdown / ‘communities’ sites / etc.

Demo for certain HTML tags:

(Move to: Template:Demo markup/HTML; perhaps better to a named section, such as Template:Demo markup#HTML??)

Semantic markup:

Abbreviation; <abbr>Example contents</abbr>
Example contents
<address>Example contents</address>
<address>Example contents</address>
<addr>Example contents</addr>
<addr>Example contents</addr>
Citation; <cite>Example contents</cite>
Example contents
Computer code; <code>Example contents</code>
Example contents
Definition; <dfn>Example contents</dfn>
Example contents
User input; <kbd>Example contents</kbd>
Example contents
Highlighted; <mark>Example contents</mark>
Example contents
Output sample; <samp>Example contents</samp>
Example contents
Math variable; <var>Example contents</var>
Example contents

Data:

Time; <time>Example contents</time>
Time, machine-readable; <time parameter=??>Example contents</time>

Other:

Quotation; <q>Example contents</q>
Example contents
Strikethrough; <s>Example contents</s>
Example contents
Insertion; <ins>Example contents</ins>
Example contents
Deletion; <del>Example contents</del>
Example contents
Plain text; <span>Example contents</span>
Example contents

Archaic tags

🦬

(based on when introduced)

Prior to HTML 3.02:

(aka ‘tag soup’)

HTML 3.02:
HTML 4:
XHTML:
HTML 5:

Proposed for HTML, but never implemented:

Universal header tag; <h>
Multiple levels would be rendered hierarchically at the time the page is loaded.

XML:

SGML:


Demo for certain MediaWiki ‘Magic Words’:

(Move to: Template:Demo markup/Wikitext/MediaWiki/Magic words; perhaps better to a named section, such as Template:Demo markup#Wikitext#MediaWiki Magic Words??)


Page variables

{{PAGENAME}}
Metatemplate
{{ROOTPAGENAME}}
Metatemplate
{{NAMESPACE}}
Template

Path-related

{{localurl:full page name}}
/Full_page_name
{{localurl:full page name |query=example}}
/w/index.php?title=Full_page_name&query=example
{{fullurl:full page name}}
https://library.jimgrisham.com/Full_page_name
{{fullurl:full page name |query=example}}
https://library.jimgrisham.com/w/index.php?title=Full_page_name&query=example
{{canonicalurl:full page name}}
https://library.jimgrisham.com/Full_page_name
{{canonicalurl:full page name |query}}
https://library.jimgrisham.com/w/index.php?title=Full_page_name&query
{{filepath:file name}}
{{filepath:testimagefile}}
{{urlencode:test string}}
test+string
{{urlencode:test string|PATH}}
test%20string
{{urlencode:test string|WIKI}}
test_string
{{anchorencode:test string}}
test_string
{{ns:1}}
Talk
{{nse:1}}
Talk
{{#rel2abs:relative.file.path}}
relative.file.path
{{#titleparts:example page name|2|first segment}}
Example page name
{{#titleparts:{{ROOTPAGENAME}}|1}}
Metatemplate
<!-- Documentation from [[w:Help:Magic words#Paths]]:

Function		 	 	 	 	Description
- - - - - - - - - - - - - - - - - - - - - - - - 	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{localurl:fullpagename |query}} 	 	 	Relative path to page name. The query parameter is optional.
{{fullurl:fullpagename |query}}		 	 	Absolute path, without protocol prefix (i.e. without " http: " etc.), to page name. 
	 	 	 	 	 	 	 The query parameter is optional.
{{canonicalurl:fullpagename |query}} 	 	 	Absolute path, including protocol prefix, to page name. The query parameter is optional.
{{filepath:filename}}		 	 	 	Absolute path to the media file filename.
{{urlencode:string}}		 	 	 	Encodes string for use in URL query strings; 
							 {{urlencode:test string}}, for example, produces: test+string.
							 To encode string for use in URL paths or MediaWiki page names, 
	 	 	 	 	 	 	  append, respectively, |PATH or |WIKI (to produce "test%20string" or "test_string").
{{anchorencode:string}}		 	 	 	Input encoded for use in MediaWiki URL section anchors.
{{ns:n}}		 	 	 	 	Returns the name of the namespace whose index is the number n. 
	 	 	 	 	 	 	 For MediaWiki URLs, use {{nse:}}.
{{#rel2abs:path}}		 	 	 	Converts a relative file path to an absolute path.
{{#titleparts:fullpagename|number|first segment}}	Splits the fullpagename (title) into that number of segments.
-->

Namespace assignments

(Move to: Template:Debug templates/MediaWiki/Namespace)

(Per {{ns:1}} vs. {{nse:1}} )

NS#: Name / URL prefix

Virtual
  • -2: Special / Media
  • -1: Special / Special
  • 0: /
Core
  1. Talk / Talk
  2. User / User
  3. User talk / User_talk
  4. Library / Library
  5. Library talk / Library_talk
  6. File / File
  7. File talk / File_talk
  8. MediaWiki / MediaWiki
  9. MediaWiki talk / MediaWiki_talk
  10. Template / Template
  11. Template talk / Template_talk
  12. Help / Help
  13. Help talk / Help_talk
  14. Category / Category
  15. Category talk / Category_talk
  16. /
  17. /
  18. /
  19. /
  20. /
  21. /
  22. /
  23. /
  24. /
  25. /
  26. /
  27. /
  28. /
  29. /
  30. /
  31. /
  32. /
  33. /
  • -
  • 40: /
  • 50: /
  • 60: /
  • 70: /
  • 80: /
  • 90: /
WikiLexicalData
  • 16: / (Expression: NS_EXPRESSION)
  • 17: / (Expression_talk:)
  • -
  • 24: / (DefinedMeaning: NS_DEFINEDMEANING)
  • 25: / (DefinedMeaning_talk:)
LiquidThreads

(90-99)

  • 90: / (Thread: NS_LQT_THREAD)
  • 90: / (Thread_talk: NS_LQT_THREAD_TALK)
  • 92: / (Summary: NS_LQT_SUMMARY)
  • 93: / (Summary_talk: NS_LQT_SUMMARY_TALK)
  • -
  • 99: /
Extension and non-standard

[1]

  • 100: /
  • 101: /
  • -
  • 118: /
  • 119: /
  • -
  • 710: /
  • 711: /
  • -
  • 828: / (e.g. Lua modules)
  • 829: /
Deprecated
  • 2300: Gadget / Gadget
  • 2301: Gadget talk / Gadget_talk
  • 2302: Gadget definition / Gadget_definition
  • 2303: Gadget definition talk / Gadget_definition_talk
Removed
  • Books
  • Education …



Old draft template

  1. Copied from https://en.wikipedia.com/wiki/User:Jim_Grisham/Templates/DraftLink on 2022-08-04

(Move to: Template:Metatemplate)

Template:INDEX



  1. [[Draft:{{{articlename}}}|Draft:{{{articlename}}}]] ([[Draft:Talk:{{{articlename}}}|talk]])
    • Draft for: [[{{{articlename}}}|{{{articlename}}}]] ([[Talk:{{{articlename}}}|talk]]) | redirect (talk) | [[{{{articlename}}} (disambiguation)|disambiguation]] (disambiguation talk)
    • Deletion discussion / log: [[Wikipedia:Articles for deletion/{{{articlename}}}]] ([[Wikipedia:Articles for deletion/Talk:{{{articlename}}}|talk]]) / deletion log for ‘{{{articlename}}}’ (talk)
    • Wayback Machine: ( Earlist / All / Latest )
    • [[Special:WhatLinksHere/{{{articlename}}}|Articles linking to {{{articlename}}}]] ([[Special:WhatLinksHere/Talk:{{{articlename}}}|talk]])
    • [[Special:RecentChangesLinked/{{{articlename}}}|Recent changes linked to {{{articlename}}}]] ([[Special: RecentChangesLinked/Talk:{{{articlename}}}|talk]])
    • Edit history of {{{articlename}}} (talk)


Parameters

articlename=
Literal article name (as normally used with wikilinks)
articleurlname=
Name with spaces replaced by ‘_’ and other characters made url-safe.
draftuser=
Username for which to search for ‘userspace drafts’ with this title (optional; reserved for future use)
draftuserpath=
custom path prefix to use when ‘draftuser’ is provided and drafts are in a non-default userspace location (optional; reserved for future use)
note=
Notes to be included in template output (optional; reserved for future use)
comment=
Hidden comments (only for wikitext source and perhaps HTML source output) (optional; reserved for future use)

Usage details

Template:Tlx


Example usage

{{User:Jim Grisham/Templates/Draftlink |articlename=Templating language |articleurlname=Templating_language }}

Example result

User:Jim Grisham/Templates/Draftlink

Showing footnotes

Show ‘Template:Tl’ templates by adding this to the page where the template is used, ~not~ to this template itself:

Template:Tlx

or

{{Notelist-talk}}


(Note: the first example is the equivalent of Template:Tlx.


See Template:Tl, Template:Tl, and Template:Tl for usage details.


Template:Collapse top

(Move to: Template:Meta/Random notes)

Other

Other ‘special’ links:

Special:SpecialPages

Special:MyContributions

Special:MyTalk

Special:RecentChanges

Special:Search

Special:Linksearch

(Namespace):Special:AllPages

{{{articleurlname}}}&action=show-download-screen


Special:Version

Templates


Miscellany

      • Behavior switches





  • Teahouse




Template:Tl

Template:Collapse bottom Template:Userboxbottom

Template:Collapse top

Template:Collapse bottom


pages using prefix









Template:Collapse bottom