Keyword not detected in libdoc generated documentation

Hi,
I am trying to generate a documentation for some Robot framework keywords. However, I found that libdoc is not detecting python keywords defined inside class.
Here’s a simple example were I was able to replicate this behavior:

"""
Module for testing keyword generartion in class
"""

from robot.api.deco import keyword


class TestClass:
    """
    Test class
    """
    @keyword
    def new_test_keyword(self):
        """
        A test keyword
        """
        pass

I am running “libdoc -F rest <file_path> <target_html>” and the keywords does not appear in the generated documentation. However, if I write the same keyword outside the class, it works perfectly.

Am I missing anything here?

The class is not decorated with the @library decorator from robot.api.deco. I suspect that is the reason. Also, the name of the class should be the same as the name of the Python file it resides in (i.e. TestClass.py).

1 Like