|
20 | 20 | class HTML extends Generator
|
21 | 21 | {
|
22 | 22 |
|
| 23 | + /** |
| 24 | + * Stylesheet for the HTML output. |
| 25 | + * |
| 26 | + * @var string |
| 27 | + */ |
| 28 | + const STYLESHEET = '<style> |
| 29 | + body { |
| 30 | + background-color: #FFFFFF; |
| 31 | + font-size: 14px; |
| 32 | + font-family: Arial, Helvetica, sans-serif; |
| 33 | + color: #000000; |
| 34 | + } |
| 35 | +
|
| 36 | + h1 { |
| 37 | + color: #666666; |
| 38 | + font-size: 20px; |
| 39 | + font-weight: bold; |
| 40 | + margin-top: 0px; |
| 41 | + background-color: #E6E7E8; |
| 42 | + padding: 20px; |
| 43 | + border: 1px solid #BBBBBB; |
| 44 | + } |
| 45 | +
|
| 46 | + h2 { |
| 47 | + color: #00A5E3; |
| 48 | + font-size: 16px; |
| 49 | + font-weight: normal; |
| 50 | + margin-top: 50px; |
| 51 | + } |
| 52 | +
|
| 53 | + .code-comparison { |
| 54 | + width: 100%; |
| 55 | + } |
| 56 | +
|
| 57 | + .code-comparison td { |
| 58 | + border: 1px solid #CCCCCC; |
| 59 | + } |
| 60 | +
|
| 61 | + .code-comparison-title, .code-comparison-code { |
| 62 | + font-family: Arial, Helvetica, sans-serif; |
| 63 | + font-size: 12px; |
| 64 | + color: #000000; |
| 65 | + vertical-align: top; |
| 66 | + padding: 4px; |
| 67 | + width: 50%; |
| 68 | + background-color: #F1F1F1; |
| 69 | + line-height: 15px; |
| 70 | + } |
| 71 | +
|
| 72 | + .code-comparison-code { |
| 73 | + font-family: Courier; |
| 74 | + background-color: #F9F9F9; |
| 75 | + } |
| 76 | +
|
| 77 | + .code-comparison-highlight { |
| 78 | + background-color: #DDF1F7; |
| 79 | + border: 1px solid #00A5E3; |
| 80 | + line-height: 15px; |
| 81 | + } |
| 82 | +
|
| 83 | + .tag-line { |
| 84 | + text-align: center; |
| 85 | + width: 100%; |
| 86 | + margin-top: 30px; |
| 87 | + font-size: 12px; |
| 88 | + } |
| 89 | +
|
| 90 | + .tag-line a { |
| 91 | + color: #000000; |
| 92 | + } |
| 93 | + </style>'; |
| 94 | + |
23 | 95 |
|
24 | 96 | /**
|
25 | 97 | * Generates the documentation for a standard.
|
@@ -61,72 +133,7 @@ protected function printHeader()
|
61 | 133 | echo '<html>'.PHP_EOL;
|
62 | 134 | echo ' <head>'.PHP_EOL;
|
63 | 135 | echo " <title>$standard Coding Standards</title>".PHP_EOL;
|
64 |
| - echo ' <style> |
65 |
| - body { |
66 |
| - background-color: #FFFFFF; |
67 |
| - font-size: 14px; |
68 |
| - font-family: Arial, Helvetica, sans-serif; |
69 |
| - color: #000000; |
70 |
| - } |
71 |
| -
|
72 |
| - h1 { |
73 |
| - color: #666666; |
74 |
| - font-size: 20px; |
75 |
| - font-weight: bold; |
76 |
| - margin-top: 0px; |
77 |
| - background-color: #E6E7E8; |
78 |
| - padding: 20px; |
79 |
| - border: 1px solid #BBBBBB; |
80 |
| - } |
81 |
| -
|
82 |
| - h2 { |
83 |
| - color: #00A5E3; |
84 |
| - font-size: 16px; |
85 |
| - font-weight: normal; |
86 |
| - margin-top: 50px; |
87 |
| - } |
88 |
| -
|
89 |
| - .code-comparison { |
90 |
| - width: 100%; |
91 |
| - } |
92 |
| -
|
93 |
| - .code-comparison td { |
94 |
| - border: 1px solid #CCCCCC; |
95 |
| - } |
96 |
| -
|
97 |
| - .code-comparison-title, .code-comparison-code { |
98 |
| - font-family: Arial, Helvetica, sans-serif; |
99 |
| - font-size: 12px; |
100 |
| - color: #000000; |
101 |
| - vertical-align: top; |
102 |
| - padding: 4px; |
103 |
| - width: 50%; |
104 |
| - background-color: #F1F1F1; |
105 |
| - line-height: 15px; |
106 |
| - } |
107 |
| -
|
108 |
| - .code-comparison-code { |
109 |
| - font-family: Courier; |
110 |
| - background-color: #F9F9F9; |
111 |
| - } |
112 |
| -
|
113 |
| - .code-comparison-highlight { |
114 |
| - background-color: #DDF1F7; |
115 |
| - border: 1px solid #00A5E3; |
116 |
| - line-height: 15px; |
117 |
| - } |
118 |
| -
|
119 |
| - .tag-line { |
120 |
| - text-align: center; |
121 |
| - width: 100%; |
122 |
| - margin-top: 30px; |
123 |
| - font-size: 12px; |
124 |
| - } |
125 |
| -
|
126 |
| - .tag-line a { |
127 |
| - color: #000000; |
128 |
| - } |
129 |
| - </style>'.PHP_EOL; |
| 136 | + echo ' '.self::STYLESHEET.PHP_EOL; |
130 | 137 | echo ' </head>'.PHP_EOL;
|
131 | 138 | echo ' <body>'.PHP_EOL;
|
132 | 139 | echo " <h1>$standard Coding Standards</h1>".PHP_EOL;
|
|
0 commit comments