--visible-members command-line option

1. What members to include in the documentation

The CommandLine option --visible-members (short form is -M) controls what class members are visible in the generated documentation. The following visibility types are known:

  • private

  • strictprivate

  • protected

  • strictprotected

  • public

  • published

  • automated

  • implicit

    This is a special visibility level, used only if you requested it by --implicit-visibility=implicit.See --implicit-visibility option for more details.

Example:

pasdoc --visible-members protected,public,published,automated

By default private, strictprivate and implicit members are hidden. The rest is shown.

2. Make some members "included but hidden by default"

Moreover, you can specify some visibility levels as "included but hidden by default" by adding ? at the end of the visibility level name.

The main use-case is for protected and strictprotected visibility levels, which:

  • on one hand, deserve to be mentioned and documented (developers using the class need to know about them, to be able to develop descendants),

  • on the other hand, sometimes we don’t want the protected stuff to clutter the default view too much, because most developers are fine just exploring the public identifiers.

Now you can have a cake, and eat it too :), by specifying the "included but hidden by default" visibility levels with ? at the end for the --visible-members option. Like this:

pasdoc --visible-members=protected?,public,published *.pas

This results in protected members included but hidden by default in the HTML output. We will show a checkbox to allow user to show/hide them (using JavaScript, so no page reload).