genit 1.0.1 → 2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS +12 -28
- data/README.markdown +6 -2
- data/Rakefile +1 -1
- data/TODO +177 -12
- data/VERSION +1 -1
- data/bin/genit +18 -20
- data/data/styles/screen.css +5 -9
- data/data/templates/main.html +0 -1
- data/lib/genit.rb +9 -4
- data/lib/genit/builders/body_link_builder.rb +8 -8
- data/lib/genit/builders/builder_base.rb +11 -11
- data/lib/genit/builders/head_link_builder.rb +8 -8
- data/lib/genit/builders/relativizer.rb +12 -12
- data/lib/genit/builders/script_builder.rb +7 -7
- data/lib/genit/documents/document_writer.rb +14 -14
- data/lib/genit/documents/fragment.rb +23 -22
- data/lib/genit/documents/xml_document.rb +5 -1
- data/lib/genit/project.rb +1 -0
- data/lib/genit/project/compiler.rb +54 -73
- data/lib/genit/project/page_compiler.rb +41 -41
- data/lib/genit/project/pages_finder.rb +6 -6
- data/lib/genit/project/project_creator.rb +116 -111
- data/lib/genit/project/root_cleaner.rb +31 -0
- data/lib/genit/project/rss_feed.rb +14 -14
- data/lib/genit/server.rb +2 -0
- data/lib/genit/server/server.rb +33 -0
- data/lib/genit/tags/class_fragment_tag.rb +2 -2
- data/lib/genit/tags/class_menu_tag.rb +2 -1
- data/lib/genit/tags/class_news_tag.rb +24 -24
- data/lib/genit/tags/class_pages_tag.rb +1 -1
- data/lib/genit/tags/here_tag.rb +22 -18
- data/lib/genit/utils/news_utils.rb +3 -3
- data/spec/class_news_tag_spec.rb +5 -5
- data/spec/compiler_spec.rb +51 -60
- data/spec/fragment_spec.rb +19 -19
- data/spec/html_document_spec.rb +10 -10
- data/spec/page_compiler_spec.rb +13 -9
- data/spec/pages_finder_spec.rb +11 -11
- data/spec/project_creator_spec.rb +53 -102
- data/spec/test-files/malformed.html +5 -0
- data/spec/xml_document_spec.rb +5 -0
- metadata +6 -9
- data/data/styles/alsa/all.css +0 -130
- data/data/styles/yui/all.css +0 -3
- data/data/styles/yui/base.css +0 -80
- data/data/styles/yui/fonts.css +0 -47
- data/data/styles/yui/reset.css +0 -126
- data/data/templates/xhtml_1.0_strict +0 -5
- data/data/templates/xhtml_1.0_transitional +0 -5
data/spec/xml_document_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: '2.0'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/genit/project/rss_feed.rb
|
76
76
|
- lib/genit/project/project_creator.rb
|
77
77
|
- lib/genit/project/page_compiler.rb
|
78
|
+
- lib/genit/project/root_cleaner.rb
|
78
79
|
- lib/genit/project/compiler.rb
|
79
80
|
- lib/genit/builders/head_link_builder.rb
|
80
81
|
- lib/genit/builders/builder.rb
|
@@ -94,6 +95,7 @@ files:
|
|
94
95
|
- lib/genit/utils/file_writer.rb
|
95
96
|
- lib/genit/utils/news_utils.rb
|
96
97
|
- lib/genit/builders.rb
|
98
|
+
- lib/genit/server/server.rb
|
97
99
|
- lib/genit/utils.rb
|
98
100
|
- lib/genit/tags/class_menu_tag.rb
|
99
101
|
- lib/genit/tags/class_news_tag.rb
|
@@ -107,21 +109,15 @@ files:
|
|
107
109
|
- lib/genit/documents.rb
|
108
110
|
- lib/genit/extensions/string_extension.rb
|
109
111
|
- lib/genit/extensions/nokogiri_extension.rb
|
112
|
+
- lib/genit/server.rb
|
110
113
|
- lib/genit.rb
|
111
114
|
- bin/genit
|
112
|
-
- data/templates/xhtml_1.0_strict
|
113
115
|
- data/templates/html_5
|
114
|
-
- data/templates/xhtml_1.0_transitional
|
115
116
|
- data/templates/menu.html
|
116
117
|
- data/templates/main.html
|
117
118
|
- data/styles/handheld.css
|
118
119
|
- data/styles/print.css
|
119
|
-
- data/styles/alsa/all.css
|
120
120
|
- data/styles/screen.css
|
121
|
-
- data/styles/yui/reset.css
|
122
|
-
- data/styles/yui/all.css
|
123
|
-
- data/styles/yui/base.css
|
124
|
-
- data/styles/yui/fonts.css
|
125
121
|
- data/pages/index.html
|
126
122
|
- data/pages/index2.html
|
127
123
|
- spec/file_writer_spec.rb
|
@@ -139,6 +135,7 @@ files:
|
|
139
135
|
- spec/project_creator_spec.rb
|
140
136
|
- spec/extensions_spec.rb
|
141
137
|
- spec/bluecloth_spec.rb
|
138
|
+
- spec/test-files/malformed.html
|
142
139
|
- spec/test-files/fragment4.html
|
143
140
|
- spec/test-files/fragment3.html
|
144
141
|
- spec/test-files/test.markdown
|
data/data/styles/alsa/all.css
DELETED
@@ -1,130 +0,0 @@
|
|
1
|
-
/* --- STYLES DE BASE ---
|
2
|
-
*
|
3
|
-
* from alsacréations:
|
4
|
-
* http://www.alsacreations.com/astuce/lire/654-feuille-de-styles-de-base.html
|
5
|
-
*/
|
6
|
-
|
7
|
-
/* Page */
|
8
|
-
html {
|
9
|
-
font-size: 100%; /* Évite un bug d'IE 6-7. (1) */
|
10
|
-
}
|
11
|
-
body {
|
12
|
-
margin: 0;
|
13
|
-
padding: 1em; /* Remettre à zéro si nécessaire. */
|
14
|
-
/* Pensez à utiliser une collection de polices (2), par ex:
|
15
|
-
font-family: Arial, Helvetica, FreeSans, sans-serif; */
|
16
|
-
font-size: .8em; /* À adapter pour la police choisie. (3) */
|
17
|
-
line-height: 1.4; /* À adapter au design. (4) */
|
18
|
-
color: black;
|
19
|
-
background: white;
|
20
|
-
}
|
21
|
-
|
22
|
-
/* Titres */
|
23
|
-
h1, h2, h3, h4, h5, h6 {
|
24
|
-
margin: 1em 0 .5em 0; /* Rapproche le titre du texte. (5) */
|
25
|
-
line-height: 1.2;
|
26
|
-
font-weight: bold; /* Valeur par défaut. (6) */
|
27
|
-
font-style: normal;
|
28
|
-
}
|
29
|
-
h1 {
|
30
|
-
font-size: 1.75em;
|
31
|
-
}
|
32
|
-
h2 {
|
33
|
-
font-size: 1.5em;
|
34
|
-
}
|
35
|
-
h3 {
|
36
|
-
font-size: 1.25em;
|
37
|
-
}
|
38
|
-
h4 {
|
39
|
-
font-size: 1em;
|
40
|
-
}
|
41
|
-
|
42
|
-
/* Listes */
|
43
|
-
ul, ol {
|
44
|
-
margin: .75em 0 .75em 32px;
|
45
|
-
padding: 0;
|
46
|
-
}
|
47
|
-
|
48
|
-
/* Paragraphes */
|
49
|
-
p {
|
50
|
-
margin: .75em 0; /* Marges plus faibles que par défaut. (7) */
|
51
|
-
}
|
52
|
-
address {
|
53
|
-
margin: .75em 0;
|
54
|
-
font-style: normal;
|
55
|
-
}
|
56
|
-
|
57
|
-
/* Liens */
|
58
|
-
a {
|
59
|
-
text-decoration: underline;
|
60
|
-
}
|
61
|
-
a:link {
|
62
|
-
color: #11C;
|
63
|
-
}
|
64
|
-
a:visited {
|
65
|
-
color: #339;
|
66
|
-
}
|
67
|
-
a:hover, a:focus, a:active {
|
68
|
-
color: #00F;
|
69
|
-
}
|
70
|
-
|
71
|
-
/* Pas de bordure autour des images dans les liens */
|
72
|
-
a img {
|
73
|
-
border: none;
|
74
|
-
}
|
75
|
-
|
76
|
-
/* Divers éléments de type en-ligne (8) */
|
77
|
-
em {
|
78
|
-
font-style: italic;
|
79
|
-
}
|
80
|
-
strong {
|
81
|
-
font-weight: bold;
|
82
|
-
}
|
83
|
-
|
84
|
-
/* Formulaires */
|
85
|
-
form, fieldset {
|
86
|
-
margin: 0;
|
87
|
-
padding: 0;
|
88
|
-
border: none;
|
89
|
-
}
|
90
|
-
input, button, select {
|
91
|
-
vertical-align: middle; /* Solution pb. d'alignement. (9) */
|
92
|
-
}
|
93
|
-
|
94
|
-
/*
|
95
|
-
* 1. Bug décrit sur la page suivante: Bug avec l’unité relative em et Internet Explorer.
|
96
|
-
*
|
97
|
-
* 2. Pour un choix de collections de polices (font-family, voir Quelles polices de caractères
|
98
|
-
* (fontes) utiliser sur le Web?.
|
99
|
-
*
|
100
|
-
* 3. Ici, on utilise les styles de l'élément body pour définir la taille du texte globale pour le
|
101
|
-
* site. Une police Arial ou Helvetica à .8em, soit 80% de la taille du texte par défaut du
|
102
|
-
* navigateur, fournit une bonne lisibilité. Il faudra adapter cette valeur suivant la police
|
103
|
-
* choisie, les besoins du design, etc.
|
104
|
-
*
|
105
|
-
* 4. Les valeurs 1.1 et 1.2 conviennent marchent bien pour les titres, voire pour le texte dans des
|
106
|
-
* colonnes étroites. Pour des lignes de texte plus longues, on utilisera plutôt des valeurs
|
107
|
-
* entre 1.2 (120%) et 1.8 (180%).
|
108
|
-
*
|
109
|
-
* 5. Avec les styles par défaut des navigateurs, les titres ont souvent une marge supérieure et une
|
110
|
-
* marge inférieure égales. Du coup, on ne reconnait pas au premier coup d'œil que le titre se
|
111
|
-
* rapporte au texte qui le suit. Le style proposé corrige ce défaut. Pour retrouver le style par
|
112
|
-
* défaut des navigateurs, utilisez un margin: 1em 0;.
|
113
|
-
*
|
114
|
-
* 6. Dans les styles par défaut des navigateurs, les titres sont en gras. Si vous souhaitez une
|
115
|
-
* graisse normale pour la plupart de vos titres, utilisez plutôt font-weight: normal.
|
116
|
-
*
|
117
|
-
* 7. On utilise des em afin que les marges des paragraphes soient proportionnelles à la taille du
|
118
|
-
* texte, ce que ne font pas tous les navigateurs (notamment IE). On utilise une valeur de .75em,
|
119
|
-
* soit des retraits entre les paragraphes un peu plus faibles que ceux utilisés par défaut par
|
120
|
-
* les navigateurs. À modifier selon vos besoins.
|
121
|
-
*
|
122
|
-
* 8. Ces styles correspondent aux valeurs par défaut des navigateurs, mais vous voudrez peut-être
|
123
|
-
* les modifier pour votre projet.
|
124
|
-
*
|
125
|
-
* 9. Les éléments de formulaires sont assez difficiles à mettre en forme et à positionner. De plus,
|
126
|
-
* l'alignement vertical des boutons, cases à cocher et autres listes déroulantes est parfois
|
127
|
-
* difficile à gérer. Vu les différences de comportement entre navigateurs, il n'y a pas de
|
128
|
-
* solution parfaite, mais utiliser un alignement vertical centré dans la hauteur de ligne permet
|
129
|
-
* d'avoir un rendu décent avec tous les navigateurs.
|
130
|
-
*/
|
data/data/styles/yui/all.css
DELETED
data/data/styles/yui/base.css
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
-
Code licensed under the BSD License:
|
4
|
-
http://developer.yahoo.com/yui/license.html
|
5
|
-
version: 3.3.0
|
6
|
-
build: 3167
|
7
|
-
*/
|
8
|
-
/* base.css, part of YUI's CSS Foundation */
|
9
|
-
h1 {
|
10
|
-
/*18px via YUI Fonts CSS foundation*/
|
11
|
-
font-size:138.5%;
|
12
|
-
}
|
13
|
-
h2 {
|
14
|
-
/*16px via YUI Fonts CSS foundation*/
|
15
|
-
font-size:123.1%;
|
16
|
-
}
|
17
|
-
h3 {
|
18
|
-
/*14px via YUI Fonts CSS foundation*/
|
19
|
-
font-size:108%;
|
20
|
-
}
|
21
|
-
h1,h2,h3 {
|
22
|
-
/* top & bottom margin based on font size */
|
23
|
-
margin:1em 0;
|
24
|
-
}
|
25
|
-
h1,h2,h3,h4,h5,h6,strong {
|
26
|
-
/*bringing boldness back to headers and the strong element*/
|
27
|
-
font-weight:bold;
|
28
|
-
}
|
29
|
-
abbr,acronym {
|
30
|
-
/*indicating to users that more info is available */
|
31
|
-
border-bottom:1px dotted #000;
|
32
|
-
cursor:help;
|
33
|
-
}
|
34
|
-
em {
|
35
|
-
/*bringing italics back to the em element*/
|
36
|
-
font-style:italic;
|
37
|
-
}
|
38
|
-
blockquote,ul,ol,dl {
|
39
|
-
/*giving blockquotes and lists room to breath*/
|
40
|
-
margin:1em;
|
41
|
-
}
|
42
|
-
ol,ul,dl {
|
43
|
-
/*bringing lists on to the page with breathing room */
|
44
|
-
margin-left:2em;
|
45
|
-
}
|
46
|
-
ol li {
|
47
|
-
/*giving OL's LIs generated numbers*/
|
48
|
-
list-style: decimal outside;
|
49
|
-
}
|
50
|
-
ul li {
|
51
|
-
/*giving UL's LIs generated disc markers*/
|
52
|
-
list-style: disc outside;
|
53
|
-
}
|
54
|
-
dl dd {
|
55
|
-
/*providing spacing for definition terms*/
|
56
|
-
margin-left:1em;
|
57
|
-
}
|
58
|
-
th,td {
|
59
|
-
/*borders and padding to make the table readable*/
|
60
|
-
border:1px solid #000;
|
61
|
-
padding:.5em;
|
62
|
-
}
|
63
|
-
th {
|
64
|
-
/*distinguishing table headers from data cells*/
|
65
|
-
font-weight:bold;
|
66
|
-
text-align:center;
|
67
|
-
}
|
68
|
-
caption {
|
69
|
-
/*coordinated margin to match cell's padding*/
|
70
|
-
margin-bottom:.5em;
|
71
|
-
/*centered so it doesn't blend in to other content*/
|
72
|
-
text-align:center;
|
73
|
-
}
|
74
|
-
p,fieldset,table,pre {
|
75
|
-
/*so things don't run into each other*/
|
76
|
-
margin-bottom:1em;
|
77
|
-
}
|
78
|
-
/* setting a consistent width, 160px;
|
79
|
-
control of type=file still not possible */
|
80
|
-
input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;}
|
data/data/styles/yui/fonts.css
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
-
Code licensed under the BSD License:
|
4
|
-
http://developer.yahoo.com/yui/license.html
|
5
|
-
version: 3.3.0
|
6
|
-
build: 3167
|
7
|
-
*/
|
8
|
-
/**
|
9
|
-
* Percents could work for IE, but for backCompat purposes, we are using keywords.
|
10
|
-
* x-small is for IE6/7 quirks mode.
|
11
|
-
*/
|
12
|
-
body {
|
13
|
-
font:13px/1.231 arial,helvetica,clean,sans-serif;
|
14
|
-
*font-size:small; /* for IE */
|
15
|
-
*font:x-small; /* for IE in quirks mode */
|
16
|
-
}
|
17
|
-
|
18
|
-
/**
|
19
|
-
* Nudge down to get to 13px equivalent for these form elements
|
20
|
-
*/
|
21
|
-
select,
|
22
|
-
input,
|
23
|
-
button,
|
24
|
-
textarea {
|
25
|
-
font:99% arial,helvetica,clean,sans-serif;
|
26
|
-
}
|
27
|
-
|
28
|
-
/**
|
29
|
-
* To help tables remember to inherit
|
30
|
-
*/
|
31
|
-
table {
|
32
|
-
font-size:inherit;
|
33
|
-
font:100%;
|
34
|
-
}
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Bump up IE to get to 13px equivalent for these fixed-width elements
|
38
|
-
*/
|
39
|
-
pre,
|
40
|
-
code,
|
41
|
-
kbd,
|
42
|
-
samp,
|
43
|
-
tt {
|
44
|
-
font-family:monospace;
|
45
|
-
*font-size:108%;
|
46
|
-
line-height:100%;
|
47
|
-
}
|
data/data/styles/yui/reset.css
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
-
Code licensed under the BSD License:
|
4
|
-
http://developer.yahoo.com/yui/license.html
|
5
|
-
version: 3.3.0
|
6
|
-
build: 3167
|
7
|
-
*/
|
8
|
-
/*
|
9
|
-
TODO will need to remove settings on HTML since we can't namespace it.
|
10
|
-
TODO with the prefix, should I group by selector or property for weight savings?
|
11
|
-
*/
|
12
|
-
html{
|
13
|
-
color:#000;
|
14
|
-
background:#FFF;
|
15
|
-
}
|
16
|
-
/*
|
17
|
-
TODO remove settings on BODY since we can't namespace it.
|
18
|
-
*/
|
19
|
-
/*
|
20
|
-
TODO test putting a class on HEAD.
|
21
|
-
- Fails on FF.
|
22
|
-
*/
|
23
|
-
body,
|
24
|
-
div,
|
25
|
-
dl,
|
26
|
-
dt,
|
27
|
-
dd,
|
28
|
-
ul,
|
29
|
-
ol,
|
30
|
-
li,
|
31
|
-
h1,
|
32
|
-
h2,
|
33
|
-
h3,
|
34
|
-
h4,
|
35
|
-
h5,
|
36
|
-
h6,
|
37
|
-
pre,
|
38
|
-
code,
|
39
|
-
form,
|
40
|
-
fieldset,
|
41
|
-
legend,
|
42
|
-
input,
|
43
|
-
textarea,
|
44
|
-
p,
|
45
|
-
blockquote,
|
46
|
-
th,
|
47
|
-
td {
|
48
|
-
margin:0;
|
49
|
-
padding:0;
|
50
|
-
}
|
51
|
-
table {
|
52
|
-
border-collapse:collapse;
|
53
|
-
border-spacing:0;
|
54
|
-
}
|
55
|
-
fieldset,
|
56
|
-
img {
|
57
|
-
border:0;
|
58
|
-
}
|
59
|
-
/*
|
60
|
-
TODO think about hanlding inheritence differently, maybe letting IE6 fail a bit...
|
61
|
-
*/
|
62
|
-
address,
|
63
|
-
caption,
|
64
|
-
cite,
|
65
|
-
code,
|
66
|
-
dfn,
|
67
|
-
em,
|
68
|
-
strong,
|
69
|
-
th,
|
70
|
-
var {
|
71
|
-
font-style:normal;
|
72
|
-
font-weight:normal;
|
73
|
-
}
|
74
|
-
/*
|
75
|
-
TODO Figure out where this list-style rule is best set. Hedger has a request to investigate.
|
76
|
-
*/
|
77
|
-
li {
|
78
|
-
list-style:none;
|
79
|
-
}
|
80
|
-
|
81
|
-
caption,
|
82
|
-
th {
|
83
|
-
text-align:left;
|
84
|
-
}
|
85
|
-
h1,
|
86
|
-
h2,
|
87
|
-
h3,
|
88
|
-
h4,
|
89
|
-
h5,
|
90
|
-
h6 {
|
91
|
-
font-size:100%;
|
92
|
-
font-weight:normal;
|
93
|
-
}
|
94
|
-
q:before,
|
95
|
-
q:after {
|
96
|
-
content:'';
|
97
|
-
}
|
98
|
-
abbr,
|
99
|
-
acronym {
|
100
|
-
border:0;
|
101
|
-
font-variant:normal;
|
102
|
-
}
|
103
|
-
/* to preserve line-height and selector appearance */
|
104
|
-
sup {
|
105
|
-
vertical-align:text-top;
|
106
|
-
}
|
107
|
-
sub {
|
108
|
-
vertical-align:text-bottom;
|
109
|
-
}
|
110
|
-
input,
|
111
|
-
textarea,
|
112
|
-
select {
|
113
|
-
font-family:inherit;
|
114
|
-
font-size:inherit;
|
115
|
-
font-weight:inherit;
|
116
|
-
}
|
117
|
-
/*to enable resizing for IE*/
|
118
|
-
input,
|
119
|
-
textarea,
|
120
|
-
select {
|
121
|
-
*font-size:100%;
|
122
|
-
}
|
123
|
-
/*because legend doesn't inherit in IE */
|
124
|
-
legend {
|
125
|
-
color:#000;
|
126
|
-
}
|