Skip to content

Libdoc: Support Markdown as output format #5749

Description

@aaltat

Markdown support

If library documentation is written as Markdown, as it is possible from 7.5 release, it would beneficial if libdoc could output library documentation also as Markdown. This is useful for many use cases.

AI/LLM

Example LLM can easily understand documentation that is written in Markdown format. Because Markdown contains less extra characters, example compared to XML or JSON, it will consume less tokens from the LLM context, which helps LLM to digest bigger libraries documentation and do more meaningful work.

Documentation publish systems

Many documentation publish systems do not accept standalone HTML pages, but they do accept Markdown documents. Then those documents can be easily published to different knowledge places, without needing to convert from one format to another.

Activity

  1. changed the title [-]Support generating libdoc documentation as markdown[/-] [+]Libdoc: Support Markdown as output format[/+] on Aug 17, 2026
  2. pekkaklarck commented on Aug 17, 2026

    @pekkaklarck
    Member

    Sounds good to me. This would in practice mean that we'd allow usages like this:

    libdoc MyLibrary MyLibrary.md
    

    This would generate a Markdown file with headings like Introduction, Importing and Keywords similarly as in Libdoc's HTML files. The actual docs would be got directly from the library, so this only really works with libraries using Markdown format.

  3. pekkaklarck commented on Aug 17, 2026

    @pekkaklarck
    Member

    Let's try to squash this into RF 7.5 that already has plenty of somewhat related enhancements.

  4. added this to the v7.5 milestone on Aug 17, 2026
  5. pekkaklarck commented on Aug 17, 2026

    @pekkaklarck
    Member

    We are planning to change Libdoc's console output format to Markdown as well (#5755). We'll do that first so that we can then reuse the new functionality. That way we also don't need to maintain multiple plain text output formats.

  6. aaltat commented on Aug 25, 2026

    @aaltat
    ContributorAuthor

    We did discuss this a bit more. We agreed that Markdown does not, for this release, support language selection.

    Also we changed the output format somewhat and now args, raises and return are heading 4 and not bold text. This was done because headings work better for external consumers. Example linking works, indentation is better. So now format will look like

    # MarkdownLibrary
    
    * Version: 1.0
    * Scope: TEST
    
    ## Introduction
    
    Intro doc.
    
    ## Importing
    
    #### Arguments
    
    * `arg` (type: `str`, default: `default`)
    * `other` (type: `int`, default: `1`)
    
    #### Documentation
    
    Importing doc.
    
    ## Keywords
    
    ### No Args Doc
    
    #### Arguments
    
    * `arg` (type: `str`)
    
    #### Documentation
    
    Args is here but no arg defined.
    
    ### No Doc
    
    #### Arguments
    
    * `arg` (type: `str`) -
      arg doc.
    
    ### Positional And Named
    
    #### Arguments
    
    * `pos_only` (type: `str`, positional-only) -
      positional-only argument.
    * `normal` (type: `int`, default: `1`) -
      normal argument document.
      continues here.
    * `named_only` (type: `str`, default: `default`, named-only) -
      named-only argument.
    
    #### Returns
    
    * `str` -
      Always string.
    
    #### Raises
    
    * `ValueError` -
      Never
    * `TypeError` -
      Not ever
    
    #### Tags
    
    * `tag1`
    * `tag2`
    
    #### Documentation
    
    Keyword doc.
    
    ### Varargs And Kwargs
    
    #### Arguments
    
    * `*args` (type: `str`) -
      varargs doc.
    * `**kwargs` (type: `str`) -
      keyword args doc.
    
    #### Documentation
    
    Doc for variable arguments and keyword arguments.
    

    When created from

    from robot.api.deco import library
    
    
    @library(version="1.0", doc_format="MARKDOWN", auto_keywords=True)
    class MarkdownLibrary:
        """Intro doc."""
    
        def __init__(self, arg: str = "default", other: int = 1):
            """Importing doc."""
    
        def positional_and_named(
            self,
            pos_only: str,
            /,
            normal: int = 1,
            *,
            named_only: str = "default",
        ) -> str:
            """Keyword doc.
    
            Args:
                pos_only: positional-only argument.
                normal: normal argument document.
                    continues here.
                named_only: named-only argument.
    
            Returns:
                Always string.
    
            Raises:
                ValueError: Never
                TypeError: Not ever
    
            Tags:
                tag1, tag2
            """
            return ""
    
        def varargs_and_kwargs(self, *args: str, **kwargs: str):
            """Doc for variable arguments and keyword arguments.
    
            Args:
                *args (str): varargs doc.
                **kwargs (str): keyword args doc.
            """
            pass
    
        def no_doc(self, arg: str):
            """
            Args:
                arg: arg doc.
            """
            pass
    
        def no_args_doc(self, arg: str):
            """Args is here but no arg defined.
    
            Args:
            """
            pass
  7. added a commit that references this issue on Aug 28, 2026
    0bfe709
  8. added
    acknowledge
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

acknowledgeeffort: mediumpriority: highrc 1

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions