From: John Mandereau Date: Fri, 12 Sep 2008 22:07:19 +0000 (+0200) Subject: Add CSS to all HTML documentation pages X-Git-Tag: release/2.11.59-1~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=687173a43f2d34e39c93500f60dbe40f48e5c7b1;p=lilypond.git Add CSS to all HTML documentation pages * 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'. --- diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 34444c5ee1..47c2b0a074 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -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 diff --git a/Documentation/index.html.in b/Documentation/index.html.in index 3e8439017b..f93f34d4c3 100644 --- a/Documentation/index.html.in +++ b/Documentation/index.html.in @@ -13,28 +13,20 @@ content="Top-level index to the standard documentation for LilyPond @TOPLEVEL_VERSION@"> - - -
+
+

LilyPond documentation

+
+

Version @TOPLEVEL_VERSION@
diff --git a/Documentation/lilypond.css b/Documentation/lilypond.css index 6ceede90be..802580d472 100644 --- a/Documentation/lilypond.css +++ b/Documentation/lilypond.css @@ -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 +} diff --git a/buildscripts/postprocess_html.py b/buildscripts/postprocess_html.py index cc2e6fe3fd..bebf28fa74 100644 --- a/buildscripts/postprocess_html.py +++ b/buildscripts/postprocess_html.py @@ -33,16 +33,15 @@ header = r""" """ footer = ''' -

+ ''' @@ -127,11 +126,14 @@ body_tag_re = re.compile ('(?i)]*)>') html_tag_re = re.compile ('(?i)') doctype_re = re.compile ('(?i)\n' +css_re = re.compile ('(?i)]*?lilypond.css">') +end_head_tag_re = re.compile ('(?i)') +css_link = '\n' -def add_header (s): - """Add header ( and doctype)""" +def add_header (s, prefix): + """Add header (, doctype and CSS)""" if header_tag_re.search (s) == None: - body = '' + body = '' (s, n) = body_tag_re.subn (body + header, s, 1) if not n: (s, n) = html_tag_re.subn ('' + 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) + '', s) return s title_tag_re = re.compile ('.*?(.*?)', 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: diff --git a/stepmake/stepmake/documentation-vars.make b/stepmake/stepmake/documentation-vars.make index 733252a047..9f6b5148a1 100644 --- a/stepmake/stepmake/documentation-vars.make +++ b/stepmake/stepmake/documentation-vars.make @@ -1,4 +1,5 @@ at-dir = $(doc-dir)/ at-ext = .in - +CSS_FILES := $(call src-wildcard,*.css) +EXTRA_DIST_FILES += $(CSS_FILES)