diff options
| -rwxr-xr-x | docs/rebuild | 2 | ||||
| -rw-r--r-- | docs/template.tmpl | 5 | ||||
| -rw-r--r-- | docs/web/default-site.css | 27 | ||||
| -rw-r--r-- | docs/web/index.txt | 9 | ||||
| -rw-r--r-- | docs/web/site.js | 68 | ||||
| -rw-r--r-- | docs/web/style.css | 5 | ||||
| -rwxr-xr-x | paste/docsupport/gensite.py | 5 |
7 files changed, 101 insertions, 20 deletions
diff --git a/docs/rebuild b/docs/rebuild index 968b0e7..4be08e0 100755 --- a/docs/rebuild +++ b/docs/rebuild @@ -9,7 +9,7 @@ NORMAL="DeveloperGuidelines Paste servers StyleGuide index web/index \ what-is-paste testing-applications url-parsing-with-wsgi \ roadmap configuration integration web/community/mailing-list web/community/repository web/community/index - web/download/index" + web/download/index web/package_index" DOCTEST_BUILD="blog-tutorial TodoTutorial" for NAME in $NORMAL ; do diff --git a/docs/template.tmpl b/docs/template.tmpl index a6640f2..7f899d3 100644 --- a/docs/template.tmpl +++ b/docs/template.tmpl @@ -1,9 +1,10 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> - <title>Paste</title> + <title>Paste: $title</title> <link rel="stylesheet" type="text/css" href="/default-site.css"> <link rel="stylesheet" type="text/css" href="/style.css"> + <script type="text/javascript" src="/site.js"></script> </head> <body> @@ -30,7 +31,7 @@ <ul> <li><a href="/community/mailing-list.html">Mailing list</a></li> <li><a href="/trac/">Bug tracker</a></li> - <li><a href="/blog/">Weblog</a></li> + <li><a href="/news/">Weblog</a></li> <li><a href="/community/repository.html">Repository</a></li> </ul></li> </ul> diff --git a/docs/web/default-site.css b/docs/web/default-site.css index b0dfb1c..a7819c8 100644 --- a/docs/web/default-site.css +++ b/docs/web/default-site.css @@ -145,18 +145,37 @@ ol.simple, ul.simple { ul.contents li { list-style: none; + margin: 0; + padding: 0; } ul.contents { - float: right; - border: 1px #f70 solid; + position: fixed; + top: 0px; + right: 0px; + background-color: #fd9; + border-left: 1px solid #f70; + border-bottom: 1px solid #f70; + width: 200px; + padding: 0; margin: 0; - padding: 4px; - background-color: #feb; } ul.contents a { + padding: 2px 1em 2px 1em; display: block; + text-decoration: none; + color: #400; +} + +ul.contents a:hover { + background-color: #f80; + color: #fff; +} + +ul.contents li.header { + padding: 5px 1px 3px 0; + font-weight: bold; } ol.arabic { diff --git a/docs/web/index.txt b/docs/web/index.txt index 6786327..ac05668 100644 --- a/docs/web/index.txt +++ b/docs/web/index.txt @@ -1,15 +1,6 @@ Python Paste ++++++++++++ -News -==== - -.. raw:: html - - <div class="news-box"> - <!--#include virtual="/news/index.html" --> - <div> - Introduction ============ diff --git a/docs/web/site.js b/docs/web/site.js new file mode 100644 index 0000000..865b9a6 --- /dev/null +++ b/docs/web/site.js @@ -0,0 +1,68 @@ +function setup_dropdowns() { + var els = document.getElementsByTagName('UL'); + for (var i = 0; i < els.length; i++) { + var el = els[i]; + if (el.className.search(/\bcontents\b/) > -1) { + enable_dropdown(el); + } + } +} + +function enable_dropdown(el) { + var title = el.getElementsByTagName('LI')[0]; + var plus_minus = document.createTextNode(' [-]'); + if (title.childNodes[0].tagName != 'A') { + anchor = document.createElement('A'); + while (title.childNodes.length) { + anchor.appendChild(title.childNodes[0]); + } + anchor.setAttribute('href', '#'); + anchor.style.padding = '1px'; + title.appendChild(anchor); + } else { + anchor = title.childNodes[0]; + } + anchor.appendChild(plus_minus); + function show_hide() { + if (el.sub_hidden) { + set_sub_li(el, ''); + anchor.removeChild(plus_minus); + plus_minus = document.createTextNode(' [-]'); + anchor.appendChild(plus_minus); + } else { + set_sub_li(el, 'none'); + anchor.removeChild(plus_minus); + plus_minus = document.createTextNode(' [+]'); + anchor.appendChild(plus_minus); + } + el.sub_hidden = ! el.sub_hidden; + return false; + } + anchor.onclick = show_hide; +} + +function set_sub_li(list, display) { + var sub = list.getElementsByTagName('LI'); + for (var i = 1; i < sub.length; i++) { + sub[i].style.display = display; + } +} + +function add_onload(func) { + if (window.onload) { + var old_onload = window.onload; + function new_onload() { + old_onload(); + func(); + } + window.onload = new_onload; + } else { + window.onload = func; + } +} + +add_onload(setup_dropdowns); + + + + diff --git a/docs/web/style.css b/docs/web/style.css index fae8db8..c358643 100644 --- a/docs/web/style.css +++ b/docs/web/style.css @@ -39,14 +39,15 @@ div#header h1 { div#nav { float: left; background-color: #fd9; - border-right: 1px solid #f70; + border: 1px solid #f70; margin-right: 1em; border-bottom: 1px solid #f70; + width: 200px; } div#nav ul { padding: 0; - margin: 2px 0 2px 0; + margin: 0; } div#nav li { diff --git a/paste/docsupport/gensite.py b/paste/docsupport/gensite.py index 09124dc..f8bebb9 100755 --- a/paste/docsupport/gensite.py +++ b/paste/docsupport/gensite.py @@ -50,7 +50,7 @@ def gen_site(conf): template.ns.clear() f.update_ns(template.ns) content = str(template) - print 'Writing %s to %s (%i bytes)' % (source, dest, len(content)) + print 'Writing %s (%i bytes)' % (os.path.basename(source), len(content)) dest_dir = os.path.dirname(dest) if not os.path.exists(dest_dir): print 'Creating %s' % dest_dir @@ -112,7 +112,8 @@ class RestFile(object): (re.compile(r'<h1 class="title">.*?</h1>'), ''), (re.compile(r'(<p class=".*?"><a name="contents">.*?</p>)[ \n]*' r'(<ul class="simple">)'), - '<div><ul class="simple contents">'), + '<div><ul class="simple contents">\n' + '<li class="header">Contents</li>\n'), (re.compile(r'(<th class="docinfo-name">Date:</th>[ \n]*)' r'(<td>).*?\((.*?)\)'), r'\1\2\3'), |
