[Commits] python.it commit r194 - in www/trunk: python.it/styles scripts/ht2html

commit a svn.python.it commit a svn.python.it
Dom 16 Lug 2006 18:10:03 CEST


Author: manlio
Date: Sun Jul 16 18:10:02 2006
New Revision: 194

Modified:
   www/trunk/python.it/styles/print.css
   www/trunk/scripts/ht2html/PDONewGenerator.py
Log:
aggiunto supporto CSS per la stampa - Stefano

Modified: www/trunk/python.it/styles/print.css
==============================================================================
--- www/trunk/python.it/styles/print.css	(original)
+++ www/trunk/python.it/styles/print.css	Sun Jul 16 18:10:02 2006
@@ -1,31 +1,79 @@
-#left-hand-navigation, #google, #document-navigation, #border-corner, #smallcorner, #searchcorner, #logo, #search, #utility-menu, #skiptonav
-{
-  display:none;
+/*
+ * Stylesheet for python.org.  This is (mostly) empty for now, since
+ * not all of the site actually references it.  Styles can be added
+ * once more of the HTML on the site includes the relevant <link>
+ * element.
+ *
+ * Documentation for the named classes will be made available at
+ * http://www.python.org/dev/pydotorg/ once this isn't an empty
+ * stylesheet.
+ */
+
+ 
+body {
+	font-family: avantgard, sans-serif;
+	margin: 0;
+	padding: 0;
 }
 
-#content-body
-{
-  font-family: Georgia, "Bitstream Vera Serif", "New York", Palatino, serif;
-  font-size:11pt;
+#page {
+
+} 
+
+#banner {
+	display:none;
 }
 
-#content-body a
-{
-  color: #000000;
-  text-decoration:none;
+#logolink {
+	display:none;
 }
 
-#body-main a
-{
-  font-weight:bold;
+
+#quote {
+	display:none;
+	}
+	
+#sidebar {
+	display:none;
 }
 
-#body-main a:after
-{
-   content: " (" attr(href) ") ";
+#body {
+	display: block;
+	width: 95%;
+	float: left;
+	font-size: 0.9em;
+	font-family: Arial,Verdana,Geneva,"Bitstream Vera Sans",Helvetica,sans-serif;
+	line-height: 1.4em;
 }
 
-h1
-{
-  font-size:14pt;
+#body:after {
+	content: ".";
+	display:block;
+	height: 0;
+	clear:both;
+	visibility: hidden;
+}
+
+#page:after {
+	content: ".";
+	display:block;
+	height: 0;
+	clear:both;
+	visibility: hidden;
+}
+ 
+h1, h2, h3, h4, h5
+{
+	font-family: Georgia,"Bitstream Vera Serif","New York",Palatino,serif;
+	font-weight: normal;
+	font-size: 1.6em;
 }
+
+
+/* This avoids the white border around the page in MSIE. */
+html                 { border: 0px;
+                       margin: 0px;
+                       padding: 0px; }
+
+.continuation        { margin-left: 1em;
+                       margin-right: 1em; }

Modified: www/trunk/scripts/ht2html/PDONewGenerator.py
==============================================================================
--- www/trunk/scripts/ht2html/PDONewGenerator.py	(original)
+++ www/trunk/scripts/ht2html/PDONewGenerator.py	Sun Jul 16 18:10:02 2006
@@ -202,17 +202,31 @@
         # assemble all the style information we have to produce the
         # appropriate LINK and STYLE elements
         stylesheet = self.get_stylesheet()
+        #~ added css reference for print media
+        printsheet = self.get_printsheet()
+        #~ added referce for favicon
+        favicon = self.get_favicon()
         localstyle = self.get_style()
         s = ''
         if stylesheet and stylesheet.strip():
             stylesheet = stylesheet.strip()
             type = self.get_stylesheet_type(stylesheet)
-            s = '<link rel="stylesheet" href="%s" type="%s">' \
+            s = '<link rel="stylesheet" href="%s" type="%s" media="screen">\n' \
                 % (stylesheet, type)
+        #~ added css reference for print media
+        if printsheet and printsheet.strip():
+            printsheet = printsheet.strip()
+            type = self.get_stylesheet_type(printsheet)
+            s = s + '<link rel="stylesheet" href="%s" type="%s" media="print">\n' \
+                %(printsheet, type)
+        if favicon and favicon.strip():
+            favicon = favicon.strip()
+            s = s + '<link rel="shortcut icon" type="image/ico" href="%s" />\n'\
+                %(favicon)
         if localstyle and localstyle.strip():
             localstyle = '<style type="text/css">\n%s\n</style>' \
                          % localstyle.strip()
-            if stylesheet:
+            if stylesheet or printsheet:
                 s = s + "\n" + localstyle
             else:
                 s = localstyle
@@ -419,6 +433,13 @@
     def get_stylesheet(self):
         #~ return posixpath.join('/style.css')
         return posixpath.join(self.__d['rootdir'], 'styles/style.css')
+        
+    def get_printsheet(self):
+        #~ return stylesheet for print media called by SkeletronCSS.__do_style()
+        return posixpath.join(self.__d['rootdir'], 'styles/print.css')
+    def get_favicon(self):
+        #~ return favicon reference
+        return posixpath.join(self.__d['rootdir'], 'styles/favicon.ico')
 
     def get_title(self):
         return self.__parser.get('title')


Maggiori informazioni sulla lista Commits