如何合并方法和描述列

huangapple go评论101阅读模式
英文:

How to merge method and description columns

问题

I'm new to javadoc. I've tried to generate javadoc with Maven plugin. It works well, however, it generates 2 columns Method and Description instead 1 column Method and Description. I can't find an option to merge these 2 columns.

Here is the config in the pom file:

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.apache.maven.plugins</groupId>
  5. <artifactId>maven-javadoc-plugin</artifactId>
  6. <version>3.5.0</version>
  7. <configuration>
  8. <source>1.8</source>
  9. <target>1.8</target>
  10. </configuration>
  11. </plugin>
  12. </plugins>
  13. </build>

And, here is the result:

如何合并方法和描述列

What I would expect:

如何合并方法和描述列

英文:

I'm new to javadoc. I've tried to generate javadoc with Maven plugin. It works well, however, it generates 2 columns Method and Description instead 1 column Method and Description. I can't find option to merge these 2 columns.

Here is the config in the pom file:

  1. &lt;build&gt;
  2. &lt;plugins&gt;
  3. &lt;plugin&gt;
  4. &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
  5. &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
  6. &lt;version&gt;3.5.0&lt;/version&gt;
  7. &lt;configuration&gt;
  8. &lt;source&gt;1.8&lt;/source&gt;
  9. &lt;target&gt;1.8&lt;/target&gt;
  10. &lt;/configuration&gt;
  11. &lt;/plugin&gt;
  12. &lt;/plugins&gt;
  13. &lt;/build&gt;

And, here is the result:

如何合并方法和描述列

What I would expect:

如何合并方法和描述列

答案1

得分: 1

默认情况下,Maven Javadoc 插件生成的 Javadoc 具有两列:方法和描述。但是,如果您想将这两列合并为单独的一列,您可以使用<noindex>true</noindex>配置选项。

通过添加<additionalparam>-noindex</additionalparam>配置,您正在将-noindex选项传递给Javadoc工具,这将导致方法和描述的单列布局。

在进行此更改后,您可以通过运行Maven命令mvn javadoc:javadoc重新生成Javadoc。生成的Javadoc现在应该具有方法和描述的单列。

英文:

By default, the Maven Javadoc plugin generates Javadoc with two columns: Method and Description. However, if you want to merge these two columns into a single column, you can use the &lt;noindex&gt;true&lt;/noindex&gt; configuration option.

  1. &lt;build&gt;
  2. &lt;plugins&gt;
  3. &lt;plugin&gt;
  4. &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
  5. &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
  6. &lt;version&gt;3.5.0&lt;/version&gt;
  7. &lt;configuration&gt;
  8. &lt;source&gt;1.8&lt;/source&gt;
  9. &lt;target&gt;1.8&lt;/target&gt;
  10. &lt;additionalparam&gt;-noindex&lt;/additionalparam&gt;
  11. &lt;/configuration&gt;
  12. &lt;/plugin&gt;
  13. &lt;/plugins&gt;
  14. &lt;/build&gt;

By adding the &lt;additionalparam&gt;-noindex&lt;/additionalparam&gt; configuration, you are passing the -noindex option to the Javadoc tool, which will result in a single column layout for the Method and Description.

After making this change, you can regenerate the Javadoc by running the Maven command mvn javadoc:javadoc. The generated Javadoc should now have a single column for Method and Description.

huangapple
  • 本文由 发表于 2023年6月1日 11:39:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76378544.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定