将示例用法(markdown吗?)添加到JavaDocs [英] Add example usage (markdown?) to JavaDocs
本文介绍了将示例用法(markdown吗?)添加到JavaDocs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说我有这个:
是否有一种向每个方法添加markdown或html的方法,并提供了如何使用该方法的示例?我在考虑一个展开的面板-按钮显示视图示例,它会打开一个面板.
Is there a way to add markdown or html to each method, with an example of how to use the method? I am thinking an expanding panel - button says view example and it opens a panel.
我尝试将其添加到嵌入式文档中:
I tried adding this to the inline docs:
/**
* <pre>
* <code>new BeanTranslator.Builder()
* .translate(
* new{@code Translator<String, Integer>}(String.class, Integer.class){
* {@literal @}Override
* public Integer translate(String instance) {
* return Integer.valueOf(instance);
* }})
* .build();
* </code>
* </pre>
*/
@SuppressWarnings("Duplicates")
public static <I, T, V, E> void Reduce(I initialVal, List<T> tasks, Asyncc.Reducer<V, E> m, Asyncc.IAsyncCallback<V, E> f) {
NeoReduce.Reduce(initialVal, tasks, m, f);
}
但是我只在右侧看到它:
but I only see this on the right side:
推荐答案
有一个图书馆允许像这样在Javadocs中使用Markdown甚至PlantUML:
There is a library that allows to use Markdown and even PlantUML in Javadocs like this:
/**
* Java Example:
*
* ```java
* @Override
* public void myMethod() {
* }
* ```
*/
这篇关于将示例用法(markdown吗?)添加到JavaDocs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文