Modül:Eğik sayfa adı - Vikipedi
İçeriğe atla
Ana menü
Gezinti
  • Anasayfa
  • Hakkımızda
  • İçindekiler
  • Rastgele madde
  • Seçkin içerik
  • Yakınımdakiler
Katılım
  • Deneme tahtası
  • Köy çeşmesi
  • Son değişiklikler
  • Dosya yükle
  • Topluluk portalı
  • Wikimedia dükkânı
  • Yardım
  • Özel sayfalar
Vikipedi Özgür Ansiklopedi
Ara
  • Bağış yapın
  • Hesap oluştur
  • Oturum aç
  • Bağış yapın
  • Hesap oluştur
  • Oturum aç

Modül:Eğik sayfa adı

  • Аԥсшәа
  • Afrikaans
  • العربية
  • الدارجة
  • مصرى
  • Asturianu
  • Azərbaycanca
  • تۆرکجه
  • Basa Bali
  • Bikol Central
  • Беларуская
  • Беларуская (тарашкевіца)
  • Български
  • भोजपुरी
  • ပအိုဝ်ႏဘာႏသာႏ
  • বাংলা
  • Bosanski
  • 閩東語 / Mìng-dĕ̤ng-ngṳ̄
  • کوردی
  • Čeština
  • Dansk
  • Zazaki
  • डोटेली
  • Ελληνικά
  • English
  • Esperanto
  • Español
  • فارسی
  • Føroyskt
  • Français
  • Arpetan
  • گیلکی
  • Bahasa Hulontalo
  • ગુજરાતી
  • Gaelg
  • Hausa
  • 客家語 / Hak-kâ-ngî
  • हिन्दी
  • Magyar
  • Հայերեն
  • Bahasa Indonesia
  • Igbo
  • Ilokano
  • Íslenska
  • 日本語
  • Jawa
  • ქართული
  • Taqbaylit
  • Kumoring
  • Қазақша
  • ಕನ್ನಡ
  • 한국어
  • Kurdî
  • Ladin
  • ລາວ
  • Lietuvių
  • Latgaļu
  • Latviešu
  • मैथिली
  • Мокшень
  • Māori
  • Minangkabau
  • Македонски
  • മലയാളം
  • Монгол
  • ဘာသာမန်
  • मराठी
  • Bahasa Melayu
  • Malti
  • Mirandés
  • မြန်မာဘာသာ
  • Napulitano
  • नेपाली
  • Occitan
  • ଓଡ଼ିଆ
  • ਪੰਜਾਬੀ
  • Polski
  • پښتو
  • Português
  • Română
  • Руски
  • Ikinyarwanda
  • ᱥᱟᱱᱛᱟᱲᱤ
  • Scots
  • سنڌي
  • တႆး
  • සිංහල
  • Simple English
  • Slovenčina
  • سرائیکی
  • Slovenščina
  • Anarâškielâ
  • Shqip
  • Српски / srpski
  • Svenska
  • ꠍꠤꠟꠐꠤ
  • தமிழ்
  • ತುಳು
  • ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
  • ไทย
  • Tagalog
  • Українська
  • Oʻzbekcha / ўзбекча
  • Vèneto
  • Tiếng Việt
  • Volapük
  • Yorùbá
  • 中文
  • 閩南語 / Bân-lâm-gí
  • 粵語
Bağlantıları değiştir
  • Modül
  • Tartışma
  • Oku
  • Kaynağı değiştir
  • Geçmişi gör
Araçlar
Eylemler
  • Oku
  • Kaynağı değiştir
  • Geçmişi gör
Genel
  • Sayfaya bağlantılar
  • İlgili değişiklikler
  • Kalıcı bağlantı
  • Sayfa bilgisi
  • Kısaltılmış URL'yi al
  • Karekodu indir
Yazdır/dışa aktar
  • PDF olarak indir
  • Basılmaya uygun görünüm
Diğer projelerde
  • Wikimedia Commons
  • Meta Viki
  • Vikitür
  • Vikikaynak
  • Vikiveri ögesi
Görünüm
Vikipedi, özgür ansiklopedi
Modül belgelemesi[gör] [değiştir] [geçmiş] [temizle]
Lua'nın logosuBu modül şu Lua modüllerini kullanıyor:
  • Modül:Evethayır
  • Modül:Bağımsız değişkenler
UyarıBu Lua modülü yaklaşık 23.000 sayfada kullanılmaktadır. Bundan dolayı üzerinde yapılan değişiklikler hemen fark edilecektir. Lütfen yapacağınız değişiklikleri öncelikle şablonun deneme tahtası ile test senaryosu alt sayfalarında ya da kendi kullanıcı sayfanızda test ediniz. Eğer yapmayı planladığınız değişiklikler ile istediğiniz sonucu elde edemiyorsanız tartışma sayfasında görüş alışverişinde bulununuz.

Bu modül {{eğik sayfa adı}} ve {{eğik parantez içi}} şablonlarının omurgasını oluşturmaktadır. Kullanım detayları şablonların belgeleme sayfalarında bulunmaktadır.

Yukarıdaki belgeleme içeriği Modül:Eğik sayfa adı/belge sayfasından yansıtılmaktadır. (değiştir | geçmiş)
Kullanıcılar denemelerini bu şablonun deneme tahtası (oluştur | yansıtma) ve test senaryosu (oluştur) sayfalarında yapabilirler.
Lütfen kategorileri /belge alt sayfasına ekleyin. Bu modül ile ilgili alt sayfalar için buraya tıklayınız.
-- Bu modül {{eğik sayfa adı}} ve {{eğik parantez içi}} şablonlarını yürütür.

require('strict')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local yesno = require('Modül:Evethayır')

--------------------------------------------------------------------------------
-- ItalicTitle class
--------------------------------------------------------------------------------

local ItalicTitle = {}

do
	----------------------------------------------------------------------------
	-- Class attributes and functions
	-- Things that belong to the class are here. Things that belong to each
	-- object are in the constructor.
	----------------------------------------------------------------------------

	-- Keys of title parts that can be italicized.
	local italicizableKeys = {
		namespace = true,
		title = true,
		dab = true,
	}

	----------------------------------------------------------------------------
	-- ItalicTitle constructor
	-- This contains all the dynamic attributes and methods.
	----------------------------------------------------------------------------

	function ItalicTitle.new()
		local obj = {}

		-- Function for checking self variable in methods.
		local checkSelf = libraryUtil.makeCheckSelfFunction(
			'ItalicTitle',
			'obj',
			obj,
			'ItalicTitle object'
		)

		-- Checks a key is present in a lookup table.
		-- Param: name - the function name.
		-- Param: argId - integer position of the key in the argument list.
		-- Param: key - the key.
		-- Param: lookupTable - the table to look the key up in.
		local function checkKey(name, argId, key, lookupTable)
			if not lookupTable[key] then
				error(string.format(
					"bad argument #%d to '%s' ('%s' geçerli bir giriş değil)",
					argId,
					name,
					key
				), 3)
			end
		end

		-- Set up object structure.
		local parsed = false
		local categories = {}
		local italicizedKeys = {}
		local italicizedSubstrings = {}

		-- Parses a title object into its namespace text, title, and
		-- disambiguation text.
		-- Param: options - a table of options with the following keys:
		--     title - the title object to parse
		--     ignoreDab - ignore any disambiguation parentheses
		-- Returns the current object.
		function obj:parseTitle(options)
			checkSelf(self, 'parseTitle')
			checkType('parseTitle', 1, options, 'table')
			checkTypeForNamedArg('parseTitle', 'title', options.title, 'table')
			local title = options.title
		
			-- Title and dab text
			local prefix, parentheses
			if not options.ignoreDab then
				prefix, parentheses = mw.ustring.match(
					title.text,
					'^(.+) %(([^%(%)]+)%)$'
				)
			end
			if prefix and parentheses then
				self.title = prefix
				self.dab = parentheses
			else
				self.title = title.text
			end
		
			-- Namespace
			local ns = mw.site.namespaces[title.namespace].id
			local namespace = mw.site.namespaces[title.namespace].name
			if namespace and #namespace >= 1 then
				self.namespace = namespace
			end

			-- Register the object as having parsed a title.
			parsed = true
		
			return self
		end

		-- Italicizes part of the title.
		-- Param: key - the key of the title part to be italicized. Possible
		-- keys are contained in the italicizableKeys table.
		-- Returns the current object.
		function obj:italicize(key)
			checkSelf(self, 'italicize')
			checkType('italicize', 1, key, 'string')
			checkKey('italicize', 1, key, italicizableKeys)
			italicizedKeys[key] = true
			return self
		end

		-- Un-italicizes part of the title.
		-- Param: key - the key of the title part to be un-italicized. Possible
		-- keys are contained in the italicizableKeys table.
		-- Returns the current object.
		function obj:unitalicize(key)
			checkSelf(self, 'unitalicize')
			checkType('unitalicize', 1, key, 'string')
			checkKey('unitalicize', 1, key, italicizableKeys)
			italicizedKeys[key] = nil
			return self
		end

		-- Italicizes a substring in the title. This only affects the main part
		-- of the title, not the namespace or the disambiguation text.
		-- Param: s - the substring to be italicized.
		-- Returns the current object.
		function obj:italicizeSubstring(s)
			checkSelf(self, 'italicizeSubstring')
			checkType('italicizeSubstring', 1, s, 'string')
			italicizedSubstrings[s] = true
			return self
		end

		-- Un-italicizes a substring in the title. This only affects the main
		-- part of the title, not the namespace or the disambiguation text.
		-- Param: s - the substring to be un-italicized.
		-- Returns the current object.
		function obj:unitalicizeSubstring(s)
			checkSelf(self, 'unitalicizeSubstring')
			checkType('unitalicizeSubstring', 1, s, 'string')
			italicizedSubstrings[s] = nil
			return self
		end

		-- Renders the object into a page name. If no title has yet been parsed,
		-- the current title is used.
		-- Returns string
		function obj:renderTitle()
			checkSelf(self, 'renderTitle')

			-- Italicizes a string
			-- Param: s - the string to italicize
			-- Returns string.
			local function italicize(s)
				assert(type(s) == 'string', 's was not a string')
				assert(s ~= '', 's was the empty string')
				return string.format('<i>%s</i>', s)
			end
		
			-- Escape characters in a string that are magic in Lua patterns.
			-- Param: pattern - the pattern to escape
			-- Returns string.
			local function escapeMagicCharacters(s)
				assert(type(s) == 'string', 's was not a string')
				return s:gsub('%p', '%%%0')
			end

			-- If a title hasn't been parsed yet, parse the current title.
			if not parsed then
				self:parseTitle{title = mw.title.getCurrentTitle()}
			end

			-- Italicize the different parts of the title and store them in a
			-- titleParts table to be joined together later.
			local titleParts = {}

			-- Italicize the italicizable keys.
			for key in pairs(italicizableKeys) do
				if self[key] then
					if italicizedKeys[key] then
						titleParts[key] = italicize(self[key])
					else
						titleParts[key] = self[key]
					end
				end
			end

			-- Italicize substrings. If there are any substrings to be
			-- italicized then start from the raw title, as this overrides any
			-- italicization of the main part of the title.
			if next(italicizedSubstrings) then
				titleParts.title = self.title
				for s in pairs(italicizedSubstrings) do
					local pattern = escapeMagicCharacters(s)
					local italicizedTitle, nReplacements = titleParts.title:gsub(
						pattern,
						italicize
					)
					titleParts.title = italicizedTitle

					-- If we didn't make any replacements then it means that we
					-- have been passed a bad substring or that the page has
					-- been moved to a bad title, so add a tracking category.
					if nReplacements < 1 then
						categories['Dizgi eşleşmesi olmayan eğik sayfa adı kullanılan sayfalar'] = true
					end
				end
			end

			-- Assemble the title together from the parts.
			local ret = ''
			if titleParts.namespace then
				ret = ret .. titleParts.namespace .. ':'
			end
			ret = ret .. titleParts.title
			if titleParts.dab then
				ret = ret .. ' (' .. titleParts.dab .. ')'
			end

			return ret
		end

		-- Returns an expanded DISPLAYTITLE parser function called with the
		-- result of obj:renderTitle, plus any other optional arguments.
		-- Returns string
		function obj:renderDisplayTitle(...)
			checkSelf(self, 'renderDisplayTitle')
			return mw.getCurrentFrame():callParserFunction(
				'DISPLAYTITLE',
				self:renderTitle(),
				...
			)
		end

		-- Returns an expanded DISPLAYTITLE parser function called with the
		-- result of obj:renderTitle, plus any other optional arguments, plus
		-- any tracking categories.
		-- Returns string
		function obj:render(...)
			checkSelf(self, 'render')
			local ret = self:renderDisplayTitle(...)
			for cat in pairs(categories) do
				ret = ret .. string.format('[[Kategori:%s]]',cat)
			end
			return mw.text.trim(ret)
		end

		return obj
	end
end

--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------

local p = {}

local function getArgs(frame, wrapper)
	assert(type(wrapper) == 'string', 'wrapper was not a string')
	return require('Modül:Bağımsız değişkenler').getArgs(frame, {
		wrappers = wrapper
	})
end

-- Main function for {{eğik sayfa adı}}
function p._main(args)
	checkType('_main', 1, args, 'table')
	local italicTitle = ItalicTitle.new()
	italicTitle:parseTitle{
		title = mw.title.getCurrentTitle(),
		ignoreDab = yesno(args.all, false)
	}
	if args.string then
		italicTitle:italicizeSubstring(args.string)
	else
		italicTitle:italicize('title')
	end
	return italicTitle:render(args[1])
end

function p.main(frame)
	return p._main(getArgs(frame, 'Şablon:Eğik sayfa adı'))
end

function p._dabonly(args)
	return ItalicTitle.new()
		:italicize('dab')
		:render(args[1])
end

function p.dabonly(frame)
	return p._dabonly(getArgs(frame, 'Şablon:Eğik parantez içi'))
end


return p
"https://tr.wikipedia.org/w/index.php?title=Modül:Eğik_sayfa_adı&oldid=36307294" sayfasından alınmıştır
  • Sayfa en son 05.50, 29 Ekim 2025 tarihinde değiştirildi.
  • Metin Creative Commons Atıf-AynıLisanslaPaylaş Lisansı altındadır ve ek koşullar uygulanabilir. Bu siteyi kullanarak Kullanım Şartlarını ve Gizlilik Politikasını kabul etmiş olursunuz.
    Vikipedi® (ve Wikipedia®) kâr amacı gütmeyen kuruluş olan Wikimedia Foundation, Inc. tescilli markasıdır.
  • Gizlilik politikası
  • Vikipedi hakkında
  • Sorumluluk reddi
  • Davranış Kuralları
  • Geliştiriciler
  • İstatistikler
  • Çerez politikası
  • Mobil görünüm
  • Wikimedia Foundation
  • Powered by MediaWiki
Modül:Eğik sayfa adı
Konu ekle