diff options
Diffstat (limited to 'doc/build/components')
-rw-r--r-- | doc/build/components/autohandler | 5 | ||||
-rw-r--r-- | doc/build/components/base.myt | 38 | ||||
-rw-r--r-- | doc/build/components/content_layout.myt | 15 | ||||
-rw-r--r-- | doc/build/components/doclib.myt | 187 | ||||
-rw-r--r-- | doc/build/components/formatting.myt | 261 | ||||
-rw-r--r-- | doc/build/components/index.myt | 2 | ||||
-rw-r--r-- | doc/build/components/nav.myt | 106 | ||||
-rw-r--r-- | doc/build/components/printsection.myt | 155 | ||||
-rw-r--r-- | doc/build/components/pydoc.myt | 60 | ||||
-rw-r--r-- | doc/build/components/section_wrapper.myt | 42 | ||||
-rw-r--r-- | doc/build/components/toc.myt | 95 |
11 files changed, 317 insertions, 649 deletions
diff --git a/doc/build/components/autohandler b/doc/build/components/autohandler index 38f964fcb..223b7ff61 100644 --- a/doc/build/components/autohandler +++ b/doc/build/components/autohandler @@ -2,6 +2,11 @@ <html> <head> <title><& REQUEST:title &></title> + <link href="style.css" rel="stylesheet" type="text/css"></link> + <link href="syntaxhighlight.css" rel="stylesheet" type="text/css"></link> + + <link href="docs.css" rel="stylesheet" type="text/css"></link> + <script src="scripts.js"></script> </head> <body> diff --git a/doc/build/components/base.myt b/doc/build/components/base.myt new file mode 100644 index 000000000..7d6e7bae6 --- /dev/null +++ b/doc/build/components/base.myt @@ -0,0 +1,38 @@ +<%doc>base.myt - common to all documentation pages. intentionally separate from autohandler, which can be swapped +out for a different one</%doc> +<%args> + extension="myt" +</%args> +<%python scope="init"> + if m.cache_self(key=m.request_component.file): + return + # bootstrap TOC structure from request args, or pickled file if not present. + import cPickle as pickle + import os, time + m.log("base.myt generating from table of contents for file %s" % m.request_component.file) + toc = m.request_args.get('toc') + if toc is None: + filename = os.path.join(os.path.dirname(m.request_component.file), 'table_of_contents.pickle') + toc = pickle.load(file(filename)) + version = toc.version + last_updated = toc.last_updated +</%python> +<%method title> + <% m.request_component.attributes.get('title') %> +</%method> + +<div style="position:absolute;left:0px;top:0px;"><a name="top"></a> </div> + +<div class="doccontainer"> + +<div class="docheader"> + +<h1><% toc.root.doctitle %></h1> +<div class="">Version: <% version %> Last Updated: <% time.strftime('%x %X', time.localtime(last_updated)) %></div> +</div> + +% m.call_next(toc=toc, extension=extension) + +</div> + + diff --git a/doc/build/components/content_layout.myt b/doc/build/components/content_layout.myt new file mode 100644 index 000000000..c44a6f38d --- /dev/null +++ b/doc/build/components/content_layout.myt @@ -0,0 +1,15 @@ +<%doc>defines the default layout for normal documentation pages (not including the index)</%doc> +<%args> + extension="myt" + toc +</%args> +<%flags>inherit="base.myt"</%flags> +<%init> + current = toc.get_by_file(m.request_component.attributes['filename']) +</%init> + +<A name="<% current.path %>"></a> +<& nav.myt:topnav, item=current, extension=extension &> +<div class="sectioncontent"> +% m.call_next(toc=toc, extension=extension) +</div> diff --git a/doc/build/components/doclib.myt b/doc/build/components/doclib.myt deleted file mode 100644 index 12efa1dab..000000000 --- a/doc/build/components/doclib.myt +++ /dev/null @@ -1,187 +0,0 @@ - -<%python scope="global"> -import sys, string, re - -# datastructure that will store the whole contents of the documentation -class TOCElement: - def __init__(self, filename, name, description, parent = None, ext = None, header = None, last_updated = 0, htmldescription=None, altlink=None): - self.filename = filename - self.name = name - self.parent = parent - self.path = self._create_path() - self.header = header - self.altlink = altlink - if self.parent is not None: - self.root = parent.root - self.root.pathlookup[self.path] = self - - if self.parent.filename != self.filename: - self.root.filelookup[self.filename] = self - self.isTop = True - else: - self.root = self - self.pathlookup = {} - self.pathlookup[''] = self - self.filelookup = {} - self.filelookup[filename] = self - - if ext is not None: - self.ext = ext - else: - self.ext = self.root.ext - - self.last_updated = last_updated - self.description = description - self.htmldescription = htmldescription - self.content = None - self.previous = None - self.next = None - self.children = [] - if parent: - if len(parent.children): - self.previous = parent.children[-1] - parent.children[-1].next = self - parent.children.append(self) - if last_updated > parent.last_updated: - parent.last_updated = self.last_updated - - def get_file(self, name): - name = re.sub("\.\w+$", "", name) - return self.root.filelookup[name] - - def lookup(self, path): - return self.root.pathlookup[path] - - def get_link(self, includefile = True, anchor = True): - if includefile: - if anchor: - return "%s%s#%s" % (self.filename, self.ext, self.path) - else: - return "%s%s" % (self.filename, self.ext) - else: - if anchor: - return "#" + self.path - else: - return "" - - - def _create_path(self): - elem = self - tokens = [] - while elem.parent is not None: - tokens.insert(0, elem.name) - elem = elem.parent - path = string.join(tokens, '_') - return path - - - -</%python> - -<%python scope="request"> - current = Value() - filename = Value() -</%python> - - -<%args scope="request"> - paged = 'yes' -</%args> - -<%python scope="init"> - - try: - a = r - isdynamic = True - ext = ".myt" - except: - isdynamic = False - ext = ".html" - - request_comp = m.request_comp() - - if isdynamic and not m.interpreter.attributes.get('docs_static_cache', False): - page_cache = True - else: - page_cache = False - - # for dynamic page, cache the output of the final page - - if page_cache: - if m.cache_self(key="doc_%s" % paged, component = request_comp): - return - - list_comp = m.fetch_next() - files = request_comp.attributes['files'] - title = request_comp.attributes.setdefault('title', "Documentation") - version = request_comp.attributes['version'] - wrapper = request_comp.attributes['wrapper'] - index = request_comp.attributes['index'] - onepage = request_comp.attributes['onepage'] - - - - def buildtoc(): - root = TOCElement("", "root", "root element", ext = ext) - current.assign(root) - - for file in files: - filename.assign(file) - comp = m.fetch_component(file + ".myt") - - main = m.scomp(comp) - - return root - - if not page_cache: - # non-dynamic (i.e. command-line) page, cache the datastructure so successive - # pages are fast (disables auto-recompiling) - cache = m.get_cache(list_comp) - - toc = cache.get_value('toc', createfunc = buildtoc) - - else: - toc = buildtoc() - - last_updated = toc.last_updated - m.comp(wrapper, isdynamic=isdynamic, ext = ext, toc = toc, comp = request_comp, onepage = onepage, paged = paged, title = title, version = version, index=index, last_updated = last_updated) - -</%python> - -<%method title> -<% m.request_comp().get_attribute('title', inherit = True) or "Documentation" %> -</%method> - -<%method item> - <%doc>stores an item in the table of contents</%doc> - <%args> - # name should be a URL friendly name used for hyperlinking the section - name - - # description is the heading for the item - description - - htmldescription = None - escapedesc = False - - header = None - altlink=None - </%args> - <%python scope="init"> - if escapedesc: - description = m.apply_escapes(description, ['h']) - - current(TOCElement(filename(), name, description, current(), header = header, last_updated = m.caller.component_source.last_modified, htmldescription=htmldescription, altlink=altlink)) - current().content = m.content() - current(current().parent) - </%python></%method> - - -<%method current> -<%init>return current()</%init> -</%method> - - - - - diff --git a/doc/build/components/formatting.myt b/doc/build/components/formatting.myt index ee9fb3958..da1c81df0 100644 --- a/doc/build/components/formatting.myt +++ b/doc/build/components/formatting.myt @@ -1,196 +1,53 @@ -<%doc>formatting.myt - library of HTML formatting functions to operate on a TOCElement tree</%doc> +<%doc>formatting.myt - Provides section formatting elements, syntax-highlighted code blocks, and other special filters.</%doc> <%global> import string, re import highlight </%global> - -<%method printtoc> -<%args> - root - includefile - current = None - full = False - children = True -</%args> - -% header = False -<ul class="toc_list"> -% for i in root.children: - -% if i.header: -% if header: - </ul> -% -% header = True - <h3><% i.header %></h3> - <ul class="toc_list"> -% - <& printtocelement, item=i, includefile = includefile, bold = (i == current and includefile), full = full, children=children &> -% - -</ul> -</%method> - -<%def printtocelement> -<%doc>prints a TOCElement as a table of contents item and prints its immediate child items</%doc> - <%args> - item - includefile - bold = False - full = False - children = True - </%args> - - <li><A style="<% bold and "font-weight:bold;" or "" %>" href="<% item.get_link(includefile, anchor = (not includefile)) %>"><% item.description %></a></li> - -% if children: - <ul class="small_toc_list"> -% for i in item.children: - <& printsmtocelem, item=i, includefile = includefile, children=full &> -% - </ul> -% -</%def> - -<%def printsmtocelem> - <%args> - item - includefile - children = False - </%args> - <li><A href="<% item.get_link(includefile) %>"><% item.description %></a></li> - -% if children: - <ul class="small_toc_list"> -% for i in item.children: - <& printsmtocelem, item = i, includefile = includefile &> -% - </ul> -% - -</%def> - - - -<%method printitem> -<%doc>prints the description and contents of a TOC element and recursively prints its child items</%doc> - +<%method section> +<%doc>Main section formatting element.</%doc> <%args> - item - indentlevel = 0 - includefile - omitheader = False - root = None + toc + path + description=None </%args> +<%init> + item = toc.get_by_path(path) + if item is None: + raise "path: " + path +</%init> -% if root is None: root = item - -% if not omitheader: <A name="<% item.path %>"></a> -% if item.altlink: -<A name="<% item.altlink %>"></a> -% -% - -<div class="subsection" style="margin-left:<% repr(10 + indentlevel * 10) %>px;"> +<div class="subsection" style="margin-left:<% repr(item.depth * 10) %>px;"> <%python> - regexp = re.compile(r"__FORMAT:LINK{(?:\@path=(.+?))?(?:\@xtra=(.+?))?(?:\@text=(.+?))?(?:\@href=(.+?))?(?:\@class=(.+?))?}") - def link(matchobj): - path = matchobj.group(1) - xtra = matchobj.group(2) - text = matchobj.group(3) - href = matchobj.group(4) - class_ = matchobj.group(5) - - if class_ is not None: - class_ = 'class="%s"' % class_ - else: - class_ = '' - - if href: - return '<a href="%s" %s>%s</a>' % (href, class_, text or href) - else: - try: - element = item.lookup(path) - if xtra is not None: - return '<a href="%s_%s" %s>%s</a>' % (element.get_link(includefile), xtra, class_, text or xtra) - else: - return '<a href="%s" %s>%s</a>' % (element.get_link(includefile), class_, text or element.description) - except KeyError: - if xtra is not None: - return '<b>%s</b>' % (text or xtra) - else: - return '<b>%s</b>' % text or path - + content = m.content() re2 = re.compile(r"'''PYESC(.+?)PYESC'''", re.S) - content = regexp.sub(link, item.content) content = re2.sub(lambda m: m.group(1), content) - description = regexp.sub(link, item.htmldescription or item.description) </%python> -% if not omitheader: - <h3><% description %></h3> +% if item.depth > 1: +<h3><% description or item.description %></h3> % - <div class="sectiontext"> - -<%python> - #m.write(item.content) - m.write(content) -</%python> + <div class="sectiontext"> + <% content %> </div> -% for i in item.children: - <& printitem, item=i, indentlevel=indentlevel + 1, includefile = includefile, root=root &> -% - -% if root is not None and len(item.children) == 0: - <a href="#<% root.path %>" class="toclink">back to section top</a> +% if item.depth > 1: +% if (item.next and item.next.depth >= item.depth): + <a href="#<% item.get_page_root().path %>" class="toclink">back to section top</a> % - -% if indentlevel == 0: -% if includefile: - <& SELF:pagenav, item=item, includefile=includefile &> -% else: - <hr width="400px" align="left" /> -% # +% else: + <a href="#<% item.get_page_root().path %>" class="toclink">back to section top</a> + <& nav.myt:pagenav, item=item &> % - </div> </%method> -<%method pagenav> -<%args> - item - includefile -</%args> -<div class="sectionnavblock"> -<div class="sectionnav"> - -% if not includefile: - <a href="#top">Top</a> | -% - -% if item.previous is not None: - Previous: <& SELF:itemlink, item=item.previous, includefile = includefile &> -% # end if - -% if item.next is not None: -% if item.previous is not None: - | -% # end if - - Next: <& SELF:itemlink, item=item.next, includefile = includefile &> -% # end if - -</div> -</div> -</%method> <%method formatplain> <%filter> @@ -202,58 +59,8 @@ <% m.content() | h%> </%method> -<%method itemlink trim="both"> - <%args> - item - includefile - </%args> - <a href="<% item.get_link(includefile, anchor = (not includefile)) %>"><% item.description %></a> -</%method> - -<%method paramtable> - <table cellspacing="0" cellpadding="0" width="100%"> - <% m.content() %> - </table> -</%method> - -<%method member_doc> - <%args> - name = "" - link = "" - type = None - </%args> - <tr> - <td> - <div class="darkcell"> - <A name="<% m.comp('doclib.myt:current').path %>_<% link %>"></a> - <b><% name %></b> - <div class="docstring"><% m.content() %></div> - </div> - </td> - </tr> -</%method> - - -<%method function_doc> - <%args> - name = "" - link = "" - alt = None - arglist = [] - rettype = None - </%args> - <tr> - <td> - <div class="darkcell"> - <A name="<% m.comp('doclib.myt:current').path %>_<% link %>"></a> - <b><% name %>(<% string.join(map(lambda k: "<i>%s</i>" % k, arglist), ", ")%>)</b> - <div class="docstring"><% m.content() %></div> - </div> - </td> - </tr> -</%method> <%method codeline trim="both"> <span class="codeline"><% m.content() %></span> @@ -300,24 +107,8 @@ <% content %></div> </%method> -<%method link trim="both"> - <%args> - path = None - param = None - method = None - member = None - text = None - href = None - class_ = None - </%args> - <%init> - if href is None and path is None: - path = m.comp('doclib.myt:current').path - - extra = (param or method or member) - </%init> -__FORMAT:LINK{<% path and "@path=" + path or "" %><% extra and "@xtra=" + extra or "" %><% text and "@text=" + text or "" %><% href and "@href=" + href or "" %><% class_ and "@class=" + class_ or "" %>} -</%method> + + <%method popboxlink trim="both"> <%args> @@ -354,7 +145,7 @@ javascript:togglePopbox('<% name %>', '<% show %>', '<% hide %>') <%init> href = m.scomp('SELF:popboxlink') </%init> - '''PYESC<& SELF:link, href=href, text=link, class_="codepoplink" &>PYESC''' + '''PYESC<& nav.myt:link, href=href, text=link, class_="codepoplink" &>PYESC''' </%method> <%method codepopper trim="both"> diff --git a/doc/build/components/index.myt b/doc/build/components/index.myt deleted file mode 100644 index c55dfc2de..000000000 --- a/doc/build/components/index.myt +++ /dev/null @@ -1,2 +0,0 @@ -<%flags>inherit="document_base.myt"</%flags> - diff --git a/doc/build/components/nav.myt b/doc/build/components/nav.myt new file mode 100644 index 000000000..a045df8ce --- /dev/null +++ b/doc/build/components/nav.myt @@ -0,0 +1,106 @@ +<%doc>nav.myt - Provides page navigation elements that are derived from toc.TOCElement structures, including +individual hyperlinks as well as navigational toolbars and table-of-content listings.</%doc> + +<%method itemlink trim="both"> + <%args> + item + anchor=True + </%args> + <%args scope="request"> + extension='myt' + </%args> + <a href="<% item.get_link(extension=extension, anchor=anchor) %>"><% item.description %></a> +</%method> + +<%method toclink trim="both"> + <%args> + toc + path + description=None + extension + </%args> + <%init> + item = toc.get_by_path(path) + if description is None: + if item: + description = item.description + else: + description = path + </%init> +% if item: + <a href="<% item.get_link(extension=extension) %>"><% description %></a> +% else: + <b><% description %></b> +% +</%method> + + +<%method link trim="both"> + <%args> + href + text + class_ + </%args> + <a href="<% href %>" <% class_ and (('class=\"%s\"' % class_) or '')%>><% text %></a> +</%method> + +<%method topnav> + <%args> + item + extension + </%args> +<div class="topnav"> + +<div class="topnavsectionlink"> + +<a href="index.<% extension %>">Table of Contents</a> + +<div class="prevnext"> +% if item.previous is not None: +Previous: <& itemlink, item=item.previous, anchor=False &> +% + +% if item.previous is not None and item.next is not None: + | +% + +% if item.next is not None: + +Next: <& itemlink, item=item.next, anchor=False &> +% + +</div> +</div> + +<div class="topnavmain"> + <div class="topnavheader"><% item.description %></div> + <div class="topnavitems"> + <& toc.myt:printtoc, root=item, current=None, full=True, extension=extension, anchor_toplevel=True &> + </div> +</div> + +</div> +</%method> + +<%method pagenav> +<%args> + item +</%args> +<div class="sectionnavblock"> +<div class="sectionnav"> + +% if item.previous is not None: + Previous: <& itemlink, item=item.previous &> +% # end if + +% if item.next is not None: +% if item.previous is not None: + | +% # end if + + Next: <& itemlink, item=item.next &> +% # end if + +</div> +</div> +</%method> diff --git a/doc/build/components/printsection.myt b/doc/build/components/printsection.myt deleted file mode 100644 index cd5a26ff3..000000000 --- a/doc/build/components/printsection.myt +++ /dev/null @@ -1,155 +0,0 @@ -<%args> - toc - paged - comp - isdynamic - index - ext - onepage -</%args> - -<%python scope="init"> - # get the item being requested by this embedded component from the documentation tree - try: - current = toc.get_file(comp.get_name()) - except KeyError: - current = None -</%python> - -% if paged == 'yes': -% if current is None: - <& toc, includefile = True, **ARGS &> -% else: - <A name="<% current.path %>"></a> - <& topnav, item=current, **ARGS &> - <div class="sectioncontent"> - <& formatting.myt:printitem, item=current, includefile = True, omitheader = True &> - </div> -% # if/else -% else: - <& toc, includefile = False, **ARGS &> - <div class="onepagecontent"> -% for i in toc.children: - <div class="section"> - - <A name="<% i.path %>"></a> - <div class="topnavmargin"> - <& topnav, item=i, **ARGS &> - </div> - - <& formatting.myt:printitem, item=i, includefile = False, omitheader = True &> - </div> -% # for i - </div> - -% # if/else - - -<%method topnav> - <%args> - isdynamic - paged - item - index - ext - onepage - </%args> -% ispaged = (paged =='yes') - -<div class="topnav"> - -<& topnavcontrol, **ARGS &> - -<div class="topnavsectionlink"> - -<a href="<% ispaged and 'index' + ext or '#top' %>">Table of Contents</a> - -<div class="prevnext"> -% if item.previous is not None: -Previous: <& formatting.myt:itemlink, item=item.previous, includefile=ispaged &> -% - -% if item.previous is not None and item.next is not None: - | -% - -% if item.next is not None: - -Next: <& formatting.myt:itemlink, item=item.next, includefile=ispaged &> -% - -</div> -</div> - - -<div class="topnavmain"> - <div class="topnavheader"><% item.description %></div> - <div class="topnavitems"> - <& formatting.myt:printtoc, root = item, includefile = False, current = None, full = True &> - </div> -</div> - -</div> -</%method> - -<%method topnavcontrol> - <%args> - isdynamic - paged - index - ext - onepage - </%args> -% ispaged = (paged =='yes') - - <div class="topnavcontrol"> -% if ispaged: - View: <b>Paged</b> | <a href="<% isdynamic and index + ext + '?paged=no' or onepage + ext %>">One Page</a> -% else: - View: <a href="<% index + ext %>">Paged</a> | <b>One Page</b> -% - </div> - -</%method> - -<%method toc> - <%args> - toc - includefile = True - isdynamic - paged - index - ext - onepage - </%args> - - - <div class="maintoc"> - <& topnavcontrol, **ARGS &> - - <a name="table_of_contents"></a> - <h2>Table of Contents</h2> - - <a href="#full_index">(view full table)</a> - <br/><br/> - - <div style="margin-left:50px;"> - <& formatting.myt:printtoc, root = toc, includefile = includefile, current = None, full = False, children=False &> - </div> - - </div> - - - <div class="maintoc"> - <a name="full_index"></a> - <h2>Table of Contents: Full</h2> - - <a href="#table_of_contents">(view brief table)</a> - <br/><br/> - - <div style="margin-left:50px;"> - <& formatting.myt:printtoc, root = toc, includefile = includefile, current = None, full = True, children=True &> - </div> - - </div> -</%method> diff --git a/doc/build/components/pydoc.myt b/doc/build/components/pydoc.myt index bf7a6952a..b787ae74f 100644 --- a/doc/build/components/pydoc.myt +++ b/doc/build/components/pydoc.myt @@ -1,44 +1,42 @@ +<%doc>pydoc.myt - provides formatting functions for printing docstring.AbstractDoc generated python documentation objects.</%doc> + <%global> - import docstring, string, sys +import docstring </%global> <%method obj_doc> <%args> obj + toc + extension </%args> - -<%python> +<%init> if obj.isclass: - s = [] links = [] for elem in obj.inherits: if isinstance(elem, docstring.ObjectDoc): - links.append("<a href=\"#%s\">%s</a>" % (str(elem.id), elem.name)) - s.append(elem.name) + links.append(m.scomp("nav.myt:toclink", toc=toc, path=elem.toc_path, extension=extension, description=elem.name)) else: links.append(str(elem)) - s.append(str(elem)) - description = "class " + obj.classname + "(%s)" % (','.join(s)) htmldescription = "class " + obj.classname + "(%s)" % (','.join(links)) else: - description = obj.description htmldescription = obj.description - -</%python> -<&|doclib.myt:item, name=obj.name, description=description, htmldescription=htmldescription, altlink=str(obj.id) &> + +</%init> + +<&|formatting.myt:section, toc=toc, path=obj.toc_path, description=htmldescription &> + <&|formatting.myt:formatplain&><% obj.doc %></&> % if not obj.isclass and obj.functions: -<&|doclib.myt:item, name="modfunc", description="Module Functions" &> -<&|formatting.myt:paramtable&> + % for func in obj.functions: <& SELF:function_doc, func=func &> % -</&> -</&> + % else: + % if obj.functions: -<&|formatting.myt:paramtable&> % for func in obj.functions: % if isinstance(func, docstring.FunctionDoc): <& SELF:function_doc, func=func &> @@ -46,26 +44,26 @@ else: <& SELF:property_doc, prop=func &> % % -</&> % % % if obj.classes: -<&|formatting.myt:paramtable&> % for class_ in obj.classes: - <& SELF:obj_doc, obj=class_ &> + <& SELF:obj_doc, obj=class_, toc=toc, extension=extension &> % -</&> % </&> - </%method> <%method function_doc> <%args>func</%args> - <&|formatting.myt:function_doc, name=func.name, link=func.link, arglist=func.arglist &> - <&|formatting.myt:formatplain&><% func.doc %></&> - </&> + <div class="darkcell"> + <A name=""></a> + <b><% func.name %>(<% ", ".join(map(lambda k: "<i>%s</i>" % k, func.arglist))%>)</b> + <div class="docstring"> + <&|formatting.myt:formatplain&><% func.doc %></&> + </div> + </div> </%method> @@ -73,7 +71,13 @@ else: <%args> prop </%args> - <&|formatting.myt:member_doc, name=prop.name, link=prop.link &> - <&|formatting.myt:formatplain&><% prop.doc %></&> - </&> + <div class="darkcell"> + <A name=""></a> + <b><% prop.name %></b> + <div class="docstring"> + <&|formatting.myt:formatplain&><% prop.doc %></&> + </div> + </div> </%method> + + diff --git a/doc/build/components/section_wrapper.myt b/doc/build/components/section_wrapper.myt deleted file mode 100644 index b4e7c524e..000000000 --- a/doc/build/components/section_wrapper.myt +++ /dev/null @@ -1,42 +0,0 @@ -<%python scope="global"> - import string, re, time - -</%python> - -<%args> - comp - toc - title - version = None - last_updated = None - index - paged - onepage - isdynamic - ext -</%args> - -<link href="style.css" rel="stylesheet" type="text/css"></link> -<link href="syntaxhighlight.css" rel="stylesheet" type="text/css"></link> - -<link href="docs.css" rel="stylesheet" type="text/css"></link> -<script src="scripts.js"></script> - - -<div style="position:absolute;left:0px;top:0px;"><a name="top"></a> </div> - -<div class="doccontainer"> - -<div class="docheader"> - -<h1><% title %></h1> -% if version is not None: -<div class="">Version: <% version %> Last Updated: <% time.strftime('%x %X', time.localtime(last_updated)) %></div> -% -</div> - -<& printsection.myt, paged = paged, toc = toc, comp = comp, isdynamic=isdynamic, index=index, ext=ext,onepage=onepage &> - -</div> - - diff --git a/doc/build/components/toc.myt b/doc/build/components/toc.myt new file mode 100644 index 000000000..6580a39c5 --- /dev/null +++ b/doc/build/components/toc.myt @@ -0,0 +1,95 @@ +<%doc>toc.myt - prints full table of contents listings given toc.TOCElement strucures</%doc> + +<%method toc> + <%args> + toc + extension + </%args> + + + <div class="maintoc"> + + <a name="table_of_contents"></a> + <h2>Table of Contents</h2> + + <a href="#full_index">(view full table)</a> + <br/><br/> + + <div style="margin-left:50px;"> + <& printtoc, root = toc, current = None, full = False, children=False, extension=extension, anchor_toplevel=False &> + </div> + + </div> + + + <div class="maintoc"> + <a name="full_index"></a> + <h2>Table of Contents: Full</h2> + + <a href="#table_of_contents">(view brief table)</a> + <br/><br/> + + <div style="margin-left:50px;"> + <& printtoc, root = toc, current = None, full = True, children=True, extension=extension, anchor_toplevel=False &> + </div> + + </div> +</%method> + + +<%method printtoc> +<%args> + root + current = None + full = False + children = True + extension + anchor_toplevel=False +</%args> + +<ul class="toc_list"> +% for i in root.children: + <& printtocelement, item=i, bold = (i == current), full = full, children=children, extension=extension, anchor_toplevel=anchor_toplevel &> +% +</ul> +</%method> + +<%def printtocelement> +<%doc>prints a TOCElement as a table of contents item and prints its immediate child items</%doc> + <%args> + item + bold = False + full = False + children = True + extension + anchor_toplevel + </%args> + + <li><A style="<% bold and "font-weight:bold;" or "" %>" href="<% item.get_link(extension=extension, anchor=anchor_toplevel) %>"><% item.description %></a></li> + +% if children: + <ul class="small_toc_list"> +% for i in item.children: + <& printsmtocelem, item=i, children=full, extension=extension &> +% + </ul> +% +</%def> + +<%def printsmtocelem> + <%args> + item + children = False + extension + </%args> + <li><A href="<% item.get_link(extension=extension) %>"><% item.description %></a></li> + +% if children: + <ul class="small_toc_list"> +% for i in item.children: + <& printsmtocelem, item = i, extension=extension &> +% + </ul> +% + +</%def> |