官术网_书友最值得收藏!

Discovering Zope/Plone APIs and docstrings with DocFinderTab

Although Zope and Plone documentation is really good, sometimes it's so comprehensive that we must read and browse lots of code before we get what we are looking for. DocFinderTab provides a great way of finding it.

How to do it…

  1. Add the Products.DocFinderTab line in the eggs parameter of [buildout] part:
    [buildout]
    
    ...
    
    # Add additional eggs here 
    eggs = 
        iw.debug 
     Products.DocFinderTab
    
  2. Build your instance again and launch it:
    ./bin/buildout
    ./bin/instance fg
    

Now you can navigate to your ZMI (Zope Management Interface) instance to see a new Doc tab. For instance, browse to the URL http://localhost:8080/plone/showDocumentation to get the documentation tab as shown in the following screenshot:

How to do it…

You can also do this with a particular document, folder, or tool of your site:

  • http://localhost:8080/plone/front-page/showDocumentation.
  • http://localhost:8080/plone/events/showDocumentation.
  • http://localhost:8080/plone/portal_catalog/showDocumentation.

How it works…

DocF inderTab is an introspection tool to expose Zope and Plone documentation from inside the ZMI.

The following paragraph explains how DocFinderTab works:

It analyses any Zope object inside a running Zope, determines which classes have been used in the object's makeup and provides information about their class level attributes: name, allowed roles, arguments, documentation strings. It provides (read only) access to source code of Python implemented classes and methods.

The excerpt was taken from Dieter Maurer's website (http://www.dieter.handshake.de). He's the creator of DocFinder, the Zope product used by DocFinderTab.

There's more…

More information on DocFinderTab is available at: http://plone.org/products/docfindertab.

To learn about how DocFinder works visit http://www.dieter.handshake.de/pyprojects/zope/DocFinder.html.

If you are interested in more Python introspection, then visit http://diveintopython.org/power_of_introspection/index.html.

主站蜘蛛池模板: 苗栗县| 阿克陶县| 十堰市| 定南县| 西青区| 双流县| 定日县| 通渭县| 盈江县| 谢通门县| 淮北市| 嘉定区| 汝阳县| 婺源县| 鲁山县| 黄浦区| 郸城县| 萝北县| 上林县| 崇阳县| 家居| 建阳市| 河北省| 广宗县| 静宁县| 依安县| 湖州市| 宾川县| 孝感市| 东光县| 聂拉木县| 万安县| 江西省| 民乐县| 搜索| 安吉县| 柘城县| 尖扎县| 霍林郭勒市| 洞口县| 青川县|