See Template:RQ:be:s
-- This module is intended to simplify creating quotations for the old
-- public domain texts available on Belarusian Wikisource. Supports the
-- original Belarusian books, Belarusian translations of English books
-- and, potentially, English translations of Belarusian books.
--
-- Similar to https://en.wiktionary.orghttps://dictious.com/en/Template:Q
-- it maintains a small list of a few notable books to automatically
-- fill in the bibliographic information.
local export = {}
local books = {}
-- Also see https://en.wiktionary.orghttps://dictious.com/en/Template:RQ:Dickens_Dombey_and_Son
books = {
args = {
author = "w:Charles Dickens",
translator = "anonymous",
year = "1938",
origyear = "1848",
original = "]",
title = "s:be:Домбі і сын",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Домбі_і_сын.pdf/",
pagelist = "7=3"
}
books = books
-- Also see https://en.wiktionary.orghttps://dictious.com/en/Template:RQ:Dickens_Great_Expectations
books = {
args = {
author = "w:Charles Dickens",
translator = "anonymous",
year = "1940",
origyear = "1861",
original = "s:Great Expectations",
title = "]",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Вялікія_чаканні_(1940).djvu/",
pagelist = "6=5"
}
books = {
args = {
author = "w:Vincent Dunin-Marcinkievič",
year = "1859",
origyear = "1834",
origlang = "pl",
original = "]",
by = "w:Adam Mickiewicz",
title = "]",
location = "w:Wilno",
publisher = "Drukarnia A. Syrkina",
},
translator2 = {
= {
newversion = "English translation from",
translator2 = "]",
title2 = "]",
year2 = 1917
}
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Pan_Tadeusz_(1859).pdf/",
}
books = {
args = {
author = "w:be:Аляксандр Ельскі",
year = "1892",
origyear = "1834",
origlang = "pl",
original = "]",
by = "w:Adam Mickiewicz",
title = "]",
location = "w:Lviv",
publisher = "U drukarni ludówaj pod upr. St. Baỳlaho",
},
translator2 = {
= {
newversion = "English translation from",
translator2 = "]",
title2 = "]",
year2 = 1917
}
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Pan_Tadeusz_(1892).pdf/",
pagelist = "6=2"
}
books = {
args = {
editor = "w:Vacłaŭ Łastoŭski",
year = "1916",
title = "]",
location = "w:Wilno",
publisher = "Homan",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Rodnyje_zierniaty_(1916).pdf/",
pagelist = "6=3"
}
books = {
args = {
author = "w:Vacłaŭ Łastoŭski",
year = "1916",
title = "]",
location = "w:Wilno",
publisher = "Drukarnia M. Kuchty",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Pieršaja_čytanka_(1916).pdf/",
pagelist = "9=3"
}
books = {
args = {
author = "w:Vacłaŭ Łastoŭski",
year = "1918",
title = "]",
location = "w:Vilnius",
publisher = "Homan",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Niezabudka._Pieršaja_paśla_lemantara_čytanka_(1918).pdf/",
pagelist = "3=1"
}
-- Also see https://en.wiktionary.orghttps://dictious.com/en/Template:RQ:Twain_Prince_and_the_Pauper
books = {
args = {
author = "w:Mark Twain",
translator = "w:Makar Kraŭcoŭ",
year = "1928",
origyear = "1882",
original = "s:The Prince and the Pauper",
title = "Прынц і жабрак",
location = "w:Wilno",
publisher = "Drukarnia „Wydawnictwo Wileńskie“ ]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Прынц_і_жабрак_(1928).pdf/",
pagelist = "15=1"
}
books = {
args = {
author = "w:Mark Twain",
translator = "w:Janka Maŭr",
year = "1940",
origyear = "1882",
original = "s:The Prince and the Pauper",
title = "]",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Прынц_і_жабрак_(1940).pdf/",
pagelist = "7=3"
}
-- Also see https://en.wiktionary.orghttps://dictious.com/en/Template:RQ:Stevenson_Treasure_Island
books = {
args = {
author = "w:Robert Louis Stevenson",
translator = "anonymous",
year = "1938",
origyear = "1883",
original = "]",
title = "s:be:Востраў скарбаў",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Востраў_скарбаў.pdf/",
}
books = books
-- Also see https://en.wiktionary.orghttps://dictious.com/en/Template:RQ:Cooper_Last_of_the_Mohicans
books = {
args = {
author = "w:James Fenimore Cooper",
translator = "anonymous",
year = "1940",
origyear = "1826",
original = "s:The Last of the Mohicans",
title = "]",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Апошні_з_магікан.pdf/",
}
-- Also see https://en.wiktionary.orghttps://dictious.com/en/Template:RQ:Scott_Ivanhoe
books = {
args = {
author = "w:Walter Scott",
translator = "Іван Гарбуз",
year = "1934",
origyear = "1820",
original = "]",
title = "]",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Айвенго_(1934).pdf/",
pagelist = "7=5"
}
books = {
args = {
author = "w:Arthur Conan Doyle",
translator = "Кастусь Гарабурда",
year = "1928",
origyear = "1928",
original = "The Maracot Deep",
title = "s:be:Глыбіня Маракота",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Глыбіня_Маракота.pdf/",
pagelist = "7=5"
}
books = books
books = {
args = {
author = "w:Jaroslav Hašek",
translator = "w:be:Міхась Зарэцкі",
year = "1931",
origyear = "1921",
origlang = "cs",
original = "s:cs:Osudy dobrého vojáka Švejka za světové války",
title = "]",
series = "]",
seriesvolume = 1,
location = "w:Minsk",
publisher = "]",
},
translator2 = {
= {
newversion = "English translation from",
translator2 = "w:Cecil Parrott",
title2 = "]",
year2 = 1973
}
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Прыгоды_ўдалага_ваякі_Швэйка_(1931—1932)._Частка_1.pdf/",
pagelist = "2=3"
}
books = {
args = {
author = "w:Jaroslav Hašek; ]",
translator = "w:be:Лукаш Калюга",
year = "1932",
origyear = "1923",
origlang = "cs",
original = "s:cs:Osudy dobrého vojáka Švejka za světové války",
title = "]",
series = "]",
seriesvolume = 4,
location = "w:Minsk",
publisher = "]",
},
translator2 = {
= {
newversion = "English translation from",
translator2 = "w:Cecil Parrott",
title2 = "]",
year2 = 1973
}
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Svejk.4.pdf/",
pagelist = "3=3"
}
-- Also see https://en.wiktionary.orghttps://dictious.com/en/Template:RQ:London_White_Fang
books = {
args = {
author = "w:Jack London",
translator = "anonymous",
year = "1939",
origyear = "1906",
original = "s:White Fang",
title = "s:be:Белы клык",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Liondan.Biely_klyk.djvu/",
pagelist = "1=3"
}
books = books
books = {
args = {
author = "w:Daniel Defoe",
translator = "w:be:Зяма Раманавіч Півавараў",
editor = "w:Janka Maŭr",
year = "1937",
origyear = "1719",
original = "]",
title = "] <t:The life and astonishing adventures of Robinson Crusoe>",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Жыццё_і_дзіўныя_небывалыя_прыгоды_Рабінзона_Крузо_(1937).pdf/",
pagelist = [[
3=3
33=выява 34=33
50=выява 51=49
59=выява 60=57
108=выява 109=105
117=выява 118=113
134=выява 135=129
151=выява 152=145
168=выява 169=161
185=выява 186=177
202=выява 203=193
219=выява 220=209
236=выява 237=225
253=выява 254=241
]]
}
books = {
args = {
author = "w:Mayne Reid",
translator = "Уладзімір Ляўданскі",
year = "1941",
origyear = "1865",
original = "s:The Headless Horseman",
title = "]",
location = "w:Minsk",
publisher = "]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Коннік_без_галавы_(1941).pdf/",
pagelist = "7=3"
}
books = {
args = {
author = "w:Seumas MacManus",
translator = "w:Symon Rak-Michajłoŭski",
year = "1923",
origyear = "1900",
original = "s:Donegal Fairy Stories",
title = "]",
location = "w:Wilno",
publisher = "Drukarnia „Wydawnictwo Wileńskie“ ]",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Ірляндзкія_Народныя_Казкі_(1923).pdf/",
pagelist = "6=4"
}
books = {
args = {
author = "w:Serhiy Podolynsky",
translator = "anonymous",
year = "1881",
origyear = "1876",
original = "Про багатство і бідність",
title = "]",
location = "w:Geneva",
publisher = "Друкарньа „Работника“ ј „Громади“",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Про_багацтво_да_бьедносць_(1881).pdf/",
pagelist = "5=3"
}
books = {
args = {
author = "w:pl:Szymon Dickstein",
translator = "w:be:Напалеон Чарноцкі; Антон Ражаў",
year = "1892",
origyear = "1878",
original = "Ojciec Szymon",
title = "]",
location = "w:Tilsit",
publisher = "U drukarni Marii Krasoûskoj",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Dziadźka_Anton_(1892).pdf/",
pagelist = "4=1"
}
books = {
args = {
author = "w:Adam Stankievič",
year = "1939",
title = "]",
location = "]",
publisher = "Vydańnie „Chryścijanskaj Dumki“",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Biełaruski_chryścijanski_ruch_(1939).pdf/",
pagelist = "15=1"
}
books = {
args = {
author = "w:Francišak Alachnovič",
year = "1937",
title = "] <t:]>",
location = "w:Vilnius",
publisher = "Друкарня І. Баеўскага",
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:У_капцюрох_ГПУ.pdf/",
pagelist = "7=3"
}
books = {
args = {
author = "w:Erich Maria Remarque",
translator = "w:be:Хвядос Шынклер",
year = "1931",
origyear = "1928",
origlang = "de",
original = "]",
title = "]",
location = "w:Minsk",
publisher = "]",
},
translator2 = {
= {
newversion = "English translation from",
translator2 = "w:Arthur Wheen",
title2 = "s:All Quiet on the Western Front",
year2 = 1929
}
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:На_Заходнім_фронце_без_перамен_(1931).pdf/",
pagelist = "4=7"
}
books = {
args = {
author = "w:Rudyard Kipling",
translator = "w:Janka Maŭr",
year = "1934",
title = "]",
location = "w:Minsk",
publisher = "]",
},
chapters = {
= {
chapter = "]",
origyear = 1894, original = "]"
},
= {
chapter = "]",
origyear = 1894, original = "]"
},
= {
chapter = "]",
origyear = 1895, original = "]"
},
= {
chapter = "]",
origyear = 1894, original = "]"
},
= {
chapter = "]",
origyear = 1895, original = "]"
},
= {
chapter = "]",
origyear = 1895, original = "]"
},
= {
chapter = "]",
origyear = 1895, original = "]"
},
= {
chapter = "]",
origyear = 1895, original = "]"
},
},
urlprefix = "https://be.wikisource.orghttps://dictious.com/en/Старонка:Кіплінг_Маўглі.pdf/",
pagelist = "7=3 47=41 57=49 83=73 133=121 143=129 177=161 195=177"
}
-- Parse the Wikisource's pagelist data. See
-- https://en.wikisource.orghttps://dictious.com/en/Help:Page_numbers#Page_numbers_in_the_Index_namespace
local function pageurl(page, urlprefix, pagelist)
page = page:gsub("%-.*$", "") -- if it's a pages range, then just link to the first page
page = tonumber(page)
local urlpage = page
if pagelist then
pagelist:gsub("(%d+)=(%d+)", function (n1, n2)
n1 = tonumber(n1)
n2 = tonumber(n2)
if n2 <= page then
urlpage = page - n2 + n1
end
end)
end
return urlprefix .. tostring(urlpage)
end
function export.insert_bibliographic_data(args)
local book_info = books
if not book_info and args.year then
book_info = books
end
if book_info then
for k, v in pairs(book_info.args) do
args = v
end
-- process chapter information if it's available
if args.page and book_info.chapters then
local chapter_page = 0
local chapter_args = {}
local args_page = args.page
args_page = args_page:gsub("%-.*$", "") -- if it's a pages range, then just use the first page
args_page = tonumber(args_page)
for cur_page, cur_args in pairs(book_info.chapters) do
if cur_page <= args_page and cur_page >= chapter_page then
chapter_page = cur_page
chapter_args = cur_args
end
end
for k, v in pairs(chapter_args) do
args = v
end
end
-- bibliographic data of an English translation if it's available
if args.translator2 and book_info.translator2 and book_info.translator2 then
for k, v in pairs(book_info.translator2) do
args = v
end
end
if args.page then
args.pageurl = pageurl(args.page, book_info.urlprefix, book_info.pagelist)
end
end
return args
end
function export.show(frame)
local parent_args = frame:getParent().args
local params = {
= {alias_of = "title"},
= {alias_of = "text"},
= {alias_of = "t"},
= {required = true},
= {required = true},
= {},
= {alias_of = "text"},
= {alias_of = "t"},
}
local args, xargs = require("Module:parameters").process(parent_args, params, true)
for k, v in pairs(xargs) do
if type(k) == "number" then
error("Unexpected positional argument " .. k .. "=" .. v)
end
args = v
end
export.insert_bibliographic_data(args)
args.lang = args.lang or "be"
return frame:expandTemplate {title = "quote-book", args = args}
end
return export