World Library  
Flag as Inappropriate
Email this Article

Vienna Offensive

Article Id: WHEBN0009502602
Reproduction Date:

Title: Vienna Offensive  
Author: World Heritage Encyclopedia
Language: English
Subject: Medal "For the Capture of Vienna", Soviet War Memorial (Vienna), 27th Army (Soviet Union), Allied-occupied Austria, Strategic operations of the Red Army in World War II
Collection: 1945 in Austria, 20Th Century in Vienna, Austria in World War II, Austria–soviet Union Relations, Battles and Operations of the Soviet–german War, Battles Involving Hungary, Battles Involving the Soviet Union, Conflicts in 1945, History of Vienna, Military Operations of World War II Involving Bulgaria, Military Operations of World War II Involving Germany, Strategic Operations of the Red Army in World War II, Urban Warfare, World War II Aerial Operations and Battles of the Eastern Front
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Vienna Offensive


The Vienna Offensive was launched by the Soviet 3rd Ukrainian Front in order to capture Vienna in Austria. The offensive lasted from 2 to 13 April 1945. The city of Vienna was surrounded and under siege for most of the offensive.

Contents

  • Background 1
  • The battle 2
  • Aftermath 3
    • Final orders of battle (after the Vienna Offensive) 3.1
      • German and German allied forces 3.1.1
      • Soviet and Soviet allied forces 3.1.2
  • See also 4
  • Explanatory notes 5
  • References 6
  • Sources 7
  • Further reading 8

Background

Joseph Stalin reached an agreement with the Western Allies prior to April 1945 concerning the relative postwar political influence of each party in much of Eastern and Central Europe; however, these agreements said virtually nothing about the fate of Austria, then officially considered to be merely the Ostmark area of Greater Germany after the Anschluss. As a result, the victory of a Soviet offensive toward Austria and the liberation (by the Red Army) of a large part of this country would be very beneficial for subsequent postwar negotiations with the Western Allies.[1]

After the failure of Operation Spring Awakening (Unternehmen Frühlingserwachen), Sepp Dietrich's 6th SS Panzer Army retreated in stages to the Vienna area.[2] The Germans desperately prepared defensive positions in an attempt to guard the city against the rapidly arriving Soviets.

In spring 1945, the advance of Soviet General Fyodor Tolbukhin's 3rd Ukrainian Front through western Hungary gathered momentum on both sides of the Danube.[3]

On 30 March, the advancing Soviets crossed the Hron and Nitra Rivers, and after they took Sopron and Nagykanizsa crossed the border between Hungary and Austria.[4] Tolbukhin was now ready to advance into Austria and take Vienna.

The battle

On 2 April, Vienna Radio denied that the Austrian capital had been declared an open city. On the same day, Soviet troops approached Vienna from the south after they overran Wiener Neustadt, Eisenstadt, Neunkirchen and Gloggnitz.[4] Baden and Bratislava were overrun on 4 April.

After arriving in the Vienna area, the armies of the Soviet 3rd Ukrainian Front surrounded, besieged, and attacked the city. Involved in this action were the Soviet 4th Guards Army, the Soviet 6th Guards Tank Army, the Soviet 9th Guards Army, and the Soviet 46th Army. The "O-5 Resistance Group," Austrians led by Carl Szokoll wanting to spare Vienna destruction, actively attempted to sabotage the German defenses and to aid the entry of the Red Army.

The only major German force facing the Soviet attackers was the German II SS Panzer Corps of the 6th SS Panzer Army, along with ad hoc forces made up of garrison and anti-aircraft units. Declared a defensive region, Vienna's defense was commanded by General Rudolf von Bünau, with the II SS Panzer Corps units under the command of SS General Wilhelm Bittrich.

The battle for the Austrian capital was characterized in some cases by fierce urban combat, but there were also parts of the city the Soviets advanced into with little opposition. Defending in the Prater Park was the 6th Panzer Division, along the south side of the city were the 2nd and 3rd SS Panzer Divisions, and in the north was the Führer-Grenadier Division.[5] The Soviets assaulted Vienna's eastern and southern suburbs with the 4th Guards Army and part of the 9th Guards Army. The German defenders kept the Soviets out of the city’s southern suburbs until 7 April. However, after successfully achieving several footholds in the southern suburbs, the Soviets then moved into the western suburbs of the city on 8 April with the 6th Guards Tank Army and the bulk of the 9th Guards Army. The western suburbs were especially important to the Soviets because they included Vienna's main railway station. The Soviet success in the western suburbs was followed quickly by infiltration of the eastern and northern suburbs later the same day. North of the Danube River, the 46th Army pushed westward through Vienna's northern suburbs. Central Vienna was now cut off from the rest of Austria.

By 9 April, the Soviet troops began to infiltrate the center of the city, but the street fighting continued for several days more. On the night of 11 April, the 4th Guards Army stormed the Danube canals, with the 20th Guards Rifle Corps and 1st Mechanized Corps moving on the Reichsbrücke Bridge. In a coup de main on 13 April, the Danube Flotilla landed troops of the 80th Guards Rifle Division and 7th Guards Airborne Division on both sides of the bridge, cutting demolition cables and securing the bridge.[1] However, other important bridges were destroyed. Vienna finally fell when the last defenders in the city surrendered on the same day.[2] Bittrich's II SS Panzer Corps, however, pulled out to the west on the evening of 13 April to avoid encirclement.[6] The same day, the 46th Army took Essling and the Danube Flotilla landed naval infantry up the river by Klosterneuburg.

While the street fighting was still intensifying in the southern and western suburbs of Vienna on 8 April, other troops of the 3rd Ukrainian Front by-passed Vienna altogether and advanced on Linz and Graz.[4]

On the 10th, all but two of the bridges in the city had been destroyed. The Floridsdorf bridge had been left intact by a Fuehrer Order dictating that the bridge be held at all costs. The 2nd SS Panzer, "Das Reich" left a dozen artillery pieces including 37mm anti-aircraft guns to hold off enemy attacks. That night, the "Das Reich", including their last remaining three dozen armored vehicles, pulled out of the city for the last time. Vienna had fallen, and the Germans now moved northwest to hold a next defensive line.[7]

Aftermath

By 15 April, armies of the Soviet 3rd Ukrainian Front pushed even further into Austria. The completely exhausted remnants of what had been the 6th SS Panzer Army were forced to flee to the area between Vienna and Linz. Just behind the retreating Germans were elements of the Soviet 9th Guards Army and the Soviet 46th Army. The 26th Army and 27th Armies advanced towards the area north of Graz just behind the retreating 6th Army. The 57th Army and the Bulgarian 1st Army advanced towards the area south of Graz (near Maribor) just behind the retreating 2nd Panzer Army. None of these German armies was in any shape to do more than temporarily stall the advancing Soviet forces.

Some of Vienna's finest buildings lay in ruins after the battle. There was no water, electricity, or gas — and bands of people, both foreigners and Austrians, plundered and assaulted the helpless residents in the absence of a police force. While the Soviet assault forces generally behaved well, the second wave of Soviet troops to arrive in the city were badly disciplined, looting and raping in a several-week orgy of violence that has been compared to the worst aspects of the Thirty Years War.[8]

Like Bittrich, General von Bünau left Vienna before it fell to avoid capture by the Soviets. From 16 April until the war's end, he led Generalkommando von Bünau, surrendering to the Americans on VE Day. von Bünau was held as a POW until April 1947. Bittrich also surrendered to U.S. forces and was held as a prisoner by the Allies until 1954. Fyodor Tolbukhin went on to command the Soviet Southern Group of Forces and the Transcaucasian Military District prior to his untimely death in 1949, reportedly from heart problems.

Austrian politician Karl Renner astutely set up a Provisional Government in Vienna sometime in April with the tacit approval of the victorious Soviet forces,[9] and declared Austria's secession from the Third Reich.

Final orders of battle (after the Vienna Offensive)

German and German allied forces

On 30 April, the following order of battle was recorded by the German Army High Command (Oberkommando der Wehrmacht, or OKW). From 20 April-2 May, OKW moved from Zossen (near Berlin) to Mürwik (part of Flensburg in north Germany, near Denmark).[10] This order of battle shows what remained "on paper" of the German armies that fought in Hungary and Austria.

Soviet and Soviet allied forces

Stalin's order congratulating the units that had participated in the Vienna Offensive is engraved on the Red Army Monument (Heldendenkmal der Roten Armee) that was erected by the Soviet occupation authorities later in 1945.

The order of battle for the 3rd Ukrainian Front during the same period was:

Bank of Russia commemorative coin celebrating the 50th anniversary of victory in the Great Patriotic War and the capturing of Vienna
  • 1st Bulgarian Army
    • III Corps
      • 10th Infantry Division
      • 12th Infantry Division
      • 16th Infantry Division
    • IV Corps
      • 3rd Infantry Division
      • 8th Infantry Division
      • 11th Infantry Division
    • 6th Infantry Division

See also

Explanatory notes


-- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p-------------------------------------------------------------------------------- -- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p
  1. ^ Former members of O-5 tell a different story, claiming the bridge guards were actually O-5 members who turned their machine-guns on the Germans when they attempted to destroy the bridge. {{Navbox |name = Television drama series |title = Television drama series |state = autocollapse |listclass = hlist |group1 = By location

    |list1 =

    |group2 = Genres

    |list2 =

    |group3 = List by country

    |list3 =

    |group4 = Format |list4 =

    • Serial
    • [[Procedural drama|P#REDIRECT.
  2. ^ Descriptions of Soviet actions are from {{Navbox |name = Television drama series |title = Television drama series |state = autocollapse |listclass = hlist |group1 = By location

    |list1 =

    |group2 = Genres

    |list2 =

    |group3 = List by country

    |list3 =

    |group4 = Format |list4 =

    • Serial
    • [[Procedural drama|P#REDIRECT.

References


-- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p-------------------------------------------------------------------------------- -- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p
  1. ^ Berzhkov 1987, Chapter 5, Section 2.
  2. ^ Dollinger & Jacobsen 1968, p. 199.
  3. ^ Laffin 1995, p. 449.
  4. ^ a b c Dollinger & Jacobsen 1968, p. 182.
  5. ^ Gosztony 1978, p. 261.
  6. ^ Gosztony 1978, p. 262.
  7. ^ a b c
  8. ^ Gosztony 1978, p. 263.
  9. ^ Johnson 1989, pp. 135–136.
  10. ^ Dollinger & Jacobsen 1968, p. 177.

Sources

Further reading

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 



Copyright © World Library Foundation. All rights reserved. eBooks from Hawaii eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.