Repository navigation
Description
This would in practice mean that if you have a Markdown file example.md with the below content, you could execute it with robot example.md and the test would be run.
This is just some text, *not* Robot data.
```robotframework
*** Test Cases ***
Example
Log This is Robot data!
```
More free text here. There could be additional code block with more Robot data as well.
We support this with reStructuredText, but I'm not sure how widely used the support is. With reST this works so that our custom reST parser finds all Robot Framework code blocks and then feeds them to normal Robot parser. The same approach would likely work here as well, but I believe the Markdown parser would be really simple. If we limit this support only to code blocks starting with the ```robotframework header, the parser wouldn't even need to use any Markdown module. It could just go through lines one-by-one, search for the header, and store content between these headers and closing triple backticks.
When executing a directory like robot example, possible *.md files in it shouldn't be parsed by default, but it should be possible to use --extension or --parse-include options to change that. We also should automatically parse possible *.robot.md files. These are the same semantics we use with reStructuredText files.
Implementing this using the existing reStructuredText parser as an example would be pretty simple, but getting everything done, tested and documented is a relatively large task. Because this doesn't need deep knowledge about Robot's internals, this would be a very good issue for someone interested to contribute. I'll assign this tentatively to RF 7.5 scope that already has other Markdown related enhancements (#5304, #5602).
Notice that we already have #2610 about this topic. That issue has also proposed other Markdown related enhancement and its description is not that clear, though, so I decided to submit a new one and close the earlier as a duplicate.
Activity
feat: Add initial infrastructure for Markdown test data support (robo…
feat: Allow importing Markdown files as resources (robotframework#5603)
feat: Implement native Markdown support for suites and resources (rob…
test: Add acceptance tests suite for Markdown support (robotframework…
test: Add comprehensive unit tests for Markdown reader (robotframewor…
style: Align code formatting with project conventions (robotframework…
seto commentedon Mar 23, 2026
Hello, I have implemented native support for Markdown (.md, .markdown, and .robot.md) for both test suites and resources. The implementation follows the same architectural pattern as the existing RST support, including a dependency-free reader to extract fenced code blocks.
You can find the implementation and the relative acceptance/unit tests in PR #5633.
Feedback and reviews are more than welcome!
pekkaklarck commentedon Mar 24, 2026
Thanks for the PR! I commented it briefly.
pekkaklarck commentedon Mar 26, 2026
I took a bit more detailed look at the code changes in the PR and they look pretty good. I especially like how little new code is needed.
While reviewing the changes, I remembered that I've seen different ways to start fenced code blocks. I studied that a bit and you can see what the CommonMark spec says about them here. I don't think we need to support absolutely everything that spec says, but at least these are something we should consider:
~~~robotframeworkin the code fence. They cannot be mixed within a single fence, though, and the closing fence must use same character as the opening fence.~~~ robotframeworkis allowed.~~~ robot start=3is allowed. We probably can ignore all other parts than the first one.Supporting the above makes the implementation a bit more complicated, but it shouldn't be too bad. Most likely using a regex would be easiest. It's probably easiest to test this using unit tests and in acceptance tests just use some of the variants.
25 remaining items
seto commentedon Apr 23, 2026
I’ve just pushed the documentation for this feature.
I updated all the related files I found and followed the same structure as the reST support to maintain consistency, and I also updated RobotFrameworkUserGuide.rst to include references to Markdown and the CommonMark spec.
Let me know how it looks. I'm happy to refine it further or add more examples regarding code fences if you think it's necessary.
Minor enhancements to Markdown format docs.
Document Markdown support for tests (robotframework#5659)
pekkaklarck commentedon Apr 28, 2026
Thanks for the docs @seto!
seto commentedon Apr 28, 2026
My pleasure! Glad to help.
[-]Support embeddding tests/tasks to Markdown files[/-][+]Support embedding tests/tasks to Markdown files[/+]markdown as living documentation (#5735)
Enhance docs related to living documentation
pekkaklarck commentedon Aug 10, 2026
Thanks @JFoederer for PR #5735 that enhanced the docs related to this functionality by adding a section about living documentation. I especially like the tip to use Markdown comments to hide technical details from HTML.