Improve the error message when libdoc fails to generate documentation
Author: mardukbpCreated Sep 24, 2026Updated Sep 24, 2026
Prior to RF 7.5 the following command runs successfully:
libdoc Process Process.jsonWith RF 7.5 the command fails with the error
Markdown format requires 'markdown' module to be installed.This error arises because:
- in RF 7.5 the documentation of the standard RF libraries is written in Markdown
- when the output format is JSON by default libdoc converts the documentation to HTML
- the 'markdown' module is required in order to convert Markdown to HTML
The current error message doesn't make clear why the 'markdown' module is required. It comes from a leaky abstraction.
My suggestion would be to introduce pre-conditions (via assertions) in each stage of the pipeline for generating the documentation. For example, in the stage that converts the documentation to HTML:
def module_exists(module: str) -> bool:
try:
import_module(module)
return True
except ModuleNotFoundError:
return False
def convert_to_html(doc) -> str:
match doc.format:
case 'markdown':
assert module_exists('markdown'), "The 'markdown' module is required to convert Markdown documentation to HTML"
return md_to_html(doc)
case 'robot':
return robot_to_html(doc)Source: robotframework/robotframework