2014-03-03 93 views

回答

0

有一個自我記錄元素的建議。

https://docs.google.com/document/d/15erfuJ9kGTTFZIxM1E8mKSdvZmb9RPr2BwMQvU48PVI

一些例子給予

<wc-documentation name="my-tag"> 
    <summary>My tag is the bees knees.</summary> 
</wc-documentation> 
<wc-documentation name="my-tag" version="0.0.1" 
        github="https://github.com/Polymer/polymer" 
        home="http://polymer-project.org"> 
    <summary>...</summary> 
    <pre class="example">...</pre> 
</wc-documentation> 
<wc-documentation name="my-tag"> 
    <div class="api"> 
    <p>This element supports the following methods:</p> 
    <dl public> 
     <dt>foo()</dt> 
     <dd>Awesome method.</dd> 
    </dl> 
    <dl private> 
     <dt>bar_()</dt> 
     <dd>Privacy is key.</dd> 
    </dl> 
    </div> 
</wc-documentation> 

這裏討論

https://groups.google.com/forum/#!searchin/polymer-dev/documentation/polymer-dev/NFQ4hIgZSo4/bBVvMD6_jMEJ

有一些關注的元素中unessesary鍋爐板的量。這最終導致了一個原型爲一個文件瀏覽器元素

http://polymer.github.io/polymer-doc-viewer/?//polymer.github.io/google-map/components/google-map/google-map.html&//polymer.github.io/polymer-localstorage/components/polymer-localstorage/polymer-localstorage.html

+0

這代表了我沒有考慮過的兩種方法,併爲我自己的需要提供了一些想法,直到採用標準方法。謝謝馬特! – lazieburd

3

我們是在清理這些東西和記錄文檔的工具只是在接下來的幾個星期的過程。我很抱歉,今天這一切都有點粗糙。話雖如此,以下是一些信息:

聚合物發出一個polymer-doc-viewer組件,您可以指向(一個或多個)HTML文件以從源註釋生成文檔。查看demo.html以查看一些可能的用法。

我們還有polymer-docs組件,它將呈現它已知的所有聚合物元素的文檔。這裏是安裝在gh-pages真人版:

http://polymer.github.io/polymer-docs/components/polymer-docs/

註釋格式是JSDoc狀,大多來自YUIDoc複製。渲染後的輸出可能會很快得到改進,但這是一個很好的部分:如果我們改變它,然後更新組件的副本,它將會正常工作。

您也可以自定義或製作自己的polymer-doc-viewer,因爲代碼非常簡單。還有另一個名爲context-free-parser的組件(包含),它實際上將文檔數據添加到JavaScript對象(數據模型)中,因此您可以隨意渲染它。

相關問題