1# 2# 3# Mod�le "texte" 4# 5# Historique 6# 2008/02/26 : pda : conception d'un mod�le exemple 7# 8 9# 10# Inclure les directives de formattage de base 11# 12 13inclure-tcl include/html/base.tcl 14 15############################################################################### 16# Proc�dures de conversion HTML sp�cifiques au mod�le 17############################################################################### 18 19proc htg_titre {} { 20 if [catch {set niveau [htg getnext]} v] then {error $v} 21 check-int $niveau 22 if [catch {set texte [htg getnext]} v] then {error $v} 23 switch $niveau { 24 1 { 25 if {[dans-contexte "rarest"]} then { 26 set r [helem H2 "<br>$texte"] 27 } else { 28 set logo [helem TD \ 29 [helem IMG \ 30 "" \ 31 SRC css/images/logo.png ALT "logo" \ 32 ] \ 33 ALIGN center VALIGN top \ 34 ID image-a-imprimer-seulement \ 35 ] 36 set titre [helem TD [helem H2 $texte] ALIGN center VALIGN middle] 37 set r [helem TABLE \ 38 [helem TR "$logo$titre"] \ 39 CELLPADDING 0 CELLSPACING 0 BORDER 0 WIDTH 100% \ 40 ] 41 } 42 43 } 44 default { 45 incr niveau 46 set r [helem H$niveau $texte] 47 } 48 } 49 return $r 50} 51 52proc htg_partie {} { 53 global partie 54 55 if [catch {set id [htg getnext]} v] then {error $v} 56 if [catch {set texte [htg getnext]} v] then {error $v} 57 set texte [nettoyer-html $texte] 58 59 switch -exact $id { 60 banniere - 61 titrepage { 62 regsub -all "\n" $texte "<br>\n" texte 63 } 64 default { 65 regsub -all "\n\n+" $texte "<p>" texte 66 } 67 } 68 69 set partie($id) $texte 70 return {} 71} 72