सामग्री पर जाएँ
मुख्य मेन्यू
मुख्य मेन्यू
साइडबार पर जाएँ
छुपाएँ
नेविगेशन
मुखपृष्ठ
हाल में हुए बदलाव
बेतरतीब पृष्ठ
मीडियाविकि के बारे में सहायता
खोजें
खोजें
हिन्दी
दिखावट
खाता बनाएँ
लॉग-इन करें
व्यक्तिगत उपकरण
खाता बनाएँ
लॉग-इन करें
लॉग-आउट किए गए संपादकों के लिए पृष्ठ
अधिक जानें
योगदान
वार्ता
मॉड्यूल:File link
सम्पादन
Module
वार्ता
English
पढ़ें
स्रोत सम्पादित करें
इतिहास देखें
उपकरण
उपकरण
साइडबार पर जाएँ
छुपाएँ
क्रियाएँ
पढ़ें
स्रोत सम्पादित करें
इतिहास देखें
सामान्य
कड़ियाँ
पृष्ठ से जुड़े बदलाव
विशेष पृष्ठ
पृष्ठ की जानकारी
दिखावट
साइडबार पर जाएँ
छुपाएँ
सावधान:
आपने लॉग-इन नहीं किया है। अगर आप सम्पादन करते हैं तो इस पृष्ठ के संपादन इतिहास में आपका IP पता दृश्य होगा। अगर आप
लॉग-इन
करते हैं या
खाता बनाते हैं
तो दूसरे सुविधाओं के साथ-साथ आपके संपादनों का श्रेय आपके सदस्यनाम पर दिया जाएगा।
ऐन्टी-स्पैम जाँच। इसे
नहीं
भरें!
-- This module provides a library for formatting file wikilinks. local yesno = require('Module:Yesno') local checkType = require('libraryUtil').checkType local p = {} function p._main(args) checkType('_main', 1, args, 'table') -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "type error in '%s' parameter of '_main' (expected string, got %s)", key, type(val) ), level) end end local ret = {} -- Adds a positional parameter to the buffer. local function addPositional(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = val end -- Adds a named parameter to the buffer. We assume that the parameter name -- is the same as the argument key. local function addNamed(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = key .. '=' .. val end -- Filename checkArg('file', args.file, 3) ret[#ret + 1] = 'File:' .. args.file -- Format if args.format then checkArg('format', args.format) if args.formatfile then checkArg('formatfile', args.formatfile) ret[#ret + 1] = args.format .. '=' .. args.formatfile else ret[#ret + 1] = args.format end end -- Border if yesno(args.border) then ret[#ret + 1] = 'border' end addPositional('location') addPositional('alignment') addPositional('size') addNamed('upright') addNamed('link') addNamed('alt') addNamed('page') addNamed('class') addNamed('lang') addNamed('start') addNamed('end') addNamed('thumbtime') addPositional('caption') return string.format('[[%s]]', table.concat(ret, '|')) end function p.main(frame) local origArgs = require('Module:Arguments').getArgs(frame, { wrappers = 'Template:File link' }) if not origArgs.file then error("'file' parameter missing from [[Template:File link]]", 0) end -- Copy the arguments that were passed to a new table to avoid looking up -- every possible parameter in the frame object. local args = {} for k, v in pairs(origArgs) do -- Make _BLANK a special argument to add a blank parameter. For use in -- conditional templates etc. it is useful for blank arguments to be -- ignored, but we still need a way to specify them so that we can do -- things like [[File:Example.png|link=]]. if v == '_BLANK' then v = '' end args[k] = v end return p._main(args) end return p
सारांश:
कृपया ध्यान दें कि वर्ल्डपीडिया को किये गये सभी योगदान क्रिएटिव कॉमन्स एट्रिब्यूशन-शेयरअलाइक ४.० लाइसेंस की शर्तों के तहत होंगे (अधिक जानकारी के लिये
वर्ल्डपीडिया:कॉपीराइट
देखें)। यदि आप अपने योगदान को लगातार बदलते और पुनः वितरित होते नहीं देख सकते हैं तो यहाँ योगदान न करें।
आप यह भी प्रमाणित कर रहे हैं कि यह आपने स्वयं लिखा है अथवा सार्वजनिक क्षेत्र या किसी समान मुक्त स्रोत से प्रतिलिपित किया है।
कॉपीराइट सुरक्षित कार्यों को बिना अनुमति के यहाँ न डालें!
रद्द करें
सम्पादन सहायता
(नई विंडो में खुलता है)
इस पृष्ठ पर प्रयुक्त साँचा:
मॉड्यूल:File link/doc
(
सम्पादन
)