[Lxml-checkins] r39352 - in lxml/trunk/doc: . html
scoder at codespeak.net
scoder at codespeak.net
Sat Feb 24 08:15:19 CET 2007
Author: scoder
Date: Sat Feb 24 08:15:18 2007
New Revision: 39352
Modified:
lxml/trunk/doc/html/style.css
lxml/trunk/doc/mkhtml.py
Log:
separated page TOC and side menu
Modified: lxml/trunk/doc/html/style.css
==============================================================================
--- lxml/trunk/doc/html/style.css (original)
+++ lxml/trunk/doc/html/style.css Sat Feb 24 08:15:18 2007
@@ -15,46 +15,53 @@
text-align: left;
}
-/*** menu ***/
+/*** TOC ***/
-div.contents {
+div.contents.topic > ul {
+ margin-top: 0px;
+}
+
+div.contents.topic > ul > li {
+ line-height: 1.1em;
+}
+
+/*** side menu ***/
+
+div.sidemenu {
position: fixed;
top: 0px;
left: 0px;
width: 20em;
+ font-size: 11px;
text-align: left;
border-right: solid gray;
border-bottom: solid gray;
padding-right: 1ex;
}
-div.contents span.section.title {
+div.sidemenu span.section.title {
line-height: 1.5em;
font-size: 130%;
}
-div.contents ul.submenu.current {
+div.sidemenu ul.submenu.current {
display: block;
}
-div.contents li.menu:hover ul.submenu {
+div.sidemenu li.menu:hover ul.submenu {
display: block;
}
-div.contents ul.submenu {
+div.sidemenu ul.submenu {
display: none;
}
-div.contents ul {
+div.sidemenu ul {
line-height: 1em;
margin: 1ex;
padding-left: 1em;
}
-div.contents p.topic-title.first {
- display: none;
-}
-
/*** headings ***/
h1.title {
Modified: lxml/trunk/doc/mkhtml.py
==============================================================================
--- lxml/trunk/doc/mkhtml.py (original)
+++ lxml/trunk/doc/mkhtml.py Sat Feb 24 08:15:18 2007
@@ -19,8 +19,6 @@
{"h" : "http://www.w3.org/1999/xhtml"})
find_headings = XPath("//h:h1[not(@class)]/h:a/text()",
{"h" : "http://www.w3.org/1999/xhtml"})
-find_toc = XPath("//h:div[@class='contents topic']",
- {"h" : "http://www.w3.org/1999/xhtml"})
find_submenu = XPath("//h:ul[@id=$name]//h:ul[@class='submenu']",
{"h" : "http://www.w3.org/1999/xhtml"})
@@ -56,20 +54,16 @@
a.text = heading
def merge_menu(tree, menu, name):
- toc = find_toc(tree)
- if toc:
- menu_root = copy.deepcopy(menu)
- toc[0][:] = [menu_root]
- for el in menu_root.getiterator():
- tag = el.tag
- if tag[0] != '{':
- el.tag = "{http://www.w3.org/1999/xhtml}" + tag
- current_submenu = find_submenu(menu_root, name=name)
- if current_submenu:
- for submenu in current_submenu:
- submenu.set("class", submenu.get("class", "") + " current")
- else:
- print "No menu found in", name
+ menu_root = copy.deepcopy(menu)
+ tree.getroot()[1][0].append(menu_root) # html->body->div[class=document]
+ for el in menu_root.getiterator():
+ tag = el.tag
+ if tag[0] != '{':
+ el.tag = "{http://www.w3.org/1999/xhtml}" + tag
+ current_submenu = find_submenu(menu_root, name=name)
+ if current_submenu:
+ for submenu in current_submenu:
+ submenu.set("class", submenu.get("class", "") + " current")
return tree
def rest2html(script, source_path, dest_path, stylesheet_url):
@@ -90,7 +84,7 @@
shutil.copy(pubkey, dirname)
trees = {}
- menu = Element("div", {"class":"menu"})
+ menu = Element("div", {"class":"sidemenu"})
# build HTML pages and parse them back
for section, text_files in SITE_STRUCTURE:
for filename in text_files:
More information about the lxml-checkins
mailing list