-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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.