Wikia

Memory Alpha

HighwindBot/EpisodeReferenceTemplate

Discuss0
37,446pages on
this wiki

< User:HighwindBot

Revision as of 11:22, January 18, 2007 by Cid Highwind (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Function Edit

Replaces all simple episode references with a template call. "Simple" references are:

  • ([[SER]]: "[[EPISODE]]")
  • ([[SER]]: "[[EPISODE (episode)|EPISODE]]")

Code snippet Edit

The following can be added to the fixes at fixes.py, then be called using

  • replace.py -fix:epref.
    'epref': {
        'regex': True,
        'msg': {
            'en':u'episode reference template',
        },
        'replacements': [
            (u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?) \(episode\)\|\\2\]\]\"\)', r'({{\1|\2}})'),
            (u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?)\|([^\[]*?)\]\]\"\)', r'({{\1|\2}})'),
            (u'\(\[\[(TOS|TAS|TNG|DS9|VOY|ENT)\]\]: \"\[\[([^\[]*?)\]\]\"\)', r'({{\1|\2}})'),
        ],
    },

Around Wikia's network

Random Wiki