Commit a6614bd0168e42bd1d6b9414eed9c6524f4f4559
1 parent
7664ca37c2
Exists in
master
Changement de nom pour les variables underlined
et ajout d'une variable pour la largeur de texte en sod
Showing 6 changed files with 18 additions and 16 deletions Inline Diff
style-template.conf
# | 1 | 1 | # | |
# Regarder l'aide de zim section Config Files | 2 | 2 | # Regarder l'aide de zim section Config Files | |
# | 3 | 3 | # | |
[TextView] | 4 | 4 | [TextView] | |
indent=30 | 5 | 5 | indent=30 | |
tabs=None | 6 | 6 | tabs=None | |
font= | 7 | 7 | font= | |
justify= | 8 | 8 | justify= | |
linespacing=3 | 9 | 9 | linespacing=3 | |
bullet_icon_size=GTK_ICON_SIZE_MENU | 10 | 10 | bullet_icon_size=GTK_ICON_SIZE_MENU | |
11 | 11 | |||
[Tag strong] | 12 | 12 | [Tag strong] | |
weight=PANGO_WEIGHT_BOLD | 13 | 13 | weight=PANGO_WEIGHT_BOLD | |
14 | 14 | |||
[Tag emphasis] | 15 | 15 | [Tag emphasis] | |
style=PANGO_STYLE_ITALIC | 16 | 16 | style=PANGO_STYLE_ITALIC | |
17 | 17 | |||
[Tag mark] | 18 | 18 | [Tag mark] | |
underline=%%--main-menu-u-decoration%% | 19 | 19 | underline=%%--main-u-decoration%% | |
background=%%--main-menu-u-background-color%% | 20 | 20 | background=%%--main-u-background-color%% | |
21 | 21 | |||
[Tag strike] | 22 | 22 | [Tag strike] | |
strikethrough=True | 23 | 23 | strikethrough=True | |
foreground=%%--main-strike-color%% | 24 | 24 | foreground=%%--main-strike-color%% | |
25 | 25 | |||
[Tag code] | 26 | 26 | [Tag code] | |
foreground=%%--main-tt-color%% | 27 | 27 | foreground=%%--main-tt-color%% | |
family=monospace | 28 | 28 | family=monospace | |
29 | 29 | |||
[Tag pre] | 30 | 30 | [Tag pre] | |
foreground=%%--main-pre-color%% | 31 | 31 | foreground=%%--main-pre-color%% | |
family=monospace | 32 | 32 | family=monospace | |
wrap-mode=GTK_WRAP_NONE | 33 | 33 | wrap-mode=GTK_WRAP_NONE | |
indent=20 | 34 | 34 | indent=20 | |
35 | 35 | |||
[Tag link] | 36 | 36 | [Tag link] | |
foreground=%%--main-link-color%% | 37 | 37 | foreground=%%--main-link-color%% | |
38 | 38 | |||
[Tag tag] | 39 | 39 | [Tag tag] | |
foreground=#ce5c00 | 40 | 40 | foreground=#ce5c00 | |
41 | 41 | |||
[Tag h1] | 42 | 42 | [Tag h1] | |
foreground=%%--main-header-color%% | 43 | 43 | foreground=%%--main-header-color%% | |
underline=PANGO_UNDERLINE_SINGLE | 44 | 44 | underline=PANGO_UNDERLINE_SINGLE | |
weight=PANGO_WEIGHT_BOLD | 45 | 45 | weight=PANGO_WEIGHT_BOLD | |
scale=1.75 | 46 | 46 | scale=1.75 | |
47 | 47 | |||
[Tag h2] | 48 | 48 | [Tag h2] | |
foreground=%%--main-header-color%% | 49 | 49 | foreground=%%--main-header-color%% | |
weight=PANGO_WEIGHT_BOLD | 50 | 50 | weight=PANGO_WEIGHT_BOLD | |
scale=1.52 | 51 | 51 | scale=1.52 | |
indent=20 | 52 | 52 | indent=20 | |
53 | 53 | |||
[Tag h3] | 54 | 54 | [Tag h3] | |
foreground=%%--main-header-color%% | 55 | 55 | foreground=%%--main-header-color%% | |
style=PANGO_STYLE_ITALIC | 56 | 56 | style=PANGO_STYLE_ITALIC | |
weight=PANGO_WEIGHT_BOLD | 57 | 57 | weight=PANGO_WEIGHT_BOLD | |
scale=1.32 | 58 | 58 | scale=1.32 | |
indent=40 | 59 | 59 | indent=40 | |
60 | 60 | |||
[Tag h4] | 61 | 61 | [Tag h4] | |
foreground=%%--main-header-color%% | 62 | 62 | foreground=%%--main-header-color%% | |
weight=PANGO_WEIGHT_BOLD | 63 | 63 | weight=PANGO_WEIGHT_BOLD | |
scale=1.15 | 64 | 64 | scale=1.15 | |
indent=60 | 65 | 65 | indent=60 |
templates/html/Wize_with_index_sod.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | 1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | 2 | 2 | <html> | |
<head> | 3 | 3 | <head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | 4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>[% title %]</title> | 5 | 5 | <title>[% title %]</title> | |
<meta name='Generator' content='[% generator.name %]'> | 6 | 6 | <meta name='Generator' content='[% generator.name %]'> | |
<link rel="shortcut icon" | 7 | 7 | <link rel="shortcut icon" | |
href="[% resource('common-spec/favicon.ico') %]" > | 8 | 8 | href="[% resource('common-spec/favicon.ico') %]" > | |
<link rel="stylesheet" | 9 | 9 | <link rel="stylesheet" | |
href="[% resource('common-spec/zim-variables.css') %]" > | 10 | 10 | href="[% resource('common-spec/zim-variables.css') %]" > | |
<link rel="stylesheet" | 11 | 11 | <link rel="stylesheet" | |
href="[% resource('common/zim-style.css') %]" > | 12 | 12 | href="[% resource('common/zim-style.css') %]" > | |
<link rel="stylesheet" | 13 | 13 | <link rel="stylesheet" | |
href="[% resource('common/zim-table-style.css') %]" > | 14 | 14 | href="[% resource('common/zim-table-style.css') %]" > | |
<link rel="stylesheet" | 15 | 15 | <link rel="stylesheet" | |
href="[% resource('common/zim-special.css') %]" > | 16 | 16 | href="[% resource('common/zim-special.css') %]" > | |
<link rel="stylesheet" | 17 | 17 | <link rel="stylesheet" | |
href="[% resource('common/zim-hljs.css') %]" > | 18 | 18 | href="[% resource('common/zim-hljs.css') %]" > | |
<link rel="stylesheet" | 19 | 19 | <link rel="stylesheet" | |
href="[% resource('common-spec/zim-override.css') %]" > | 20 | 20 | href="[% resource('common-spec/zim-override.css') %]" > | |
21 | 21 | |||
<style type='text/css'> | 22 | 22 | <style type='text/css'> | |
23 | 23 | |||
/* Comme on a le menu sur le côté */ | 24 | 24 | /* Comme on a le menu sur le côté */ | |
/* On augmente la taille de la page */ | 25 | 25 | /* On augmente la taille de la page */ | |
:root { | 26 | 26 | :root { | |
--main-page-width: 80em; | 27 | 27 | --main-page-width: var(--main-page-width-sod); | |
} | 28 | 28 | } | |
29 | 29 | |||
* { font-family: sans-serif } | 30 | 30 | * { font-family: sans-serif } | |
31 | 31 | |||
a:hover { text-decoration: underline; } | 32 | 32 | a:hover { text-decoration: underline; } | |
33 | 33 | |||
/* Centre les images mais elles sont coupées aux sauts de page à l'impression */ | 34 | 34 | /* Centre les images mais elles sont coupées aux sauts de page à l'impression */ | |
img { | 35 | 35 | img { | |
display: block; | 36 | 36 | display: block; | |
margin-left: auto; | 37 | 37 | margin-left: auto; | |
margin-right: auto; | 38 | 38 | margin-right: auto; | |
} | 39 | 39 | } | |
40 | 40 | |||
/* Specifique au with index */ | 41 | 41 | /* Specifique au with index */ | |
span.insen { color: grey } | 42 | 42 | span.insen { color: grey } | |
43 | 43 | |||
.pages { | 44 | 44 | .pages { | |
/*max-width: 1000px;*/ | 45 | 45 | /*max-width: 1000px;*/ | |
/*padding-left: 320px;*/ | 46 | 46 | /*padding-left: 320px;*/ | |
margin-left: 300px; | 47 | 47 | margin-left: 300px; | |
width: inherit; | 48 | 48 | width: inherit; | |
transition: margin-left .3s; | 49 | 49 | transition: margin-left .3s; | |
background: white; | 50 | 50 | background: white; | |
padding-left: 10px; | 51 | 51 | padding-left: 10px; | |
padding-right: 10px; | 52 | 52 | padding-right: 10px; | |
padding-bottom: 20px; | 53 | 53 | padding-bottom: 20px; | |
padding-top: 10px; | 54 | 54 | padding-top: 10px; | |
} | 55 | 55 | } | |
56 | 56 | |||
.menu{ | 57 | 57 | .menu{ | |
float:left; | 58 | 58 | float:left; | |
width: 300px; | 59 | 59 | width: 300px; | |
color:var(--main-header-color); | 60 | 60 | color:var(--main-header-color); | |
overflow-x: hidden; | 61 | 61 | overflow-x: hidden; | |
/*position: absolute;*/ | 62 | 62 | /*position: absolute;*/ | |
transition:.3s; | 63 | 63 | transition:.3s; | |
background: var(--main-menu-background-color); | 64 | 64 | background: var(--main-menu-background-color); | |
border-style: solid; | 65 | 65 | border-style: solid; | |
border-width: 1px; | 66 | 66 | border-width: 1px; | |
margin-left:-20px; | 67 | 67 | margin-left:-20px; | |
} | 68 | 68 | } | |
69 | 69 | |||
.menu a,.menu a:link,.menu a:hover,.menu a:active,.menu a:visited { | 70 | 70 | .menu a,.menu a:link,.menu a:hover,.menu a:active,.menu a:visited { | |
color: var(--main-header-color); | 71 | 71 | color: var(--main-header-color); | |
} | 72 | 72 | } | |
73 | 73 | |||
.menuOpen { | 74 | 74 | .menuOpen { | |
/*display: block;*/ | 75 | 75 | /*display: block;*/ | |
} | 76 | 76 | } | |
77 | 77 | |||
.menuClosed { | 78 | 78 | .menuClosed { | |
border-style: unset; | 79 | 79 | border-style: unset; | |
} | 80 | 80 | } | |
81 | 81 | |||
.header{ | 82 | 82 | .header{ | |
max-width: var(--main-page-width); | 83 | 83 | max-width: var(--main-page-width); | |
position: fixed; | 84 | 84 | position: fixed; | |
width: 100%; | 85 | 85 | width: 100%; | |
top:0; | 86 | 86 | top:0; | |
background:white; | 87 | 87 | background:white; | |
z-index: 1; | 88 | 88 | z-index: 1; | |
min-height:48px; | 89 | 89 | min-height:48px; | |
} | 90 | 90 | } | |
91 | 91 | |||
hr{ | 92 | 92 | hr{ | |
clear:both; | 93 | 93 | clear:both; | |
border-style: solid; | 94 | 94 | border-style: solid; | |
border-width: 1px; | 95 | 95 | border-width: 1px; | |
border-color: var(--main-header-color); | 96 | 96 | border-color: var(--main-header-color); | |
} | 97 | 97 | } | |
98 | 98 | |||
body { | 99 | 99 | body { | |
max-width: var(--main-page-width); | 100 | 100 | max-width: var(--main-page-width); | |
display:block; | 101 | 101 | display:block; | |
margin-left:auto; | 102 | 102 | margin-left:auto; | |
margin-right:auto; | 103 | 103 | margin-right:auto; | |
background: var(--main-body-background-color); | 104 | 104 | background: var(--main-body-background-color); | |
background-image: url('[% resource("common-spec/fond.jpg") %]'); | 105 | 105 | background-image: url('[% resource("common-spec/fond.jpg") %]'); | |
background-position: var(--main-body-background-position); | 106 | 106 | background-position: var(--main-body-background-position); | |
background-repeat: var(--main-body-background-repeat); | 107 | 107 | background-repeat: var(--main-body-background-repeat); | |
} | 108 | 108 | } | |
109 | 109 | |||
.intercalaire { | 110 | 110 | .intercalaire { | |
background:white; | 111 | 111 | background:white; | |
margin-top: 48px; | 112 | 112 | margin-top: 48px; | |
padding: 10px; | 113 | 113 | padding: 10px; | |
} | 114 | 114 | } | |
115 | 115 | |||
.bold-footer { | 116 | 116 | .bold-footer { | |
color: var(--main-header-color); | 117 | 117 | color: var(--main-header-color); | |
} | 118 | 118 | } | |
119 | 119 | |||
.zemaster { | 120 | 120 | .zemaster { | |
background: white; | 121 | 121 | background: white; | |
} | 122 | 122 | } | |
123 | 123 | |||
124 | 124 | |||
</style> | 125 | 125 | </style> | |
126 | 126 | |||
<!-- Themes clair : | 127 | 127 | <!-- Themes clair : | |
atom-one-light.css, vs.css googlecode.css github.css | 128 | 128 | atom-one-light.css, vs.css googlecode.css github.css | |
qtcreator_light.css | 129 | 129 | qtcreator_light.css | |
Themes sombres : | 130 | 130 | Themes sombres : | |
agate.css vs2015.css atom-one-dark.css hybrid.css | 131 | 131 | agate.css vs2015.css atom-one-dark.css hybrid.css | |
ir-black.css sunburst.css tomorrow-night-bright.css | 132 | 132 | ir-black.css sunburst.css tomorrow-night-bright.css | |
qtcreator_dark.css | 133 | 133 | qtcreator_dark.css | |
Demo live : https://highlightjs.org/static/demo/ --> | 134 | 134 | Demo live : https://highlightjs.org/static/demo/ --> | |
<link rel="stylesheet" | 135 | 135 | <link rel="stylesheet" | |
href="[% resource('common/hljs/styles/sunburst.css') %]" > | 136 | 136 | href="[% resource('common/hljs/styles/sunburst.css') %]" > | |
137 | 137 | |||
<!-- hljs --> | 138 | 138 | <!-- hljs --> | |
<script src="[% resource('common/hljs/highlight.pack.js') %]"></script> | 139 | 139 | <script src="[% resource('common/hljs/highlight.pack.js') %]"></script> | |
140 | 140 | |||
<script src="[% resource('common/wizefunc.js') %]"></script> | 141 | 141 | <script src="[% resource('common/wizefunc.js') %]"></script> | |
142 | 142 | |||
<script src="[% resource('common-spec/notice.js') %]"></script> | 143 | 143 | <script src="[% resource('common-spec/notice.js') %]"></script> | |
144 | 144 | |||
</head> | 145 | 145 | </head> | |
<body onload="testLogo()"> | 146 | 146 | <body onload="testLogo()"> | |
<button onclick="topFunction()" id="upBtn" title="Go to top"></button> | 147 | 147 | <button onclick="topFunction()" id="upBtn" title="Go to top"></button> | |
<!-- Header --> | 148 | 148 | <!-- Header --> | |
<div class='header'> | 149 | 149 | <div class='header'> | |
<table class='navigation' style="float:left"> | 150 | 150 | <table class='navigation' style="float:left"> | |
<tr class='navigation'> | 151 | 151 | <tr class='navigation'> | |
<td class='navigation'> | 152 | 152 | <td class='navigation'> | |
<span style="font-size:30px;cursor:pointer;color: var(--main-header-color);" onclick="openNav(1)">☰</span> | 153 | 153 | <span style="font-size:30px;cursor:pointer;color: var(--main-header-color);" onclick="openNav(1)">☰</span> | |
</td> | 154 | 154 | </td> | |
<td class='navigation'> | 155 | 155 | <td class='navigation'> | |
[% IF navigation.prev %] | 156 | 156 | [% IF navigation.prev %] | |
<a href='[% uri(navigation.prev) %]'> | 157 | 157 | <a href='[% uri(navigation.prev) %]'> | |
<img src="[% resource('common-spec/arrow-left.png') %]" alt="[% gettext('Prev') %]" title="[% gettext('Prev') %]"> | 158 | 158 | <img src="[% resource('common-spec/arrow-left.png') %]" alt="[% gettext('Prev') %]" title="[% gettext('Prev') %]"> | |
</a> | 159 | 159 | </a> | |
[% ELSE %] | 160 | 160 | [% ELSE %] | |
<img src="[% resource('common-spec/arrow-left-inact.png') %]" alt="[% gettext('Prev') %]" title="[% gettext('Prev') %]"> | 161 | 161 | <img src="[% resource('common-spec/arrow-left-inact.png') %]" alt="[% gettext('Prev') %]" title="[% gettext('Prev') %]"> | |
[% END %] | 162 | 162 | [% END %] | |
</td> | 163 | 163 | </td> | |
<td class='navigation'> | 164 | 164 | <td class='navigation'> | |
[% IF links.get("index") %] | 165 | 165 | [% IF links.get("index") %] | |
<a href='[% uri(links.get("index")) %]'> | 166 | 166 | <a href='[% uri(links.get("index")) %]'> | |
<img src="[% resource('common-spec/arrow-up.png') %]" alt="[% gettext('Index') %]" title="[% gettext('Index') %]"> | 167 | 167 | <img src="[% resource('common-spec/arrow-up.png') %]" alt="[% gettext('Index') %]" title="[% gettext('Index') %]"> | |
</a> | 168 | 168 | </a> | |
[% ELSE %] | 169 | 169 | [% ELSE %] | |
<img src="[% resource('common-spec/arrow-up-inact.png') %]" alt="[% gettext('Index') %]" title="[% gettext('Index') %]"> | 170 | 170 | <img src="[% resource('common-spec/arrow-up-inact.png') %]" alt="[% gettext('Index') %]" title="[% gettext('Index') %]"> | |
[% END %] | 171 | 171 | [% END %] | |
</td> | 172 | 172 | </td> | |
<td class='navigation'> | 173 | 173 | <td class='navigation'> | |
[% IF navigation.next %] | 174 | 174 | [% IF navigation.next %] | |
<a href='[% uri(navigation.next) %]'> | 175 | 175 | <a href='[% uri(navigation.next) %]'> | |
<img src="[% resource('common-spec/arrow-right.png') %]" alt="[% gettext('Next') %]" title="[% gettext('Next') %]"> | 176 | 176 | <img src="[% resource('common-spec/arrow-right.png') %]" alt="[% gettext('Next') %]" title="[% gettext('Next') %]"> | |
</a> | 177 | 177 | </a> | |
[% ELSE %] | 178 | 178 | [% ELSE %] | |
<img src="[% resource('common-spec/arrow-right-inact.png') %]" alt="[% gettext('Next') %]" title="[% gettext('Next') %]"> | 179 | 179 | <img src="[% resource('common-spec/arrow-right-inact.png') %]" alt="[% gettext('Next') %]" title="[% gettext('Next') %]"> | |
[% END %] | 180 | 180 | [% END %] | |
</td> | 181 | 181 | </td> | |
</tr> | 182 | 182 | </tr> | |
</table> | 183 | 183 | </table> | |
184 | 184 | |||
<span> | 185 | 185 | <span> | |
[% FOR page IN pages %] | 186 | 186 | [% FOR page IN pages %] | |
<a name='[% anchor(page) %]'></a> | 187 | 187 | <a name='[% anchor(page) %]'></a> | |
<h1 style="display:inline-block;margin-left:20px;margin-top:5px;"> | 188 | 188 | <h1 style="display:inline-block;margin-left:20px;margin-top:5px;"> | |
[% page.title %]</h1> | 189 | 189 | [% page.title %]</h1> | |
[% END %] | 190 | 190 | [% END %] | |
</span> | 191 | 191 | </span> | |
192 | 192 | |||
<table class='navigation' style="float:right;margin-right:10px;"> | 193 | 193 | <table class='navigation' style="float:right;margin-right:10px;"> | |
<tr class='navigation'> | 194 | 194 | <tr class='navigation'> | |
<td class='navigation'> | 195 | 195 | <td class='navigation'> | |
[% FOR page IN pages %] | 196 | 196 | [% FOR page IN pages %] | |
[% FOR link IN page.backlinks %] | 197 | 197 | [% FOR link IN page.backlinks %] | |
[% IF loop.first %]<a href="#backlinks"> | 198 | 198 | [% IF loop.first %]<a href="#backlinks"> | |
<img src='[% resource("common-spec/backlink.png") %]' alt='[% gettext("Backlinks:") %]' title='[% gettext("Backlinks:") %]'> | 199 | 199 | <img src='[% resource("common-spec/backlink.png") %]' alt='[% gettext("Backlinks:") %]' title='[% gettext("Backlinks:") %]'> | |
</a>[% END %] | 200 | 200 | </a>[% END %] | |
[% END %] | 201 | 201 | [% END %] | |
[% END %] | 202 | 202 | [% END %] | |
</td> | 203 | 203 | </td> | |
<td class='navigation'> | 204 | 204 | <td class='navigation'> | |
[% FOR page IN pages %] | 205 | 205 | [% FOR page IN pages %] | |
[% FOR file IN page.attachments %] | 206 | 206 | [% FOR file IN page.attachments %] | |
[% IF loop.first %]<a href="#attach"> | 207 | 207 | [% IF loop.first %]<a href="#attach"> | |
<img src='[% resource("common-spec/attachment.png") %]' alt='[% gettext("Attachments:") %]' title='[% gettext("Attachments:") %]'> | 208 | 208 | <img src='[% resource("common-spec/attachment.png") %]' alt='[% gettext("Attachments:") %]' title='[% gettext("Attachments:") %]'> | |
</a>[% END %] | 209 | 209 | </a>[% END %] | |
[% END %] | 210 | 210 | [% END %] | |
[% END %] | 211 | 211 | [% END %] | |
</td> | 212 | 212 | </td> | |
</tr> | 213 | 213 | </tr> | |
</table> | 214 | 214 | </table> | |
</div> | 215 | 215 | </div> | |
216 | 216 | |||
<div class="intercalaire"> | 217 | 217 | <div class="intercalaire"> | |
<hr /> | 218 | 218 | <hr /> | |
</div> | 219 | 219 | </div> | |
220 | 220 | |||
<div id="logoDivId" style="float:right"> | 221 | 221 | <div id="logoDivId" style="float:right"> | |
<img id="logoImgId" src='[% resource("common-spec/logo.png") %]' alt=' '> | 222 | 222 | <img id="logoImgId" src='[% resource("common-spec/logo.png") %]' alt=' '> | |
</div> | 223 | 223 | </div> | |
224 | 224 | |||
<div class="zemaster"> | 225 | 225 | <div class="zemaster"> | |
226 | 226 | |||
<div id="mySidenav" class="menu menuOpen"> | 227 | 227 | <div id="mySidenav" class="menu menuOpen"> | |
[% index() %] | 228 | 228 | [% index() %] | |
</div> | 229 | 229 | </div> | |
230 | 230 | |||
[% options.empty_lines = "default" %] | 231 | 231 | [% options.empty_lines = "default" %] | |
232 | 232 | |||
<!-- Wiki content --> | 233 | 233 | <!-- Wiki content --> | |
234 | 234 | |||
<div id="main" class='pages'> | 235 | 235 | <div id="main" class='pages'> | |
<!--[% FOR page IN pages %]--> | 236 | 236 | <!--[% FOR page IN pages %]--> | |
<!-- | 237 | 237 | <!-- | |
<div class='heading'> | 238 | 238 | <div class='heading'> | |
<h1>[% page.title %] <a name='[% anchor(page) %]'></a></h1> | 239 | 239 | <h1>[% page.title %] <a name='[% anchor(page) %]'></a></h1> | |
</div> | 240 | 240 | </div> | |
--> | 241 | 241 | --> | |
<div class='content'> | 242 | 242 | <div class='content'> | |
[% page.body %] | 243 | 243 | [% page.body %] | |
</div> | 244 | 244 | </div> | |
245 | 245 | |||
<br /> | 246 | 246 | <br /> | |
247 | 247 | |||
<div style="padding-bottom:10px;"> | 248 | 248 | <div style="padding-bottom:10px;"> | |
<hr /> | 249 | 249 | <hr /> | |
</div> | 250 | 250 | </div> | |
251 | 251 | |||
<div class='page-footer'> | 252 | 252 | <div class='page-footer'> | |
<!--[% FOR link IN page.backlinks %]--> | 253 | 253 | <!--[% FOR link IN page.backlinks %]--> | |
[% IF loop.first %] | 254 | 254 | [% IF loop.first %] | |
<a name="backlinks"></a> | 255 | 255 | <a name="backlinks"></a> | |
<b class="bold-footer">[% gettext("Backlinks:") %]</b> | 256 | 256 | <b class="bold-footer">[% gettext("Backlinks:") %]</b> |
templates/html/common-blue/zim-variables.css
1 | 1 | |||
/* Variables */ | 2 | 2 | /* Variables */ | |
3 | 3 | |||
:root { | 4 | 4 | :root { | |
/* General */ | 5 | 5 | /* General */ | |
--main-header-color: #437484; /* Headers color */ | 6 | 6 | --main-header-color: #437484; /* Headers color */ | |
--main-link-color: #008ab8; /* Links color */ | 7 | 7 | --main-link-color: #008ab8; /* Links color */ | |
--main-strike-color: grey; /* Strike color */ | 8 | 8 | --main-strike-color: grey; /* Strike color */ | |
--main-pre-color: darkmagenta; /* Verbatim bloc color */ | 9 | 9 | --main-pre-color: darkmagenta; /* Verbatim bloc color */ | |
--main-tt-color: darkmagenta; /* Inline verbatim */ | 10 | 10 | --main-tt-color: darkmagenta; /* Inline verbatim */ | |
--main-code-color: saddlebrown; /* Code color (if hljs not used) */ | 11 | 11 | --main-code-color: saddlebrown; /* Code color (if hljs not used) */ | |
12 | 12 | |||
/* Background | 13 | 13 | /* Background | |
* | 14 | 14 | * | |
* if fond.jpg exists in the resource directory, it will be used as backround | 15 | 15 | * if fond.jpg exists in the resource directory, it will be used as backround | |
* image with position and repetition given by : | 16 | 16 | * image with position and repetition given by : | |
* --main-body-background-position an --main-body-background-repeat | 17 | 17 | * --main-body-background-position an --main-body-background-repeat | |
* | 18 | 18 | * | |
* if the image does not exists the color defined by | 19 | 19 | * if the image does not exists the color defined by | |
* --main-body-background-color | 20 | 20 | * --main-body-background-color | |
* will be used | 21 | 21 | * will be used | |
*/ | 22 | 22 | */ | |
/*--main-body-background-color: linear-gradient(to right,#8eb7c2,white,white,#8eb7c2); */ | 23 | 23 | /*--main-body-background-color: linear-gradient(to right,#8eb7c2,white,white,#8eb7c2); */ | |
--main-body-background-color: #80a5ae; /* Color of the background body */ | 24 | 24 | --main-body-background-color: #80a5ae; /* Color of the background body */ | |
--main-body-background-position: left; | 25 | 25 | --main-body-background-position: left; | |
--main-body-background-repeat: repeat; | 26 | 26 | --main-body-background-repeat: repeat; | |
27 | 27 | |||
--main-menu-background-color: #fafafa; /* Backroung color of side menu */ | 28 | 28 | --main-menu-background-color: #fafafa; /* Backroung color of side menu */ | |
/* Underline really underlined */ | 29 | 29 | /* Underline really underlined */ | |
--main-menu-u-decoration: underline; | 30 | 30 | --main-u-decoration: underline; | |
--main-menu-u-background-color: white; | 31 | 31 | --main-u-background-color: white; | |
/* Underline Stabilo Version */ | 32 | 32 | /* Underline Stabilo Version */ | |
/*--main-menu-u-decoration: none; | 33 | 33 | /*--main-u-decoration: none; | |
--main-menu-u-background-color: yellow;*/ | 34 | 34 | --main-u-background-color: yellow;*/ | |
--main-page-width: 72em; /* Page width */ | 35 | 35 | --main-page-width: 72em; /* Page width */ | |
36 | --main-page-width-sod: 80em; /* Page width for sod version */ | |||
36 | 37 | |||
37 | 38 | |||
/* Tables */ | 38 | 39 | /* Tables */ | |
/* Table headers */ | 39 | 40 | /* Table headers */ | |
--main-th-color: black; /* Table header text color */ | 40 | 41 | --main-th-color: black; /* Table header text color */ | |
--main-th-background-color: #bbb; /* Table header background */ | 41 | 42 | --main-th-background-color: #bbb; /* Table header background */ | |
/* Table Row and Data */ | 42 | 43 | /* Table Row and Data */ | |
--main-tr-even-background-color: #f2f2f2; /* Even row background color */ | 43 | 44 | --main-tr-even-background-color: #f2f2f2; /* Even row background color */ | |
--main-tr-odd-background-color: white; /* Odd row background color */ | 44 | 45 | --main-tr-odd-background-color: white; /* Odd row background color */ | |
--main-tr-hover-background-color: #ddd; /* Row background color when hover */ | 45 | 46 | --main-tr-hover-background-color: #ddd; /* Row background color when hover */ |
templates/html/common-wize/zim-variables.css
1 | 1 | |||
/* Variables */ | 2 | 2 | /* Variables */ | |
3 | 3 | |||
:root { | 4 | 4 | :root { | |
/* General */ | 5 | 5 | /* General */ | |
--main-header-color: #4e9a06; /* Headers color */ | 6 | 6 | --main-header-color: #4e9a06; /* Headers color */ | |
--main-link-color: blue; /* Links color */ | 7 | 7 | --main-link-color: blue; /* Links color */ | |
--main-strike-color: grey; /* Strike color */ | 8 | 8 | --main-strike-color: grey; /* Strike color */ | |
--main-pre-color: darkmagenta; /* Verbatim bloc color */ | 9 | 9 | --main-pre-color: darkmagenta; /* Verbatim bloc color */ | |
--main-tt-color: darkmagenta; /* Inline verbatim */ | 10 | 10 | --main-tt-color: darkmagenta; /* Inline verbatim */ | |
--main-code-color: saddlebrown; /* Code color (if hljs not used) */ | 11 | 11 | --main-code-color: saddlebrown; /* Code color (if hljs not used) */ | |
12 | 12 | |||
/* Background | 13 | 13 | /* Background | |
* | 14 | 14 | * | |
* if fond.jpg exists in the resource directory, it will be used as backround | 15 | 15 | * if fond.jpg exists in the resource directory, it will be used as backround | |
* image with position and repetition given by : | 16 | 16 | * image with position and repetition given by : | |
* --main-body-background-position an --main-body-background-repeat | 17 | 17 | * --main-body-background-position an --main-body-background-repeat | |
* | 18 | 18 | * | |
* if the image does not exists the color defined by | 19 | 19 | * if the image does not exists the color defined by | |
* --main-body-background-color | 20 | 20 | * --main-body-background-color | |
* will be used | 21 | 21 | * will be used | |
*/ | 22 | 22 | */ | |
--main-body-background-color: #779988; /* Color of the background body */ | 23 | 23 | --main-body-background-color: #779988; /* Color of the background body */ | |
--main-body-background-position: center; | 24 | 24 | --main-body-background-position: center; | |
--main-body-background-repeat: repeat; | 25 | 25 | --main-body-background-repeat: repeat; | |
26 | 26 | |||
--main-menu-background-color: #fafafa; /* Backroung color of side menu */ | 27 | 27 | --main-menu-background-color: #fafafa; /* Backroung color of side menu */ | |
/* Underline really underlined */ | 28 | 28 | /* Underline really underlined */ | |
--main-menu-u-decoration: underline; | 29 | 29 | --main-u-decoration: underline; | |
--main-menu-u-background-color: white; | 30 | 30 | --main-u-background-color: white; | |
/* Underline Stabilo Version */ | 31 | 31 | /* Underline Stabilo Version */ | |
/*--main-menu-u-decoration: none; | 32 | 32 | /*--main-u-decoration: none; | |
--main-menu-u-background-color: yellow;*/ | 33 | 33 | --main-u-background-color: yellow;*/ | |
--main-page-width: 72em; /* Page width */ | 34 | 34 | --main-page-width: 72em; /* Page width */ | |
35 | --main-page-width-sod: 80em; /* Page width for sod version */ | |||
35 | 36 | |||
36 | 37 | |||
/* Tables */ | 37 | 38 | /* Tables */ | |
/* Table headers */ | 38 | 39 | /* Table headers */ | |
--main-th-color: black; /* Table header text color */ | 39 | 40 | --main-th-color: black; /* Table header text color */ | |
--main-th-background-color: #bbb; /* Table header background */ | 40 | 41 | --main-th-background-color: #bbb; /* Table header background */ | |
/* Table Row and Data */ | 41 | 42 | /* Table Row and Data */ | |
--main-tr-even-background-color: #f2f2f2; /* Even row background color */ | 42 | 43 | --main-tr-even-background-color: #f2f2f2; /* Even row background color */ | |
--main-tr-odd-background-color: white; /* Odd row background color */ | 43 | 44 | --main-tr-odd-background-color: white; /* Odd row background color */ | |
--main-tr-hover-background-color: #ddd; /* Row background color when hover */ | 44 | 45 | --main-tr-hover-background-color: #ddd; /* Row background color when hover */ |
templates/html/common/zim-style.css
/* Common zim definitions */ | 1 | 1 | /* Common zim definitions */ | |
2 | 2 | |||
a { text-decoration: none; | 3 | 3 | a { text-decoration: none; | |
color: var(--main-link-color);} | 4 | 4 | color: var(--main-link-color);} | |
a:link { text-decoration: none; | 5 | 5 | a:link { text-decoration: none; | |
color: var(--main-link-color);} | 6 | 6 | color: var(--main-link-color);} | |
a:hover { text-decoration: none; | 7 | 7 | a:hover { text-decoration: none; | |
color: var(--main-link-color);} | 8 | 8 | color: var(--main-link-color);} | |
a:active { text-decoration: none; | 9 | 9 | a:active { text-decoration: none; | |
color: var(--main-link-color);} | 10 | 10 | color: var(--main-link-color);} | |
a:visited { text-decoration: none; | 11 | 11 | a:visited { text-decoration: none; | |
color: var(--main-link-color);} | 12 | 12 | color: var(--main-link-color);} | |
13 | 13 | |||
strike { color: var(--main-strike-color);} | 14 | 14 | strike { color: var(--main-strike-color);} | |
15 | 15 | |||
u { text-decoration: var(--main-menu-u-decoration); | 16 | 16 | u { text-decoration: var(--main-u-decoration); | |
background-color: var(--main-menu-u-background-color);} | 17 | 17 | background-color: var(--main-u-background-color);} | |
18 | 18 | |||
tt { color: var(--main-tt-color); | 19 | 19 | tt { color: var(--main-tt-color); | |
font-family: monospace; | 20 | 20 | font-family: monospace; | |
font-size: large} | 21 | 21 | font-size: large} | |
22 | 22 | |||
pre { color: var(--main-pre-color); | 23 | 23 | pre { color: var(--main-pre-color); | |
margin-left: 20px; | 24 | 24 | margin-left: 20px; | |
margin-right: 5px; | 25 | 25 | margin-right: 5px; | |
margin-bottom: 5px; | 26 | 26 | margin-bottom: 5px; | |
margin-top: 5px; | 27 | 27 | margin-top: 5px; | |
font-family: monospace; | 28 | 28 | font-family: monospace; | |
font-size: large } | 29 | 29 | font-size: large } | |
30 | 30 | |||
code { font-size: large; font-family: monospace; color: var(--main-code-color)} | 31 | 31 | code { font-size: large; font-family: monospace; color: var(--main-code-color)} | |
32 | 32 | |||
h1 { text-decoration: underline; | 33 | 33 | h1 { text-decoration: underline; | |
color: var(--main-header-color); | 34 | 34 | color: var(--main-header-color); | |
margin-bottom: 0; | 35 | 35 | margin-bottom: 0; | |
margin-top: 1em; } | 36 | 36 | margin-top: 1em; } | |
37 | 37 | |||
h2 { color: var(--main-header-color); | 38 | 38 | h2 { color: var(--main-header-color); | |
margin-bottom: 0; | 39 | 39 | margin-bottom: 0; | |
margin-left: 20px; | 40 | 40 | margin-left: 20px; | |
margin-top: 1em;} | 41 | 41 | margin-top: 1em;} | |
42 | 42 | |||
h3 { color: var(--main-header-color); | 43 | 43 | h3 { color: var(--main-header-color); | |
margin-bottom: 0; | 44 | 44 | margin-bottom: 0; | |
margin-left: 40px; | 45 | 45 | margin-left: 40px; | |
margin-top: 1em; | 46 | 46 | margin-top: 1em; | |
font-style: italic; } | 47 | 47 | font-style: italic; } | |
48 | 48 | |||
h4 { color: var(--main-header-color); | 49 | 49 | h4 { color: var(--main-header-color); | |
margin-bottom: 0; | 50 | 50 | margin-bottom: 0; | |
margin-left: 60px; | 51 | 51 | margin-left: 60px; | |
margin-top: 1em;} | 52 | 52 | margin-top: 1em;} | |
53 | 53 | |||
h5 { color: var(--main-header-color); | 54 | 54 | h5 { color: var(--main-header-color); | |
margin-bottom: 0; | 55 | 55 | margin-bottom: 0; | |
margin-left: 80px; | 56 | 56 | margin-left: 80px; | |
margin-top: 1em;} | 57 | 57 | margin-top: 1em;} | |
58 | 58 | |||
p { margin-top: 0 } | 59 | 59 | p { margin-top: 0 } | |
60 | 60 | |||
.notice { | 61 | 61 | .notice { | |
margin-top:20px; | 62 | 62 | margin-top:20px; | |
font-size:small; | 63 | 63 | font-size:small; | |
} | 64 | 64 | } | |
65 | 65 | |||
#upBtn { | 66 | 66 | #upBtn { | |
display: none; | 67 | 67 | display: none; | |
position: fixed; | 68 | 68 | position: fixed; | |
bottom: 20px; | 69 | 69 | bottom: 20px; | |
right: 30px; | 70 | 70 | right: 30px; | |
z-index: 99; | 71 | 71 | z-index: 99; | |
font-size: 18px; | 72 | 72 | font-size: 18px; | |
border: none; | 73 | 73 | border: none; | |
outline: none; | 74 | 74 | outline: none; | |
background-color: #7777; | 75 | 75 | background-color: #7777; | |
color: white; | 76 | 76 | color: white; | |
cursor: pointer; | 77 | 77 | cursor: pointer; | |
padding: 15px; | 78 | 78 | padding: 15px; | |
border-radius: 4px; | 79 | 79 | border-radius: 4px; | |
} | 80 | 80 | } | |
81 | 81 | |||
#upBtn::before { | 82 | 82 | #upBtn::before { |
wize.rb
#!/usr/bin/env ruby | 1 | 1 | #!/usr/bin/env ruby | |
2 | 2 | |||
require 'optparse' | 3 | 3 | require 'optparse' | |
4 | 4 | |||
# Variables globales $version, $auteur et $date | 5 | 5 | # Variables globales $version, $auteur et $date | |
$version = "0.1" | 6 | 6 | $version = "0.1" | |
$auteur = "William Daniau" | 7 | 7 | $auteur = "William Daniau" | |
$date = "2019 10 11" | 8 | 8 | $date = "2019 10 11" | |
9 | 9 | |||
# Global directory definitions | 10 | 10 | # Global directory definitions | |
$zimShareDir = "#{ENV['HOME']}/.local/share/zim" | 11 | 11 | $zimShareDir = "#{ENV['HOME']}/.local/share/zim" | |
$zimHtmlTemplateDir = "#{$zimShareDir}/templates/html" | 12 | 12 | $zimHtmlTemplateDir = "#{$zimShareDir}/templates/html" | |
$zimConfigDir = "#{ENV['HOME']}/.config/zim" | 13 | 13 | $zimConfigDir = "#{ENV['HOME']}/.config/zim" | |
14 | 14 | |||
# Parse arguments class | 15 | 15 | # Parse arguments class | |
class ParseOptions | 16 | 16 | class ParseOptions | |
def self.parse(args) | 17 | 17 | def self.parse(args) | |
options = Hash.new | 18 | 18 | options = Hash.new | |
19 | 19 | |||
opt_parser = OptionParser.new do |opts| | 20 | 20 | opt_parser = OptionParser.new do |opts| | |
opts.banner = "\nUtilisation : wize.rb [options]" | 21 | 21 | opts.banner = "\nUtilisation : wize.rb [options]" | |
opts.separator "" | 22 | 22 | opts.separator "" | |
whatIDo = <<-AFP | 23 | 23 | whatIDo = <<-AFP | |
24 | 24 | |||
liste ou applique une configuration de template wize pour zim | 25 | 25 | liste ou applique une configuration de template wize pour zim | |
26 | 26 | |||
AFP | 27 | 27 | AFP | |
28 | 28 | |||
opts.separator whatIDo | 29 | 29 | opts.separator whatIDo | |
30 | 30 | |||
opts.on("-i", | 31 | 31 | opts.on("-i", | |
"--install", | 32 | 32 | "--install", | |
" - crée le fichier Wize_Print.html à partir", | 33 | 33 | " - crée le fichier Wize_Print.html à partir", | |
"du fichier template correspondant en", | 34 | 34 | "du fichier template correspondant en", | |
"remplaçant %%HOME%% par la valeur de $HOME.", | 35 | 35 | "remplaçant %%HOME%% par la valeur de $HOME.", | |
" - Installe un lien symbolique dans", | 36 | 36 | " - Installe un lien symbolique dans", | |
"le dossier de config de zim.", | 37 | 37 | "le dossier de config de zim.", | |
" - Applique le thème wize de base", | 38 | 38 | " - Applique le thème wize de base", | |
"A éxécuter a priori une seule fois .") do |l| | 39 | 39 | "A éxécuter a priori une seule fois .") do |l| | |
options[:install] = l | 40 | 40 | options[:install] = l | |
end | 41 | 41 | end | |
42 | 42 | |||
opts.on("-l", | 43 | 43 | opts.on("-l", | |
"--list", | 44 | 44 | "--list", | |
"Liste les configurations disponibles") do |l| | 45 | 45 | "Liste les configurations disponibles") do |l| | |
options[:list] = l | 46 | 46 | options[:list] = l | |
end | 47 | 47 | end | |
48 | 48 | |||
opts.on("-p", | 49 | 49 | opts.on("-p", | |
"--print", | 50 | 50 | "--print", | |
"Affiche la configuration actuelle") do |p| | 51 | 51 | "Affiche la configuration actuelle") do |p| | |
options[:print] = p | 52 | 52 | options[:print] = p | |
end | 53 | 53 | end | |
54 | 54 | |||
opts.on("-a", | 55 | 55 | opts.on("-a", | |
"--apply CONF", | 56 | 56 | "--apply CONF", | |
"applique la config CONF") do |conf| | 57 | 57 | "applique la config CONF") do |conf| | |
options[:conf] = conf | 58 | 58 | options[:conf] = conf | |
end | 59 | 59 | end | |
60 | 60 | |||
opts.separator "" | 61 | 61 | opts.separator "" | |
opts.separator " Options standard:" | 62 | 62 | opts.separator " Options standard:" | |
opts.on_tail("-h", "--help", "Affiche ce message") do | 63 | 63 | opts.on_tail("-h", "--help", "Affiche ce message") do | |
puts opts | 64 | 64 | puts opts | |
puts "" | 65 | 65 | puts "" | |
exit | 66 | 66 | exit | |
end | 67 | 67 | end | |
opts.on_tail("-v", "--version", "Affiche la version") do | 68 | 68 | opts.on_tail("-v", "--version", "Affiche la version") do | |
puts "Version : " + $version | 69 | 69 | puts "Version : " + $version | |
puts "Auteur : " + $auteur | 70 | 70 | puts "Auteur : " + $auteur | |
puts "Date : " + $date | 71 | 71 | puts "Date : " + $date | |
puts "" | 72 | 72 | puts "" | |
exit | 73 | 73 | exit | |
end | 74 | 74 | end | |
end | 75 | 75 | end | |
76 | 76 | |||
opt_parser.parse!(args) | 77 | 77 | opt_parser.parse!(args) | |
options | 78 | 78 | options | |
end | 79 | 79 | end | |
end | 80 | 80 | end | |
81 | 81 | |||
# Get the config list | 82 | 82 | # Get the config list | |
def listConfigs | 83 | 83 | def listConfigs | |
Dir.chdir($zimHtmlTemplateDir) | 84 | 84 | Dir.chdir($zimHtmlTemplateDir) | |
a = `ls`.split(/\n/) | 85 | 85 | a = `ls`.split(/\n/) | |
names = [] | 86 | 86 | names = [] | |
r = /^common-(.+)$/ | 87 | 87 | r = /^common-(.+)$/ | |
a.each { |f| | 88 | 88 | a.each { |f| | |
if f =~ r | 89 | 89 | if f =~ r | |
names.push($1) | 90 | 90 | names.push($1) | |
end | 91 | 91 | end | |
} | 92 | 92 | } | |
names | 93 | 93 | names | |
end | 94 | 94 | end | |
95 | 95 | |||
# Get the current config by looking at print-common | 96 | 96 | # Get the current config by looking at print-common | |
def getCurrent | 97 | 97 | def getCurrent | |
Dir.chdir($zimHtmlTemplateDir) | 98 | 98 | Dir.chdir($zimHtmlTemplateDir) | |
File.readlink("print-common") =~ /^common-(.+)$/ | 99 | 99 | File.readlink("print-common") =~ /^common-(.+)$/ | |
$1 | 100 | 100 | $1 | |
end | 101 | 101 | end | |
102 | 102 | |||
# Apply a config | 103 | 103 | # Apply a config | |
def applyConfig(name) | 104 | 104 | def applyConfig(name) | |
Dir.chdir($zimHtmlTemplateDir) | 105 | 105 | Dir.chdir($zimHtmlTemplateDir) | |
list = ["Wize", "Wize_with_index", "Wize_with_index_sod", "Wize_S5"] | 106 | 106 | list = ["Wize", "Wize_with_index", "Wize_with_index_sod", "Wize_S5"] | |
list.each { |l| | 107 | 107 | list.each { |l| | |
# Removing previous content | 108 | 108 | # Removing previous content | |
system("rm -rf #{l}/common") | 109 | 109 | system("rm -rf #{l}/common") | |
system("rm -rf #{l}/common-spec") | 110 | 110 | system("rm -rf #{l}/common-spec") | |
# Copying new content | 111 | 111 | # Copying new content | |
system("cp -r common #{l}/common") | 112 | 112 | system("cp -r common #{l}/common") | |
system("cp -r common-#{name} #{l}/common-spec") | 113 | 113 | system("cp -r common-#{name} #{l}/common-spec") | |
} | 114 | 114 | } | |
# For print | 115 | 115 | # For print | |
system("rm -f print-common") | 116 | 116 | system("rm -f print-common") | |
system("ln -s common-#{name} print-common") | 117 | 117 | system("ln -s common-#{name} print-common") | |
end | 118 | 118 | end | |
119 | 119 | |||
# Is the name a valid config? | 120 | 120 | # Is the name a valid config? | |
def configInList?(name, names) | 121 | 121 | def configInList?(name, names) | |
names.include? name | 122 | 122 | names.include? name | |
end | 123 | 123 | end | |
124 | 124 | |||
# Re-create Wize_Print.html from template | 125 | 125 | # Re-create Wize_Print.html from template | |
# and initialize link into zim config directory | 126 | 126 | # and initialize link into zim config directory | |
def installWize | 127 | 127 | def installWize | |
Dir.chdir($zimHtmlTemplateDir) | 128 | 128 | Dir.chdir($zimHtmlTemplateDir) | |
begin | 129 | 129 | begin | |
printTemplate = File.new("Wize_Print_Template.tpl", "r") | 130 | 130 | printTemplate = File.new("Wize_Print_Template.tpl", "r") | |
rescue | 131 | 131 | rescue | |
puts "cannot open print file for reading" | 132 | 132 | puts "cannot open print file for reading" | |
exit | 133 | 133 | exit | |
end | 134 | 134 | end | |
tabfile = [] | 135 | 135 | tabfile = [] | |
stor = '%%HOME%%' | 136 | 136 | stor = '%%HOME%%' | |
rby = ENV['HOME'] | 137 | 137 | rby = ENV['HOME'] | |
printTemplate.readlines.each { |line| | 138 | 138 | printTemplate.readlines.each { |line| | |
line.gsub!(stor,rby) | 139 | 139 | line.gsub!(stor,rby) | |
tabfile.push(line) | 140 | 140 | tabfile.push(line) | |
} | 141 | 141 | } | |
printTemplate.close | 142 | 142 | printTemplate.close | |
begin | 143 | 143 | begin | |
printFile = File.new("Wize_Print.html", "w") | 144 | 144 | printFile = File.new("Wize_Print.html", "w") | |
rescue | 145 | 145 | rescue | |
puts "cannot open print file for writing" | 146 | 146 | puts "cannot open print file for writing" | |
exit | 147 | 147 | exit | |
end | 148 | 148 | end | |
tabfile.each { |line| | 149 | 149 | tabfile.each { |line| | |
printFile.write line | 150 | 150 | printFile.write line | |
} | 151 | 151 | } | |
printFile.close | 152 | 152 | printFile.close | |
153 | 153 | |||
Dir.chdir($zimConfigDir) | 154 | 154 | Dir.chdir($zimConfigDir) | |
system("rm -f style.conf") | 155 | 155 | system("rm -f style.conf") | |
system("ln -s #{$zimShareDir}/style.conf style.conf") | 156 | 156 | system("ln -s #{$zimShareDir}/style.conf style.conf") | |
157 | 157 | |||
# Now apply wize theme | 158 | 158 | # Now apply wize theme | |
applyConfig("wize") | 159 | 159 | applyConfig("wize") | |
createStyleFile("wize") | 160 | 160 | createStyleFile("wize") | |
end | 161 | 161 | end | |
162 | 162 | |||
# Create style-name.conf according to common-name/zim-variables.css | 163 | 163 | # Create style-name.conf according to common-name/zim-variables.css | |
def createStyleFile(name) | 164 | 164 | def createStyleFile(name) | |
lfTags = ["--main-header-color", | 165 | 165 | lfTags = ["--main-header-color", | |
"--main-menu-u-decoration", | 166 | 166 | "--main-u-decoration", | |
"--main-menu-u-background-color", | 167 | 167 | "--main-u-background-color", | |
"--main-strike-color", | 168 | 168 | "--main-strike-color", | |
"--main-tt-color", | 169 | 169 | "--main-tt-color", | |
"--main-pre-color", | 170 | 170 | "--main-pre-color", | |
"--main-link-color"] | 171 | 171 | "--main-link-color"] | |
172 | 172 | |||
# First we load the css file and parse it | 173 | 173 | # First we load the css file and parse it | |
Dir.chdir($zimHtmlTemplateDir) | 174 | 174 | Dir.chdir($zimHtmlTemplateDir) | |
begin | 175 | 175 | begin | |
nameCSS = File.new("common-#{name}/zim-variables.css", "r") | 176 | 176 | nameCSS = File.new("common-#{name}/zim-variables.css", "r") | |
rescue | 177 | 177 | rescue | |
puts "cannot open common-#{name}/zim-variables.css for reading" | 178 | 178 | puts "cannot open common-#{name}/zim-variables.css for reading" | |
exit | 179 | 179 | exit | |
end | 180 | 180 | end | |
sCSS = nameCSS.read | 181 | 181 | sCSS = nameCSS.read | |
regComment = /\/\*.*?\*\//m | 182 | 182 | regComment = /\/\*.*?\*\//m | |
sCSS.gsub!(regComment, '') | 183 | 183 | sCSS.gsub!(regComment, '') | |
sTags = {} | 184 | 184 | sTags = {} | |
lfTags.each { |tag| | 185 | 185 | lfTags.each { |tag| | |
var = Regexp.escape(tag) | 186 | 186 | var = Regexp.escape(tag) | |
reg = /#{var}\s*:\s*(\S+)\s*;/ | 187 | 187 | reg = /#{var}\s*:\s*(\S+)\s*;/ | |
sCSS =~ reg | 188 | 188 | sCSS =~ reg | |
sTags[tag] = $1 | 189 | 189 | sTags[tag] = $1 | |
# On traite le cas particulier du u-decoration | 190 | 190 | # On traite le cas particulier du u-decoration | |
if tag == "--main-menu-u-decoration" | 191 | 191 | if tag == "--main-u-decoration" | |
sTags[tag] = sTags[tag] == 'underline' ? 'PANGO_UNDERLINE_SINGLE' : '' | 192 | 192 | sTags[tag] = sTags[tag] == 'underline' ? 'PANGO_UNDERLINE_SINGLE' : '' | |
end | 193 | 193 | end | |
} | 194 | 194 | } | |
195 | 195 | |||
# know read the style template | 196 | 196 | # know read the style template | |
Dir.chdir($zimShareDir) | 197 | 197 | Dir.chdir($zimShareDir) | |
begin | 198 | 198 | begin | |
styleTemplate = File.new("style-template.conf", "r") | 199 | 199 | styleTemplate = File.new("style-template.conf", "r") | |
rescue | 200 | 200 | rescue | |
puts "cannot open style-template.conf for reading" | 201 | 201 | puts "cannot open style-template.conf for reading" | |
exit | 202 | 202 | exit | |
end | 203 | 203 | end | |
styleTemplateString = styleTemplate.read | 204 | 204 | styleTemplateString = styleTemplate.read | |
lfTags.each { |tag| | 205 | 205 | lfTags.each { |tag| | |
styleTemplateString.gsub!("%%#{tag}%%", sTags[tag]) | 206 | 206 | styleTemplateString.gsub!("%%#{tag}%%", sTags[tag]) | |
} | 207 | 207 | } | |
# Now write the file | 208 | 208 | # Now write the file | |
begin | 209 | 209 | begin | |
styleOutput = File.new("style-#{name}.conf", "w") | 210 | 210 | styleOutput = File.new("style-#{name}.conf", "w") | |
rescue | 211 | 211 | rescue | |
puts "cannot open style-#{name}.conf for writing" | 212 | 212 | puts "cannot open style-#{name}.conf for writing" | |
exit | 213 | 213 | exit | |
end | 214 | 214 | end | |
styleOutput.write styleTemplateString | 215 | 215 | styleOutput.write styleTemplateString | |
styleOutput.close | 216 | 216 | styleOutput.close | |
# Now create the symbolic link | 217 | 217 | # Now create the symbolic link | |
system("rm style.conf") | 218 | 218 | system("rm style.conf") | |
system("ln -s style-#{name}.conf style.conf") | 219 | 219 | system("ln -s style-#{name}.conf style.conf") | |
end | 220 | 220 | end | |
221 | 221 | |||
# Parse arguments using the class and get results in a hash | 222 | 222 | # Parse arguments using the class and get results in a hash | |
options = ParseOptions.parse(ARGV) | 223 | 223 | options = ParseOptions.parse(ARGV) | |
if options.length == 0 | 224 | 224 | if options.length == 0 | |
puts "Utiliser -h pour l'aide" | 225 | 225 | puts "Utiliser -h pour l'aide" | |
exit | 226 | 226 | exit | |
end | 227 | 227 | end | |
228 | 228 | |||
# get existing configs | 229 | 229 | # get existing configs | |
configs = listConfigs | 230 | 230 | configs = listConfigs | |
231 | 231 | |||
# Installation | 232 | 232 | # Installation | |
if options[:install] | 233 | 233 | if options[:install] | |
installWize | 234 | 234 | installWize | |
exit | 235 | 235 | exit | |
end | 236 | 236 | end | |
237 | 237 | |||
# List | 238 | 238 | # List | |
if options[:list] | 239 | 239 | if options[:list] | |
configs.each { |c| | 240 | 240 | configs.each { |c| |