Mô đun:Librivox book

local p = {}

function p.book(frame)

  local pframe = frame:getParent()
  local args = pframe.args

  local tname = "Librivox book" -- name of calling template. Change if template rename.

  local title   = nil -- display and search title (default: article name w/out dab)
  local dtitle  = nil -- display title (default: title)
  local stitle  = nil -- search title (default: title)
  local lname   = nil -- last name
  local id      = nil -- unsupported argument
  local author  = nil -- author
  local tagline = "- sách nói thuộc phạm vi công cộng tại [[LibriVox]]"
  local urlhead = "https://librivox.org/search?"
  local italic   = "''"

  id = trimArg(args.id)
  if id then
    error("Lỗi bản mẫu:" .. tname .. " - id không được hỗ trợ - xin hãy xem tài liệu hướng dẫn tại [[Bản mẫu:Librivox author]]")
  end

  title = trimArg(args.title)
  if not title then
    title = mw.title.getCurrentTitle().text
  end
  dtitle = mw.ustring.gsub(title,'%s+%([^%(]-%)$', '')        -- Remove the final disambig paren
  stitle = dtitle

  if trimArg(args.stitle) then
    stitle = trimArg(args.stitle)
    if not trimArg(args.title) then                           -- For when used outside main article space
      dtitle = stitle
    end
  end
  if trimArg(args.dtitle) then
    dtitle = trimArg(args.dtitle)
    italic  = ""
  end

  local stitle = mw.ustring.gsub(stitle," ", "+")             -- replace "<space>" with "+"

  author = trimArg(args.author)
  if not author then
    lname = ""
  else
    --- Split name into words, count words, set name to last word
    local N = mw.text.split(author, " ")
    local l, count = mw.ustring.gsub(author, "%S+", "")
    lname = N[count]
  end

  local url = "[[File:Speaker Icon.svg|15px|link=|alt=]] " .. "[" .. urlhead .. "title=" .. stitle .. "&author=" .. lname .. "&reader=&keywords=&genre_id=0&status=all&project_type=either&recorded_language=&sort_order=catalog_date&search_page=1&search_form=advanced" .. " " .. italic .. dtitle .. italic .. "]" .. " " .. tagline

  return url

end

function trimArg(arg)
  if arg == "" or arg == nil then
    return nil
  else
    return mw.text.trim(arg)
  end
end

return p
Chúng tôi bán
Bài viết liên quan
Nhân vật Kugisaki Nobara - Jujutsu Kaisen
Nhân vật Kugisaki Nobara - Jujutsu Kaisen
Kugisaki Nobara (釘くぎ崎さき野の薔ば薇ら Kugisaki Nobara?, Đanh Kì Dã Tường Vi) là nhân vật chính thứ ba (từ gốc: tritagonist) của bộ truyện Jujutsu Kaisen
Cách chúng tôi lần ra mắt sản phẩm trên Product hunt và xếp hạng Top #1 ngày
Cách chúng tôi lần ra mắt sản phẩm trên Product hunt và xếp hạng Top #1 ngày
Đây là lần đầu tiên mình quảng bá một sản phẩm công nghệ trên Product Hunt.
Những thực phẩm giúp tăng sức đề kháng trước dịch cúm Corona
Những thực phẩm giúp tăng sức đề kháng trước dịch cúm Corona
Giữa tâm bão dịch bệnh corona, mỗi người cần chú ý bảo vệ sức khỏe để phòng tránh vi khuẩn tấn công vào cơ thể
Mập và ốm: thể tạng cơ thể và chiến lược tập luyện phù hợp
Mập và ốm: thể tạng cơ thể và chiến lược tập luyện phù hợp
Bài viết này cung cấp góc nhìn tổng quát về ba loại thể tạng phổ biến nhằm giúp bạn hiểu rõ cơ thể và xây dựng lộ trình tập luyện, nghỉ ngơi và ăn uống phù hợp.