Template:A

From RationalWiki
Jump to navigation Jump to search

{{{1}}}[a w]

[edit] [purge] Documentation

Create a link with archive.is and archive.org buttons.

{{a|http://example.com}}
{{a|http://example.com|Example page}}

gives:

http://example.com[a w]

Example page[a w]

For some more complicated links you need to explicitly use 1= and 2= (like so: {{a|1=http://example.com|2=Example page}}) otherwise it won't work.

Note: This will not actually create the archival links. You will need to generate these yourself.


Here's a Vim substitute command if you want to convert all references in a page; the first one is for links with a description, the second for "bare" links in references.

:%s/<ref\(.\{-}\)>\[\(.\{-}\) \(.\{-}\)]\(.\{-}\)<\/ref>/<ref\1>{{a|1=\2|2=\3\4}}<\/ref>/g
:%s/<ref\(.\{-\}\)>\(http.\{-}\)<\/ref>/<ref\1>{{a|1=\2}}<\/ref>/g

Protip: add /c for interactive confirmation