Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Comprehensive list of supported commands #821

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

fpelliccioni
Copy link
Collaborator

Fixes #676

In the file src/lib/AST/ParseJavadoc.cpp, there are mainly two functions in charge of handling documentation commands:

  1. JavadocVisitor::visitInlineCommandComment(...)
    This one mentions inline commands such as: @n, @a, @e, @em, @copybrief, @copydetails, @copydoc, and @ref.

  2. JavadocVisitor::visitBlockCommandComment(...)

    • It treats certain block commands in a special manner, for example:
      @brief, @short, @return / @returns / @result, @throw / @throws / @exception, @note, @warning, @par, @li, @details, @see, @pre, @post.
      These commands trigger specific behavior in MrDocs.
    • It does not produce errors but also does nothing with many other commands (e.g., @addindex, @addtogroup, @anchor, @arg, …, @xrefitem).
      Although they are present in the CommandTraits enum and do not cause errors, MrDocs currently does nothing with them.

I have decided to include all these "passively supported" commands in the documentation because:

  • Even though MrDocs does nothing concrete with them, they are recognized in the CommandTraits enumeration.
  • Some of the "passively supported" commands reference others in the list, creating a chain of mentions.

Additionally, I have made the following documentation adjustments:

  • Removed references to other programming languages (Objective-C, Java, etc.). For instance, commands like @category and @protocol (which apply only to Objective-C) were removed. We kept The C programming languages for compatibility and relevance alongside C++. Code, examples and mentions to other programming languages were removed.

  • Added the @endlink command, which was commented out in the visitBlockCommandComment(...) switch but referenced by @link. I decided to keep it to cover the @link ... @endlink pair.

  • There are open questions about how to handle other points mentioned in the docs:

    • Typical Doxygen configuration options (e.g. CALLER_GRAPH, ENABLED_SECTIONS, etc.).
    • Support for HTML-like syntax (e.g. <em>multiple words</em>) which is referenced in multiple places.
    • The @startuml command, which suggests needing Java and PlantUML. We need to decide if we want to support it.

With this PR, all commands included in the enumeration are now documented, so they can be referenced, even though MrDocs does not yet perform additional processing for some of them.

@cppalliance-bot
Copy link

An automated preview of the documentation is available at https://821.mrdocs.prtest2.cppalliance.org/index.html

@alandefreitas
Copy link
Collaborator

Even though MrDocs does nothing concrete with them, they are recognized in the CommandTraits enumeration.

So they're unsupported?

Some of the "passively supported" commands reference others in the list, creating a chain of mentions.

So they're supported?

@@ -0,0 +1,176 @@
= Comprehensive List of Commands
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a section for this on the commands page.

The term "commands" for documentation commands might be ambiguous with command line commands.

This could be something like "Documentation Command Reference" but the navtitle would have to be shorter like "Documentation Commands" or something,


Below is the complete list of supported commands:

* xref:commands/a.adoc[@a]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page is kind of boring and ugly.

Commands could be on a table like the ones mrdocs generates where the first column has the command and the second column has a brief description.

To make it less repetitive, commands can be put into subsections categories. The basic categories are block and inline commands. Then there's subcategories based on what the command does.

Each section can have a small paragraph explaining the table to come.

The command text should be as wrapped in "`"s.

Unsupported commands can be in red without a page so that users and developers can keep track of them.

Unimplemented commands are unsupported commands.

@@ -56,6 +56,11 @@ The following commands can be used to format the text in the doc comments:
|
|===

== Full List of Commands
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need that (the nav is more visible already). The one that already exists also needs to be removed.

Equivalent to xref:commands/e.adoc[@e] and xref:commands/em.adoc[@em]. To emphasize multiple words use <em>multiple words</em>.

== Example
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's markdown. Not asciidoctor.

@anchor &lt;word&gt;

== Description
This command places an invisible, named anchor into the documentation to which you can refer with the xref:commands/ref.adoc[@ref] command.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All supported commands need examples.

@callergraph

== Description
When this command is put in a comment block of a function or method and HAVE_DOT is set to `YES`, then MrDocs will generate a caller graph for that function (provided the implementation of the function or method is called by other documented functions). The caller graph will be generated regardless of the value of CALLER_GRAPH.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No point in describing unsupported commands.




*Note:* The completeness (and correctness) of the caller graph depends on the MrDocs code parser which is not perfect.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not imperfect. It's 100% unsupported.


/*! A test class. */

class Include_Test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't tell me you're copy/pasting these from doxygen's documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a list of all supported @ annotations
3 participants