Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add simple build tools for CSS, and automate the addition of !importa…

…nt clauses to annotation.embed.css
  • Loading branch information...
commit e507a6374207a5078882c6646e3ff36f43387024 1 parent a325d67
Nick Stenning authored April 13, 2012
1  .gitignore
@@ -3,4 +3,5 @@
3 3
 /annotateit.egg-info
4 4
 /instance/annotateit.cfg
5 5
 /instance/*.db
  6
+/.redo
6 7
 *.pyc
4  all.do
... ...
@@ -0,0 +1,4 @@
  1
+for f in annotateit/static/**/*.less; do
  2
+  echo "${f%.less}.css"
  3
+done | xargs redo-ifchange
  4
+redo-ifchange annotateit/static/annotation.embed.css
84  annotateit/static/annotation.css
... ...
@@ -1,42 +1,42 @@
1 1
 @import url("http://fonts.googleapis.com/css?family=Arvo:700");
2 2
 .annotateit-annotation {
3  
-  width: 70% !important;
4  
-  max-width: 500px !important;
5  
-  margin: 0 auto !important;
6  
-  background-color: rgba(251, 251, 251, 0.98) !important;
7  
-  border: 1px solid rgba(122, 122, 122, 0.6) !important;
8  
-  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, sans-serif !important;
9  
-  font-size: 12px !important;
10  
-  -webkit-border-radius: 5px !important;
11  
-  -moz-border-radius: 5px !important;
12  
-  border-radius: 5px !important;
13  
-  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
14  
-  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
15  
-  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  3
+  width: 70%;
  4
+  max-width: 500px;
  5
+  margin: 0 auto;
  6
+  background-color: rgba(251, 251, 251, 0.98);
  7
+  border: 1px solid rgba(122, 122, 122, 0.6);
  8
+  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, sans-serif;
  9
+  font-size: 12px;
  10
+  -webkit-border-radius: 5px;
  11
+  -moz-border-radius: 5px;
  12
+  border-radius: 5px;
  13
+  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  14
+  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  15
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
16 16
 }
17 17
 .annotateit-annotation .ann-head {
18  
-  margin-top: 8px !important;
19  
-  background: none !important;
  18
+  margin-top: 8px;
  19
+  background: none;
20 20
   zoom: 1;
21 21
 }
22 22
 .annotateit-annotation .ann-head img {
23  
-  float: left !important;
24  
-  width: 50px !important;
25  
-  border: 1px solid #333 !important;
26  
-  padding: 0 !important;
27  
-  margin: 0px 8px !important;
28  
-  background: none !important;
  23
+  float: left;
  24
+  width: 50px;
  25
+  border: 1px solid #333;
  26
+  padding: 0;
  27
+  margin: 0px 8px;
  28
+  background: none;
29 29
 }
30 30
 .annotateit-annotation .ann-head .ann-head-right {
31  
-  width: auto !important;
32  
-  margin: 0px 8px 8px 66px !important;
33  
-  padding: 0 !important;
  31
+  width: auto;
  32
+  margin: 0px 8px 8px 66px;
  33
+  padding: 0;
34 34
 }
35 35
 .annotateit-annotation .ann-head .ann-head-right .ann-username {
36  
-  font-family: 'Arvo', Arvo, serif !important;
37  
-  font-weight: bold !important;
38  
-  font-size: 20px !important;
39  
-  line-height: 50px !important;
  36
+  font-family: 'Arvo', Arvo, serif;
  37
+  font-weight: bold;
  38
+  font-size: 20px;
  39
+  line-height: 50px;
40 40
 }
41 41
 .annotateit-annotation .ann-head:before,
42 42
 .annotateit-annotation .ann-head:after {
@@ -47,32 +47,32 @@
47 47
   clear: both;
48 48
 }
49 49
 .annotateit-annotation .ann-body {
50  
-  margin: 0px 8px 8px 8px !important;
  50
+  margin: 0px 8px 8px 8px;
51 51
 }
52 52
 .annotateit-annotation .ann-body .text {
53  
-  font-family: Georgia, Palatino, serif !important;
54  
-  margin: 8px 0 !important;
55  
-  font-size: 140% !important;
  53
+  font-family: Georgia, Palatino, serif;
  54
+  margin: 8px 0;
  55
+  font-size: 140%;
56 56
 }
57 57
 .annotateit-annotation .ann-body .null-text {
58  
-  color: #555 !important;
59  
-  margin: 20px 0 !important;
60  
-  font-size: 120% !important;
61  
-  font-style: italic !important;
  58
+  color: #555;
  59
+  margin: 20px 0;
  60
+  font-size: 120%;
  61
+  font-style: italic;
62 62
 }
63 63
 .annotateit-annotation .ann-body .ann-meta {
64  
-  color: #aaa !important;
65  
-  font-size: 90% !important;
66  
-  margin: 10px 0 0 0 !important;
  64
+  color: #aaa;
  65
+  font-size: 90%;
  66
+  margin: 10px 0 0 0;
67 67
 }
68 68
 .annotateit-annotation a:link,
69 69
 .annotateit-annotation a:visited {
70  
-  color: #aaa !important;
  70
+  color: #aaa;
71 71
 }
72 72
 .annotateit-annotation a:hover,
73 73
 .annotateit-annotation a:focus {
74  
-  color: #3665fa !important;
  74
+  color: #3665fa;
75 75
 }
76 76
 .annotateit-annotation a:active {
77  
-  color: #f50998 !important;
  77
+  color: #f50998;
78 78
 }
78  annotateit/static/annotation.embed.css
... ...
@@ -0,0 +1,78 @@
  1
+@import url("http://fonts.googleapis.com/css?family=Arvo:700") ;
  2
+.annotateit-annotation {
  3
+  width: 70% !important;
  4
+  max-width: 500px !important;
  5
+  margin: 0 auto !important;
  6
+  background-color: rgba(251, 251, 251, 0.98) !important;
  7
+  border: 1px solid rgba(122, 122, 122, 0.6) !important;
  8
+  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, sans-serif !important;
  9
+  font-size: 12px !important;
  10
+  -webkit-border-radius: 5px !important;
  11
+  -moz-border-radius: 5px !important;
  12
+  border-radius: 5px !important;
  13
+  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  14
+  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  15
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  16
+}
  17
+.annotateit-annotation .ann-head {
  18
+  margin-top: 8px !important;
  19
+  background: none !important;
  20
+  zoom: 1 !important;
  21
+}
  22
+.annotateit-annotation .ann-head img {
  23
+  float: left !important;
  24
+  width: 50px !important;
  25
+  border: 1px solid #333 !important;
  26
+  padding: 0 !important;
  27
+  margin: 0px 8px !important;
  28
+  background: none !important;
  29
+}
  30
+.annotateit-annotation .ann-head .ann-head-right {
  31
+  width: auto !important;
  32
+  margin: 0px 8px 8px 66px !important;
  33
+  padding: 0 !important;
  34
+}
  35
+.annotateit-annotation .ann-head .ann-head-right .ann-username {
  36
+  font-family: 'Arvo', Arvo, serif !important;
  37
+  font-weight: bold !important;
  38
+  font-size: 20px !important;
  39
+  line-height: 50px !important;
  40
+}
  41
+.annotateit-annotation .ann-head:before,
  42
+.annotateit-annotation .ann-head:after {
  43
+  content: "" !important;
  44
+  display: table !important;
  45
+}
  46
+.annotateit-annotation .ann-head:after {
  47
+  clear: both !important;
  48
+}
  49
+.annotateit-annotation .ann-body {
  50
+  margin: 0px 8px 8px 8px !important;
  51
+}
  52
+.annotateit-annotation .ann-body .text {
  53
+  font-family: Georgia, Palatino, serif !important;
  54
+  margin: 8px 0 !important;
  55
+  font-size: 140% !important;
  56
+}
  57
+.annotateit-annotation .ann-body .null-text {
  58
+  color: #555 !important;
  59
+  margin: 20px 0 !important;
  60
+  font-size: 120% !important;
  61
+  font-style: italic !important;
  62
+}
  63
+.annotateit-annotation .ann-body .ann-meta {
  64
+  color: #aaa !important;
  65
+  font-size: 90% !important;
  66
+  margin: 10px 0 0 0 !important;
  67
+}
  68
+.annotateit-annotation a:link,
  69
+.annotateit-annotation a:visited {
  70
+  color: #aaa !important;
  71
+}
  72
+.annotateit-annotation a:hover,
  73
+.annotateit-annotation a:focus {
  74
+  color: #3665fa !important;
  75
+}
  76
+.annotateit-annotation a:active {
  77
+  color: #f50998 !important;
  78
+}
76  annotateit/static/annotation.less
@@ -6,41 +6,41 @@
6 6
 @import url("http://fonts.googleapis.com/css?family=Arvo:700");
7 7
 
8 8
 .annotateit-annotation {
9  
-  width: 70% !important;
10  
-  max-width: 500px !important;
11  
-  margin: 0 auto !important;
12  
-  background-color: rgba(251, 251, 251, 0.98) !important;
13  
-  border: 1px solid rgba(122, 122, 122, 0.6) !important;
  9
+  width: 70%;
  10
+  max-width: 500px;
  11
+  margin: 0 auto;
  12
+  background-color: rgba(251, 251, 251, 0.98);
  13
+  border: 1px solid rgba(122, 122, 122, 0.6);
14 14
 
15  
-  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, sans-serif !important;
16  
-  font-size: 12px !important;
  15
+  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, sans-serif;
  16
+  font-size: 12px;
17 17
 
18  
-  .border-radius(5px) !important;
19  
-  .box-shadow(0 1px 3px rgba(0,0,0,0.15)) !important;
  18
+  .border-radius(5px);
  19
+  .box-shadow(0 1px 3px rgba(0,0,0,0.15));
20 20
 
21 21
   .ann-head {
22  
-    margin-top: 8px !important;
23  
-    background: none !important;
  22
+    margin-top: 8px;
  23
+    background: none;
24 24
 
25 25
     img {
26  
-      float: left !important;
27  
-      width: 50px !important;
28  
-      border: 1px solid #333 !important;
29  
-      padding: 0 !important;
30  
-      margin: 0px 8px !important;
31  
-      background: none !important;
  26
+      float: left;
  27
+      width: 50px;
  28
+      border: 1px solid #333;
  29
+      padding: 0;
  30
+      margin: 0px 8px;
  31
+      background: none;
32 32
     }
33 33
 
34 34
     .ann-head-right {
35  
-      width: auto !important;
36  
-      margin: 0px 8px 8px 66px !important;
37  
-      padding: 0 !important;
  35
+      width: auto;
  36
+      margin: 0px 8px 8px 66px;
  37
+      padding: 0;
38 38
 
39 39
       .ann-username {
40  
-        font-family: 'Arvo', Arvo, serif !important;
41  
-        font-weight: bold !important;
42  
-        font-size: 20px !important;
43  
-        line-height: 50px !important;
  40
+        font-family: 'Arvo', Arvo, serif;
  41
+        font-weight: bold;
  42
+        font-size: 20px;
  43
+        line-height: 50px;
44 44
       }
45 45
     }
46 46
 
@@ -49,36 +49,36 @@
49 49
   } // .ann-header
50 50
 
51 51
   .ann-body {
52  
-    margin: 0px 8px 8px 8px !important;
  52
+    margin: 0px 8px 8px 8px;
53 53
 
54 54
     .text {
55  
-      font-family: Georgia, Palatino, serif !important;
56  
-      margin: 8px 0 !important;
57  
-      font-size: 140% !important;
  55
+      font-family: Georgia, Palatino, serif;
  56
+      margin: 8px 0;
  57
+      font-size: 140%;
58 58
     }
59 59
 
60 60
     .null-text {
61  
-      color: #555 !important;
62  
-      margin: 20px 0 !important;
63  
-      font-size: 120% !important;
64  
-      font-style: italic !important;
  61
+      color: #555;
  62
+      margin: 20px 0;
  63
+      font-size: 120%;
  64
+      font-style: italic;
65 65
     }
66 66
 
67 67
     .ann-meta {
68  
-      color: #aaa !important;
69  
-      font-size: 90% !important;
70  
-      margin: 10px 0 0 0 !important;
  68
+      color: #aaa;
  69
+      font-size: 90%;
  70
+      margin: 10px 0 0 0;
71 71
     }
72 72
   } // .ann-body
73 73
 
74 74
   a:link, a:visited {
75  
-    color: #aaa !important;
  75
+    color: #aaa;
76 76
   }
77 77
   a:hover, a:focus {
78  
-    color: @hoverColor !important;
  78
+    color: @hoverColor;
79 79
   }
80 80
   a:active {
81  
-    color: @activeColor !important;
  81
+    color: @activeColor;
82 82
   }
83 83
 }
84 84
 
1  annotateit/static/clean.do
... ...
@@ -0,0 +1 @@
  1
+find . -path ./vendor -prune -o -name '*.css' -print | xargs rm
2  annotateit/static/default.css.do
... ...
@@ -0,0 +1,2 @@
  1
+redo-ifchange "${2}.less"
  2
+lessc "${2}.less"
3  annotateit/static/default.embed.css.do
... ...
@@ -0,0 +1,3 @@
  1
+redo-ifchange "${2}.less"
  2
+lessc "${2}.less" "${3}"
  3
+gsed -r -i'' -e 's/;/ !important;/' -e 's/(@[^!]+)!important;/\1;/' "${3}"
96  annotateit/static/main.css
@@ -190,50 +190,50 @@ form.primary {
190 190
   * Annotation display
191 191
   *************************************/
192 192
 .annotateit-annotation {
193  
-  width: 70% !important;
194  
-  max-width: 500px !important;
195  
-  margin: 0 auto !important;
196  
-  background-color: rgba(251, 251, 251, 0.98) !important;
197  
-  border: 1px solid rgba(122, 122, 122, 0.6) !important;
198  
-  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, sans-serif !important;
199  
-  font-size: 12px !important;
200  
-  -webkit-border-radius: 5px !important;
201  
-  -moz-border-radius: 5px !important;
202  
-  border-radius: 5px !important;
203  
-  -webkit-border-radius: 5px !important;
204  
-  -moz-border-radius: 5px !important;
205  
-  border-radius: 5px !important;
206  
-  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
207  
-  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
208  
-  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
209  
-  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
210  
-  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
211  
-  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  193
+  width: 70%;
  194
+  max-width: 500px;
  195
+  margin: 0 auto;
  196
+  background-color: rgba(251, 251, 251, 0.98);
  197
+  border: 1px solid rgba(122, 122, 122, 0.6);
  198
+  font-family: "Helvetica Neue", HelveticaNeue, Helvetica, sans-serif;
  199
+  font-size: 12px;
  200
+  -webkit-border-radius: 5px;
  201
+  -moz-border-radius: 5px;
  202
+  border-radius: 5px;
  203
+  -webkit-border-radius: 5px;
  204
+  -moz-border-radius: 5px;
  205
+  border-radius: 5px;
  206
+  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  207
+  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  208
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  209
+  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  210
+  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  211
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
212 212
 }
213 213
 .annotateit-annotation .ann-head {
214  
-  margin-top: 8px !important;
215  
-  background: none !important;
  214
+  margin-top: 8px;
  215
+  background: none;
216 216
   zoom: 1;
217 217
   zoom: 1;
218 218
 }
219 219
 .annotateit-annotation .ann-head img {
220  
-  float: left !important;
221  
-  width: 50px !important;
222  
-  border: 1px solid #333 !important;
223  
-  padding: 0 !important;
224  
-  margin: 0px 8px !important;
225  
-  background: none !important;
  220
+  float: left;
  221
+  width: 50px;
  222
+  border: 1px solid #333;
  223
+  padding: 0;
  224
+  margin: 0px 8px;
  225
+  background: none;
226 226
 }
227 227
 .annotateit-annotation .ann-head .ann-head-right {
228  
-  width: auto !important;
229  
-  margin: 0px 8px 8px 66px !important;
230  
-  padding: 0 !important;
  228
+  width: auto;
  229
+  margin: 0px 8px 8px 66px;
  230
+  padding: 0;
231 231
 }
232 232
 .annotateit-annotation .ann-head .ann-head-right .ann-username {
233  
-  font-family: 'Arvo', Arvo, serif !important;
234  
-  font-weight: bold !important;
235  
-  font-size: 20px !important;
236  
-  line-height: 50px !important;
  233
+  font-family: 'Arvo', Arvo, serif;
  234
+  font-weight: bold;
  235
+  font-size: 20px;
  236
+  line-height: 50px;
237 237
 }
238 238
 .annotateit-annotation .ann-head:before,
239 239
 .annotateit-annotation .ann-head:after {
@@ -252,34 +252,34 @@ form.primary {
252 252
   clear: both;
253 253
 }
254 254
 .annotateit-annotation .ann-body {
255  
-  margin: 0px 8px 8px 8px !important;
  255
+  margin: 0px 8px 8px 8px;
256 256
 }
257 257
 .annotateit-annotation .ann-body .text {
258  
-  font-family: Georgia, Palatino, serif !important;
259  
-  margin: 8px 0 !important;
260  
-  font-size: 140% !important;
  258
+  font-family: Georgia, Palatino, serif;
  259
+  margin: 8px 0;
  260
+  font-size: 140%;
261 261
 }
262 262
 .annotateit-annotation .ann-body .null-text {
263  
-  color: #555 !important;
264  
-  margin: 20px 0 !important;
265  
-  font-size: 120% !important;
266  
-  font-style: italic !important;
  263
+  color: #555;
  264
+  margin: 20px 0;
  265
+  font-size: 120%;
  266
+  font-style: italic;
267 267
 }
268 268
 .annotateit-annotation .ann-body .ann-meta {
269  
-  color: #aaa !important;
270  
-  font-size: 90% !important;
271  
-  margin: 10px 0 0 0 !important;
  269
+  color: #aaa;
  270
+  font-size: 90%;
  271
+  margin: 10px 0 0 0;
272 272
 }
273 273
 .annotateit-annotation a:link,
274 274
 .annotateit-annotation a:visited {
275  
-  color: #aaa !important;
  275
+  color: #aaa;
276 276
 }
277 277
 .annotateit-annotation a:hover,
278 278
 .annotateit-annotation a:focus {
279  
-  color: #3665fa !important;
  279
+  color: #3665fa;
280 280
 }
281 281
 .annotateit-annotation a:active {
282  
-  color: #f50998 !important;
  282
+  color: #f50998;
283 283
 }
284 284
 .recent-annotations .annotateit-annotation {
285 285
   margin: 0 0 10px 0 !important;
2  annotateit/static/main.css.do
... ...
@@ -0,0 +1,2 @@
  1
+redo-ifchange **/*.less
  2
+lessc "main.less"
0  annotateit/static/mixins.css
No changes.
1  clean.do
... ...
@@ -0,0 +1 @@
  1
+redo annotateit/static/clean
5  run.py
... ...
@@ -1,5 +1,8 @@
  1
+import os
1 2
 import annotateit
2 3
 
3 4
 if __name__ == '__main__':
  5
+    port = int(os.environ.get('PORT', 5000))
  6
+    host = os.environ.get('HOST', '127.0.0.1')
4 7
     app = annotateit.create_app()
5  
-    app.run()
  8
+    app.run(port=port, host=host)

0 notes on commit e507a63

Please sign in to comment.
Something went wrong with that request. Please try again.