« Module:Version imprimable » : différence entre les versions

Contenu supprimé Contenu ajouté
MEP des traductions sur Commons
Ligne 1 :
-- Ce script crée la version imprimable d'une leçon en affichant le contenu des pages de son sommaire
 
-- i18n : paramètres traduis localement
Error = "Erreur : sommaire invalide"
Beginning1 = "Notice de version imprimable"
Beginning2 = "Couverture de version imprimable"
Break = "Nouvelle page imprimée"
Ending1 = "GFDL"
Ending2 = ""
templateLeft = '<div style="float: left;">[[File:Go-previous-grey.svg|40px|link=printf]] [[printf]]</div>'
templateRight = '<div style="float: right;">[[printf]] [[File:Go-next-grey.svg|40px|link=printf]]</div>'
TOC = "Sommaire"
sep = "/"
OnlySubpages = true
debug = false
OnlySubpages = true
 
local p = {}
 
Error = require('Module:TNT').format('I18n/Module:Printable version', 'error_invalid_toc')
Beginning1 = require('Module:TNT').format('I18n/Module:Printable version', 'header_notice')
Beginning2 = require('Module:TNT').format('I18n/Module:Printable version', 'header_cover')
Break = require('Module:TNT').format('I18n/Module:Printable version', 'page_break')
Ending1 = require('Module:TNT').format('I18n/Module:Printable version', 'footer_license')
Ending2 = require('Module:TNT').format('I18n/Module:Printable version', 'footer2')
templateLeft = require('Module:TNT').format('I18n/Module:Printable version', 'template_left')
templateRight = require('Module:TNT').format('I18n/Module:Printable version', 'template_right')
TOC = require('Module:TNT').format('I18n/Module:Printable version', 'TOC')
sep = require('Module:TNT').format('I18n/Module:Printable version', 'subpage_separator')
 
 
Ligne 186 ⟶ 185 :
text = title.getContent(title)
if (text == nil or text == "") then return Error end
 
if frame.args[3] ~= nil and frame.args[3] ~= '' then
if frame.args[3] == 'programming' then
if debug then table.insert(footer, " skin=programming\n\n") end
templateLeft = '{| style="width:100%; border:solid 1px #71c837; background:#c6e9af; color:#2d5016;" class="noprint"\n| style="text-align:left; width:33%; font-size:90%;" |[[Image:Navigation_Left_Arrow.svg|18px|link=printf|alt=]] [[printf]]\n'
templateRight = '| style="text-align:center; width:34%;" | [['..mw.title.getCurrentTitle().rootText..']]<br><b>'..mw.title.getCurrentTitle().subpageText..'</b>\n| style="text-align:right; width:33%; font-size:90%;" | [[printf]] [[Image:Navigation_Right_Arrow.svg|18px|link=printf|alt=]]\n|}'
end
end
 
-- Book subpages titles normalization to absolute names
local lines_ = mw.text.split(text, "\n")
local previousChapter = ""
local found = false
local fullPageName
local homepage = false
local subpageName
local rawFullPageName
local homepage = false
local found = false
 
if (currentPageName == BookName) then