Skip to content

Libdoc: Preserve Markdown docs in spec files by default - #5841

Open
gaurav0107 wants to merge 1 commit into
robotframework:masterfrom
gaurav0107:fix/5808-libdoc-don-t-convert-markdown-to-html-wh
Open

gaurav0107 wants to merge 1 commit into
robotframework:masterfrom
gaurav0107:fix/5808-libdoc-don-t-convert-markdown-to-html-wh

Conversation

@gaurav0107

Copy link
Copy Markdown

Fixes #5808.

This adds a new AUTO value to --specdocformat and makes it the default, following the design in the issue comments:

  1. Markdown documentation is preserved regardless the spec format.
  2. With JSON and LIBSPEC outputs, documentation in other formats is converted to HTML.
  3. With XML outputs, the original documentation format is preserved.

RAW and HTML work as before. The programmatic libdoc() API uses the same default when specdocformat is not given. Because nothing is converted, generating JSON or *.libspec specs for Markdown libraries (including the standard libraries) no longer needs the markdown module.

For example, libdoc String String.json and libdoc String String.libspec now have docFormat/format MARKDOWN instead of HTML. Use --specdocformat HTML to keep converting Markdown to HTML.

Docs:

  • libdoc --help and the libdoc() docstring describe AUTO.
  • The User Guide "Documentation format in spec files" section now describes the new default instead of the planned change, with a note about the behavior before RF 7.6. The libspec and JSON spec sections were adjusted to match.

Tests:

  • New acceptance tests XML/AUTO output, LIBSPEC/AUTO output and JSON/AUTO output in libdoc/doc_format.robot, covering Robot, HTML and Markdown source formats with the default and explicit -s AUTO.
  • libdoc/cli.robot: the *.libspec default test now uses a Robot-format library, plus new cases for Markdown with *.libspec and explicit --specdocformat AUTO.
  • libdoc/doc_string.robot: the JSON HTML-docs tests pass --spec-doc-format HTML explicitly, and a new test checks that Markdown is preserved by default.
  • libdoc/invalid_usage.robot: updated error message.
  • Unit test TestLibdoc.test_specdocformat for the programmatic API.

Ran python atest/run.py --exclude no-ci atest/robot/libdoc (464 passed) and python utest/run.py (all passed) on Python 3.12, plus ruff check on src atest utest.


🤖 Opened with Superhuman, an open-source contribution agent.

Add new `AUTO` value for `--specdocformat` and use it by default.
With it Markdown documentation is preserved regardless the spec format.
Documentation in other formats is converted to HTML with JSON and
LIBSPEC outputs and preserved with XML outputs, as earlier.

Fixes robotframework#5808.
@gaurav0107
gaurav0107 marked this pull request as ready for review November 2, 2026 00:26

This branch has not been deployed

No deployments
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.

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

1 participant