Skip to content

Libdoc: Don't convert Markdown to HTML when generating spec files by default #5808

Description

@pekkaklarck

RF 7.5 enhanced Libdoc so that documentation can be converted in Markdown (#5304). The main motivation was making it possible to use a commonly used documentation format instead of Robot's custom format, not that widely used reStructuredText or plain HTML. When compared to HTML, Markdown has a benefit that it takes less space and is easier to process programmatically, especially when using AI tools. Markdown is thus a good format in machine readable JSON or XML spec files.

How Libdoc, by default, handles spec file documentation depends on the spec file format:

The reason that JSON and LIBSPEC files use HTML by default is that it made more sense than using Robot's custom format that external tools did not understand. With XML specs the format is preserved, because changing it would have been a backwards incompatible change. Regardless the spec format, it is possible to use --specdocformat HTML to convert docs to HTML and --specdocformat RAW to preserve the original format.

With Markdown the situation has now changed to that Markdown (i.e. the original source format) makes more sense than HTML. When we added Markdown support, we thus should have handled it so that it is not, by default, converted to HTML regardless the spec format. Due to backwards compatibility reasons it's a bit questionable to change it afterwards, but I believe the benefits are nevertheless bigger and we should do that in RF 7.6.

It can be argued that we should wait for RF 8.0 before making this change, but I don't think this is such a big change that it needed to wait for a major version. Only users who'd be affected are early Markdown adopters and I would assume that most of them prefer preserving the format anyway. The longer we have Markdown support available before making this change, the more there are users that are affected. Mitigating the backwards compatibility issue is also easy:

  • If you prefer preserving Markdown, use --specdocformat RAW with RF 7.5. It won't be needed anymore after RF 7.6 is released, but using it causes no harm either.
  • If you prefer converting Markdown to HTML, take --specdocformat HTML into use. You can do it already now, but you need to do it latest before migrating to RF 7.6.

It could also be argued that this should be changed already in RF 7.5.1, but I don't think backwards incompatible changes are acceptable in bug fix releases except in very special cases. I believe we should document that the behavior will change in the User Guide, though, and also mention that as a deprecation in RF 7.5.1 release notes. That requires a separate issue.

Activity

  1. pekkaklarck commented on Oct 5, 2026

    @pekkaklarck
    MemberAuthor

    I believe we should implement this so that --specdocformat gets a new value AUTO that is used by default. It should work like this:

    1. Markdown docs are preserved regardless the spec format.
    2. When using spec files in JSON or LIBSPEC format, convert non-Markdown docs to HTML.
    3. When using XML spec files, preserve documentation format.

    These semantics are pretty complicated and it would be simpler to never convert docs to HTML by default. That would, however, be a backwards incompatible change affecting a much bigger amount of existing users than not converting Markdown docs.

  2. added this to the v7.6 milestone on Oct 5, 2026
  3. pekkaklarck commented on Oct 5, 2026

    @pekkaklarck
    MemberAuthor

    Another benefit of this change is that it avoids the need to have the markdown module installed if a library uses Markdown. That's especially important with standard libraries (#5788).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions