Search code examples
documentationjavadocindentationnested-lists

How to create multiple levels of indentation in Javadoc?


Suppose, that as part of documenting your code (Javadoc) you want to indicate that the relationships between elements using deep indentation.

How can I create a nested list as:

  • some element
    • some other element
      • yet some other element

Solution

  • <ul>
      <li>Element</li>
      <ul>
         <li>Subelement...</li>
    

    You can pretty freely use HTML inside javadoc comments.

    Update: Because it came up, I tried

    <ul>
        <li>one</li>
        <ul>
            <li>one point one</li>
        </ul>   
    </ul>
    

    and get

    • one
      • one point one

    I agree proper nesting is better.