2013-05-17 63 views
3

是否可以在使用Maven的Java(多模塊)項目上運行MarginaliaMarginalia/Docco/etc for Java Maven項目?

或者是否有任何其他類似於Marginalia或Docco的替代方案可以做到這一點?

對我來說重要的是能夠將它作爲一個公共Maven存儲庫的依賴項添加並直接使用它,而不需要爲Docco安裝任何額外的東西,比如Node.js - 這是合理的,因爲它是一個合理的Java項目。

回答

2

我試過幾個選項:

  • 旁註與子插件;
  • Jocco(雖然它沒有發佈在任何Maven回購);
  • 然後,我發現atlasssian-docco

我將不得不修改我的意見格式以符合guide,但我認爲這個Maven插件可以完成這項工作。有什麼想法嗎?

0

如果人們仍然在尋找替代編程文檔生成器到javadoc。我曾嘗試過Atlassian Docco,但生成的文檔不太吸引人,也不可讀。然後發現Groc。截至目前比前者好得多。 Groc旨在支持Literate Programming。試一試。看起來像Groc不包含Maven的依賴關係

0

docufier是一個將帶有doc註釋(例如單元測試)的類變成降價的工具。還有一個maven插件。

一個例子是下面的測試案例:

/** 
* 
* Output and Input 
* ---------------- 
* 
* For more control over the execution we'll use a `ProcBuilder` instance to configure 
* the process. 
* 
* The run method builds and spawns the actual process and blocks until the process exits. 
* The process takes care of writing the output to a stream, as opposed to the standard 
* facilities in the JDK that expect the client to actively consume the 
* output from an input stream: 
*/ 
@Test 
public void testOutputToStream() { 
    ByteArrayOutputStream output = new ByteArrayOutputStream(); 

    new ProcBuilder("echo") 
     .withArg("Hello World!") 
     .withOutputStream(output) 
     .run(); 

    assertEquals("Hello World!\n", output.toString()); 
} 

其中將呈現以下降價:

Output and Input 
---------------- 

For more control over the execution we'll use a `ProcBuilder` instance to configure 
the process. 

The run method builds and spawns the actual process and blocks until the process exits. 
The process takes care of writing the output to a stream, as opposed to the standard 
facilities in the JDK that expect the client to actively consume the 
output from an input stream: 

~~~ .java 
ByteArrayOutputStream output = new ByteArrayOutputStream(); 

new ProcBuilder("echo") 
    .withArg("Hello World!") 
    .withOutputStream(output) 
    .run(); 

assertEquals("Hello World!\n", output.toString()); 
~~~ 

對於一個完整的例子參考jproc項目的README.md這已從acceptance test suite生成。