[Zope3-checkins] CVS: Zope3/src/zope/products/apidoc/browser - __init__.py:1.1 apidoc.css:1.1 apidoc.py:1.1 configure.zcml:1.1 contents.pt:1.1 details_macros.pt:1.1 index.html:1.1 macros.py:1.1 menu.html:1.1 menu_macros.pt:1.1 mi_small.gif:1.1 modules.pt:1.1 pl_small.gif:1.1

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Jan 29 12:51:16 EST 2004


Update of /cvs-repository/Zope3/src/zope/products/apidoc/browser
In directory cvs.zope.org:/tmp/cvs-serv11915/apidoc/browser

Added Files:
	__init__.py apidoc.css apidoc.py configure.zcml contents.pt 
	details_macros.pt index.html macros.py menu.html 
	menu_macros.pt mi_small.gif modules.pt pl_small.gif 
Log Message:
Here comes the new Zope 3 API Documentation tool. You can access it via

  http://localhost:8080/++apidoc++/

There is really not much more to say here. Check it out and let me know what
you think.


=== Added File Zope3/src/zope/products/apidoc/browser/__init__.py ===


=== Added File Zope3/src/zope/products/apidoc/browser/apidoc.css ===
body {
    font: 80% Verdana, Helvetica, Arial, sans-serif;
    background: white;
    color: black;
    margin: 0pt;
    padding: 0pt;
}

code, pre {
  font-size: 110%;
}

ul {
    margin: 0;
    margin-left: 1.5em;
    padding: 0;
}

table.menu {
    font-size: 95%;
}

div.apihead {
    font-weight: bold;
    font-size: 120%;
    margin: 0;
    padding: 2pt;
    margin-bottom: 3pt;
    background: #fffbbe;
    width: 98%;
}

div.menu {
    border-top: solid 1pt black;
    margin-bottom: 3pt;
    font-weight: bold;
}

p.small, div.small {
    font-size: 85%;
    padding: 4pt;
}

span.small {
    font-size: 85%;
}

div.indent {
    margin-left: 1.5em;
}

h1.details-header {
    font-size: 220%;
    font-weight: normal;
    margin-top: 0;
}

h2.details-section {
    font-size: 150%;
    font-style: italic;
}

h3.details-section {
    margin-bottom: 2pt;
}

p.breadcrumbs {
  padding: 2pt;
  border: solid 1px black;
}

.important {
    font-size: 120%;
}

ul.attr-list li {
    margin-bottom: 0.5em;
}

/* Styles that are associated with STX-generated HTML */

div.documentation {
}

div.documentation h1 {
  font-size: 120%;
}

div.documentation h2 {
  font-size: 110%;
  font-style: italic;
}

div.documentation h3 {
  font-style: italic;
  font-weight: normal;
  padding: 0;
  margin: 0;
}

div.documentation p {
  padding: 0;
  margin-top: 0;
  margin-bottom: 1em;
}

div.documentation ul, ol {
  margin: 0.5em 2em;
}

div.inline-documentation h3 {
  font-style: italic;
  font-weight: normal;
  padding: 0;
  margin: 0;
  margin-bottom: 0.5em;
}

div.inline-documentation p {
  padding: 0;
  margin: 0 0.5em 0 0;
}


=== Added File Zope3/src/zope/products/apidoc/browser/apidoc.py ===
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Main API Documentation View

$Id: apidoc.py,v 1.1 2004/01/29 17:51:14 srichter Exp $
"""
from zope.products.apidoc.utilities import stx2html


class APIDocumentation(object):
    """View for the API Documentation"""

    def getModuleList(self):
        """Get a list of all available documentation modules."""
        modules = []
        items = list(self.context.items())
        items.sort()
        return [{'name': name,
                 'title': m.title,
                 'description': stx2html(m.description)}
                for name, m in items ]


=== Added File Zope3/src/zope/products/apidoc/browser/configure.zcml ===
<configure
  xmlns="http://namespaces.zope.org/browser"
  i18n_domain="api_doc">

  <resource name="apidoc.css" file="apidoc.css" />

  <resource name="pl_small.gif" file="pl_small.gif" />
  <resource name="mi_small.gif" file="mi_small.gif" />

  <page
      for="*"
      name="apidoc_macros"
      permission="zope.View"
      class=".macros.APIDocumentationMacros"
      allowed_interface="zope.interface.common.mapping.IItemMapping" 
      />
  
  <page 
      for="*"
      name="menu_macros"
      permission="zope.View"
      template="menu_macros.pt"
      />

  <page 
      for="*"
      name="details_macros"
      permission="zope.View"
      template="details_macros.pt"
      />

  <pages
    for="zope.products.apidoc.APIDocumentation"
    class=".apidoc.APIDocumentation"
    permission="zope.View">

    <page
        name="index.html"
        template="index.html" />

    <page
      name="modulelist.html"
      template="modules.pt" />

    <page
      name="menu.html"
      template="menu.html" />

    <page
      name="contents.html"
      template="contents.pt" />

  </pages>

</configure>



=== Added File Zope3/src/zope/products/apidoc/browser/contents.pt ===
<html metal:use-macro="views/apidoc_macros/details">
<body metal:fill-slot="contents">

  <h1>Zope 3 API Documentation</h1>

  <p>Welcome to the Zope 3 API documentation tool. The documentation provided
    here is seperated in several discrete documentation modules. You can see
    the list of available modules in the top-left box on your screen. When you
    click on a module, the module's menu will appear below. In the menu you
    have then navigational means to access the documentation content of the
    module.</p>

  <p>Modules are usually depending on each other by using links that create
    references across all modules. Each module has a "theme" that it follows,
    which was designed to aid the developer directly to the desired
    information. Below you see a short description of every module.</p>

  <tal:omit-tag repeat="module view/getModuleList">

    <h2 tal:content="module/title">Module Title</h2>

    <p tal:replace="structure module/description">
      Module Description
    </p>

  </tal:omit-tag>

</body>
</html>

=== Added File Zope3/src/zope/products/apidoc/browser/details_macros.pt ===
<metal:block define-macro="details"><metal:block define-slot="doctype"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></metal:block>

<html
  xmlns="http://www.w3.org/1999/xhtml"
  xml:lang="en"
  lang="en" 
  i18n:domain="apidoc">

  <head>
    <title metal:define-slot="title" i18n:translate="">Z3 UI</title>

    <style type="text/css" 
           media="all"
           tal:content=
           "string: @import url(${context/++resource++apidoc.css});"
           >
      @import url(/++resource++apidoc.css);
    </style>

    <metal:block define-slot="headers" />
    <metal:block define-slot="style_slot" />
    <metal:block define-slot="ecmascript_slot" />

    <link rel="icon" type="image/png"
          tal:attributes="href context/++resource++favicon.png" />
  </head>

<head>

<body style="margin: 1em;">

  <metal:block define-slot="contents" />

</body>
</html>
</metal:block>

=== Added File Zope3/src/zope/products/apidoc/browser/index.html ===
<html>
  <head>
    <title>Zope 3 API Docs</title>
  </head>
  <frameset cols="20%, *" border="1">
    <frameset rows="120, *" frameborder="no">
      <frame name="modules" src="modulelist.html" border="0">
      <frame name="menu" src="menu.html" border="0">
    </frameset>
    <frame name="main" src="contents.html" border="0">
  </frameset>

</html>

=== Added File Zope3/src/zope/products/apidoc/browser/macros.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""API Documentation macros

$Id: macros.py,v 1.1 2004/01/29 17:51:14 srichter Exp $
"""
from zope.app.browser.skins.basic.standardmacros import StandardMacros

BaseMacros = StandardMacros

class APIDocumentationMacros(BaseMacros):
    """Page Template METAL macros for API Documentation"""
    macro_pages = ('menu_macros', 'details_macros')


=== Added File Zope3/src/zope/products/apidoc/browser/menu.html ===
<html metal:use-macro="views/apidoc_macros/menu">
<body>

  <div metal:fill-slot="menu">
    <p class="small">Click on one of the Documentation Modules above and a menu
      for this module will appear.</p>
  </div>

</body>
</html>

=== Added File Zope3/src/zope/products/apidoc/browser/menu_macros.pt ===
<metal:block define-macro="menu"><metal:block define-slot="doctype"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></metal:block>

<html
  xmlns="http://www.w3.org/1999/xhtml"
  xml:lang="en"
  lang="en" 
  i18n:domain="apidoc">

  <head>
    <!-- Waaa -->
    <title metal:define-slot="title" i18n:translate="">Z3 UI</title>


    <style type="text/css" 
           media="all"
           tal:content=
           "string: @import url(${context/++resource++apidoc.css});"
           >
      @import url(/++resource++apidoc.css);
    </style>

    <metal:block define-slot="headers" />
    <metal:block define-slot="style_slot" />
    <metal:block define-slot="ecmascript_slot" />

    <link rel="icon" type="image/png"
          tal:attributes="href context/++resource++favicon.png" />
  </head>

<head>

<body>

  <div class="menu">Menu</div>
 
  <metal:block define-slot="pre_menu" />

  <metal:block define-slot="menu">

    <table cellspacing="0" class="menu" border="0"
           tal:define="root      context/@@static_cookie_tree;
                       result    root/getFlatDicts;
                       flatdicts python:result[0];
                       maxdepth  python:result[1];">

    <tr tal:repeat="dict flatdicts">
    <tal:block tal:define="node dict/node">

      <td style="width:16px" tal:repeat="depth python:range(dict['depth'])" />

      <td style="width:10px">
        <a href=""
           tal:attributes="href string:?tree-state=${dict/tree-state}"
           tal:condition="node/hasChildren"><img

               tal:attributes="src context/++resource++pl_small.gif"
               tal:condition="not:node/expanded" alt="+" border="0" /><img

               tal:attributes="src context/++resource++mi_small.gif"
               tal:condition="node/expanded" alt="-" border="0" /></a>
      </td>

      <td colspan="1" class="list-item"
          tal:attributes="colspan python:maxdepth - dict['depth'] + 1">
        <a href="" target="main"
            tal:attributes="href python: view.getMenuLink(node)"
            tal:content="python: view.getMenuTitle(node)"
            tal:condition="python: view.getMenuLink(node) is not None">
          node/id
        </a>
        <tal:block 
            replace="python: view.getMenuTitle(node)"
            condition="python: view.getMenuLink(node) is None" />
      </td>

    </tal:block>
    </tr>

    </table>

  </metal:block>

  <metal:block define-slot="post_menu" />

</body>
</html>
</metal:block>

=== Added File Zope3/src/zope/products/apidoc/browser/mi_small.gif ===
  <Binary-ish file>

=== Added File Zope3/src/zope/products/apidoc/browser/modules.pt ===
<html metal:use-macro="views/apidoc_macros/details">
<body metal:fill-slot="contents" 
      style="padding: 0; margin: 0">

  <div class="apihead">Zope 3 API Docs</div>
  
  <div style="margin-left: 0.5em">
    <ul class="modules">
      <li tal:repeat="module view/getModuleList">
        <a href="" target="menu" 
             tal:attributes="href string:${module/name}/menu.html" 
             tal:content="module/title">
          Interfaces
        </a>
      </li>
    </ul>
  </div>

</body>
</html>

=== Added File Zope3/src/zope/products/apidoc/browser/pl_small.gif ===
  <Binary-ish file>



More information about the Zope3-Checkins mailing list