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

Contenu supprimé Contenu ajouté
Saut de page entre chapitres, permet l'optimisation de la version imprimable par chapitre
<font color=(?:([^> "]*)|"([^"]*)"|'([^']*)')>([^<]*)</font> ---> <span style="color:$1$2$3;">$4</span> + remplacement manuel " --> \"
Ligne 60 :
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. fullPageName } .. '\n\n')
else
if debug then table.insert(PrintVersion, '<fontspan colorstyle="color:red;">Missing subpage "' .. fullPageName .. '" on line "' .. v .. '" for the book:</fontspan> ' .. BookName .. '\n\n') end
end
end
Ligne 93 :
chapter = mw.ustring.gsub(chapter, "_", " ")
else
if debug then chapter = '<fontspan colorstyle="color:red;">Incorrect book or chapter name</fontspan>' else chapter = '' end
end
 
Ligne 123 :
 
if chapter == BookName or chapter == BookName .. sep or mw.ustring.find(chapter, "%#") ~= nil then
if debug then chapter = '<fontspan colorstyle="color:red;">Chapter = ' .. chapter .. ' => book name or another subpage name</fontspan> with Ending = ' .. Ending else chapter = '' end
else
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.ustring.find(chapter, BookName .. sep, 1, true) == nil then
if debug then chapter = "<fontspan colorstyle=\"color:red;\">No book subpage into the internal link:</fontspan> '" .. chapter .. "' doesn't include '" .. BookName .. sep .. "'" else chapter = '' end
end
end
end
else
if debug then chapter = "<fontspan colorstyle=\"color:red;\">No internal link</fontspan> for: " .. chapter .. "\n" else chapter = '' end
end
return chapter
Ligne 213 :
fullPageName = p.getFullPageName(BookName, rawFullPageName)
if debug then
if mw.ustring.find(fullPageName, "<fontspan colorstyle=\"color:red;\">No internal link</fontspan>") ~= nil then
fullPageName = nil
else
Ligne 231 :
if (subpageName ~= nil and subpageName ~= "") then
if found == true or homepage == true then
if debug then table.insert(footer, "<fontspan colorstyle=\"color:red;\">Previous & next chapter insertion</fontspan>\n") end
 
if homepage == false then
Ligne 246 :
break
elseif subpageName == currentPageName then
if debug then table.insert(footer, "<fontspan colorstyle=\"color:red;\">Page</fontspan> '" .. currentPageName .. "' found\n\n") end
found = true
elseif fullPageName ~= "" then
Ligne 252 :
previousChapter = subpageName
else
if debug then table.insert(footer, "<fontspan colorstyle=\"color:red;\">The current page</fontspan> '" .. subpageName .. "' is not '" .. currentPageName .. "'") end
end
end
else
if debug then table.insert(footer, "<fontspan colorstyle=\"color:red;\">The page</fontspan> '" .. fullPageName .. "' doesn't exist, for '" .. currentPageName .. "'\n\n") end
end
end
Ligne 263 :
 
if found == true and table.getn(footer) == 0 then
if debug then table.insert(footer, "<fontspan colorstyle=\"color:red;\">No next chapter</fontspan>\n") end
theTemplateLeft, nb = mw.ustring.gsub(templateLeft, "printf", BookName .. sep .. previousChapter .. "|" .. previousChapter)
table.insert(footer, theTemplateLeft)