3

Say I have this:

enter image description here

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:

enter image description here

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

1 Answers1

3

There is a library that allows to use Markdown and even PlantUML in Javadocs like this:

/**
* Java Example:
*
* ```java
* @Override
* public void myMethod() {
* }
* ```
*/
Tom
  • 3,913
  • 19
  • 28
  • thanks i tried installing using maven and got an error, filed a ticket with them, i got it working with html instead of markdown, but would be cool to get markdown working too thanks – Alexander Mills Feb 18 '19 at 23:50
  • The folllowing guide does an overview about how to use this librar, however, it doesn't seem like it is an standard so I would be wary about using it. https://www.mscharhag.com/java/using-markdown-syntax-in-javadoc – JCalcines May 21 '20 at 09:09