]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add CSS to all HTML documentation pages
authorJohn Mandereau <john.mandereau@gmail.com>
Fri, 12 Sep 2008 22:07:19 +0000 (00:07 +0200)
committerJohn Mandereau <john.mandereau@gmail.com>
Fri, 12 Sep 2008 22:38:59 +0000 (00:38 +0200)
* move some CSS from documentation index to lilypond.css,

* move HTML footer style to lilypond.css,

* use lilypond.css in all HTML documentation pages,

* add *.css as EXTRA_DIST_FILES in all directories using stepmake
template 'documentation'.

Documentation/GNUmakefile
Documentation/index.html.in
Documentation/lilypond.css
buildscripts/postprocess_html.py
stepmake/stepmake/documentation-vars.make

index 34444c5ee1146de3019a68d49528e5e9e309a88d..47c2b0a074eac36b2ed41e0c8acd45a0df0b5d11 100644 (file)
@@ -7,12 +7,13 @@ STEPMAKE_TEMPLATES=documentation texinfo tex
 LOCALSTEPMAKE_TEMPLATES=lilypond ly
 LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"'
 README_TOP_FILES= DEDICATION THANKS
-EXTRA_DIST_FILES= texinfo.css lilypond.css lilypond-ie-fixes.css TRANSLATION
+EXTRA_DIST_FILES= TRANSLATION
 
 include $(depth)/make/stepmake.make
 
 HTML_PAGE_NAMES= index devel translations
 OUT_HTML_FILES= $(HTML_PAGE_NAMES:%=$(outdir)/%.html)
+OUT_CSS_FILES= $(CSS_FILES:%.css=$(outdir)/%.css)
 
 default: local-doc
 
@@ -30,6 +31,11 @@ txt-to-html:
        $(foreach a, $(README_TOP_FILES), cp $(top-src-dir)/$(a) $(outdir)/$(a).txt && ) true
        $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
 
+$(OUT_HTML_FILES): $(OUT_CSS_FILES)
+
+$(outdir)/%.css: %.css
+       ln -f $< $@
+
 po-update:
        make -C po po-update
 
index 3e8439017b975355ab5e793b9706d4b012c4bfb6..f93f34d4c3ec35a6c6dfb5141fcdd290240f429b 100644 (file)
           content="Top-level index to the standard documentation for
                    LilyPond @TOPLEVEL_VERSION@">
     <style type="text/css">
-    .navigation         { background-color: #e8ffe8;
-                         padding: 2; border: #c0ffc0 1px solid;
-                         text-align: center;
-                          font-weight: bold;
-                          font-family: avantgarde, sans-serif;
-                          font-size: 110%; }
       a.title { font-weight: bold; font-size: 110%; }
       ul { margin-left: 1em; padding: 0pt; border: 0pt; }
       ul li { margin-top: 0.2em; }
       td.left-column { padding-right: 1em; }
       td.right-column { padding-left: 1em; }
-      hr { border:0; height:1; color: #000000; background-color: #000000; }
     </style> 
   </head>
   
   <body>
-        
-       <div class="navigation">
-         <h1>LilyPond documentation</h1>
-       </div>
-    <div align="center" class="titlepage">
+    <div class="header">
+      <h1 class="header">LilyPond documentation</h1>
+    </div>
 
+    <div align="center">
       <p>
        <strong>Version @TOPLEVEL_VERSION@</strong>
        <br>
index 6ceede90be610ebfe75153c547e4cc23ae8af4d0..802580d4724d3fb438b2b29edd12c37538a4ce52 100644 (file)
@@ -11,29 +11,24 @@ body {
   padding: 0;
   height: 100%;
   font-size: 100%;
-  font-family: "Century Schoolbook L", Georgia, serif;
   margin-right: auto;
   margin-left: auto;
+  color: black;
+  background-color: white;
 }
 
 /***********************************************************/
 /*                      HEADERS                            */
 /***********************************************************/
-h4 {
+h4, h3, h2, .unnumberedsubsubsec, .subsubheading {
   color: #151959;
 }
 
-h3 {
-    color: #151959;
-}
-
 h2 {
   font-size: x-large;
-  color: #151959;
 }
 .unnumberedsubsubsec, .subsubheading {
   font-size: large;
-  color: #151959;
 }
 
 /***********************************************************/
@@ -41,13 +36,13 @@ h2 {
 /***********************************************************/
 a:link, a:visited, a:hover, a:active {color:#2E5479; text-decoration: none;}
 a:hover {text-decoration: underline;}
-a:active {color:#CCF;}
+a:active {color:#CCCCFF;}
 
 /***********************************************************/
 /*                  BLOCK FORMATTING                       */
 /***********************************************************/
 blockquote {
-  border: 1px solid #cccccc;
+  border: 1px solid #CCCCCC;
   padding: 3px;
   width: 40em;
 }
@@ -61,7 +56,7 @@ hr {
   background-color: #666666;
 }
 table.cartouche {
-  border: 2px dotted #cccccc;
+  border: 2px dotted #CCCCCC;
   margin-left: auto;
   margin-right: auto;
   width: 85%;
@@ -166,6 +161,19 @@ li.toc_current ul {
 /*                     NAVIGATION                          */
 /***********************************************************/
 
+div.header {
+  background-color: #E8FFE8;
+  padding: 2;
+  border: #C0FFC0 1px solid;
+  text-align: center;
+}
+
+h1.header {
+  font-weight: bold;
+  font-family: avantgarde, sans-serif;
+  font-size: 220%;
+}
+
 .nav_table {
   width: 100%;
   background-color: #CCD3CC;
@@ -176,17 +184,21 @@ li.toc_current ul {
   font-size: 0.8em;
 }
 
-
-
+.footer {
+  background-color: #E8FFE8;
+  padding: 5;
+  border: #C0FFC0 1px solid;
+  font-size: 80%;
+}
 
 
 
 /***********************************************************/
-/*               OVERRIDES FOR PRINTING...                 */
+/*               OVERRIDES FOR PRINTING                    */
 /***********************************************************/
 @media print {
   /* Hide the sidebar: */
   body { padding-left: 0; }
   #tocframe { display: none; }
   .nav_table { display: none; }
-}
\ No newline at end of file
+}
index cc2e6fe3fd10985eafe609efc37ad383fe2a2ad7..bebf28fa747c2f5f2831c71c5524cf81d1943884 100644 (file)
@@ -33,16 +33,15 @@ header = r"""
 """
 
 footer = '''
-<div style="background-color: #e8ffe8; padding: 2; border: #c0ffc0 1px solid;">
+<div class="footer">
 <p>
-<font size="-1">
 %(footer_name_version)s
 <br>
 <address>
 %(footer_report_errors)s </address>
 <br>
 %(footer_suggest_docs)s
-</font>
+<br>
 </p>
 </div>
 '''
@@ -127,11 +126,14 @@ body_tag_re = re.compile ('(?i)<body([^>]*)>')
 html_tag_re = re.compile ('(?i)<html>')
 doctype_re = re.compile ('(?i)<!DOCTYPE')
 doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n'
+css_re = re.compile ('(?i)<link rel="stylesheet" type="text/css" href="[^">]*?lilypond.css">')
+end_head_tag_re = re.compile ('(?i)</head>')
+css_link = '<link rel="stylesheet" type="text/css" href="%sDocumentation/lilypond.css">\n'
 
-def add_header (s):
-    """Add header (<body> and doctype)"""
+def add_header (s, prefix):
+    """Add header (<body>, doctype and CSS)"""
     if header_tag_re.search (s) == None:
-        body = '<body bgcolor="white" text="black" \\1>'
+        body = '<body\\1>'
         (s, n) = body_tag_re.subn (body + header, s, 1)
         if not n:
             (s, n) = html_tag_re.subn ('<html>' + header, s, 1)
@@ -142,6 +144,10 @@ def add_header (s):
 
         if doctype_re.search (s) == None:
             s = doctype + s
+
+        if css_re.search (s) == None:
+            depth = (prefix.count ('/') - 1) * '../'
+            s = end_head_tag_re.sub ((css_link % depth) + '</head>', s)
         return s
 
 title_tag_re = re.compile ('.*?<title>(.*?)</title>', re.DOTALL)
@@ -315,7 +321,7 @@ def process_html_files (package_name = '',
 
             s = s.replace ('%', '%%')
             s = hack_urls (s, prefix)
-            s = add_header (s)
+            s = add_header (s, prefix)
 
             ### add footer
             if footer_tag_re.search (s) == None:
index 733252a047f09aa906e2d5cf4d95e736b5bd633d..9f6b5148a1cfc7838bcfd8a2661b85311b4d9201 100644 (file)
@@ -1,4 +1,5 @@
 at-dir = $(doc-dir)/
 at-ext = .in
 
-
+CSS_FILES := $(call src-wildcard,*.css)
+EXTRA_DIST_FILES += $(CSS_FILES)