2016-06-21 14 views
2

節儉有HTML發生器:如何在Thrift IDL中編寫「javadoc」語句?

thrift --help

html (HTML): 
standalone:  Self-contained mode, includes all CSS in the HTML files. 
       Generates no style.css file, but HTML files will be larger. 

如果寫一個struct這樣

/** 
* This is description of struct MyStruct 
**/ 
struct MyStruct { 
    1: required i32 fieldOne = 2 
} 
運行 thrift --gen html

有這樣一部分創建一個HTML頁面:

Struct MyStruct 

|Key|Field |Type|Description|Requiredness|Default value| 
|---|--------|----|-----------|------------|-------------| 
|1 |fieldOne|i32 |   |required |2   | 

This is description of struct MyStruct 

但我不知道如何填寫description字段?

回答

2

偉大的問題,這是很難猜測,並沒有超好記錄(是的,我很慷慨)。這裏的答案:

struct MyStruct { 
    /** This is how you add a description to a struct field */ 
    1: required i32 fieldOne = 2 
} 
+0

你的意思是,如果我們忽略了[測試/ DocTest.thrift(https://github.com/apache/thrift/blob/master/test/DocTest.thrift)文件; - )?特別是那個人有很多文件記錄(雙關語)細節。 – JensG