Skip to content

Convert OperatingSystem documentation to Markdown - #5710

Merged
pekkaklarck merged 3 commits into
robotframework:masterfrom
coyaSONG:docs/operating-system-markdown
Sep 9, 2026
Merged

pekkaklarck merged 3 commits into
robotframework:masterfrom
coyaSONG:docs/operating-system-markdown

Conversation

@coyaSONG

Copy link
Copy Markdown
Contributor

What

  • Convert the OperatingSystem library and keyword documentation to Markdown.
  • Add structured Args and Returns documentation for all exposed keyword arguments and typed return values.
  • Convert Robot Framework documentation tables, links, headings, and examples to Markdown equivalents.
  • Add a Libdoc regression test that prevents undocumented arguments and return values.
  • Update the OperatingSystem acceptance-test expectation for the converted deprecation link.

Why

This is the OperatingSystem-only part of #5709. It does not touch Dialogs, Screenshot, String, DateTime, or Collections.

How

The library now declares ROBOT_LIBRARY_DOC_FORMAT = "Markdown". Existing documentation content and behavior are preserved while syntax is converted, and exception behavior remains in the prose where separate Raises entries would be redundant.

Testing

  • invoke format on the three changed files
  • invoke library-docs OperatingSystem
  • Libdoc API unit tests: 6 passed
  • Full Libdoc unit tests: 48 passed
  • OperatingSystem acceptance tests: 279 passed
  • Libdoc acceptance tests: 437 passed
  • Generated JSON: 56 keywords, 0 undocumented arguments, 0 undocumented typed returns
  • AST comparison: implementation unchanged apart from documentation and the documentation-format declaration

AI assistance

OpenAI Codex assisted with the documentation conversion, tests, and validation. I reviewed the resulting diff and verification evidence.

@pekkaklarck pekkaklarck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good in general! There are some recurring issues with examples, Args/Returns placement and linking to other libraries as well as some other smallish issues.

Are you @coyaSONG around so that you can take a look at my comments and fix the issues? If you are busy, I can also merge this PR in its current format and me or someone else can fix the problems.

Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread src/robot/libraries/OperatingSystem.py Resolved
Comment thread utest/libdoc/test_libdoc_api.py Resolved
@pekkaklarck

Copy link
Copy Markdown
Member

Did you @coyaSONG notice the review? It would be great if you could take a look at my comments. If you don't have time for that, you could just remove the draft status from this PR and we can make those adjustments ourselves.

# Conflicts:
#	src/robot/libraries/OperatingSystem.py
@coyaSONG

Copy link
Copy Markdown
Contributor Author

@pekkaklarck The follow-up at 5deb3e4 addresses the review feedback: Markdown formatting and reference targets were corrected, Args/Returns were moved after the short descriptions, all keyword examples now include test-case headers and names, the encoding-error documentation link was added, and the cross-platform path examples now carry the Windows-result note. I also rechecked the current head and resolved the addressed threads. When convenient, could you please re-review? The PR remains draft until you confirm the documentation direction.

@coyaSONG
coyaSONG marked this pull request as ready for review August 29, 2026 22:56

@pekkaklarck pekkaklarck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good! I added some comments so please take a look at them.

| `[chars]` | One character in the bracket |
| `[!chars]` | One character not in the bracket |
| `[a-z]` | One character from the range in the bracket |
| `[!a-z]` | One character not from the range in the bracket |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Columns should be aligned to make source look better.

[Regexp Escape]: https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Regexp%20Escape "BuiltIn.Regexp Escape"
[Should Be Equal]: https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Should%20Be%20Equal "BuiltIn.Should Be Equal"
[Should Be Equal As Integers]: https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Should%20Be%20Equal%20As%20Integers "BuiltIn.Should Be Equal As Integers"
[Log]: https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Log "BuiltIn.Log"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With other libraries we have decided that when referring to external keywords, we only link to the library, not to individual keywords. As an example, see the Collections library.

*** Test Cases ***
Run And Return RC And Output
${rc} ${output} = Run and Return RC and Output ${CURDIR}${/}mytool
Should Be Equal As Integers ${rc} 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With other libraries we've decided to use

Should Be Equal    ${rc}    0    type=int

style instead of Should Be Equal As Integers. That works especially well in cases like this where arguments are aligned based on the longest keyword name.

@{p3} = Join Paths my/base example/path/ other one/more
Should Be Equal ${p1} ${{['base/example', 'base/other']}}
Should Be Equal ${p2} ${{['/example', '/my/base/other']}}
Should Be Equal ${p3} ${{['my/base/example/path', 'my/base/other', 'my/base/one/more']}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline Python evaluation syntax is somewhat complex. Using the newish type conversion functionality with Should Be Equal would allows this style that would probably be cleaner:

Should Be Equal    ${p1}    ['base/example', 'base/other']    type=list

@pekkaklarck

Copy link
Copy Markdown
Member

I took a pretty quick look at this and didn't see major problems. It would be great if you could fix the few issues I reported, but I think this could be merged already in this shape. I anyway need to take the final look locally so that I can also see how the generated docs look like.

Could you @Vinni82 take a look do you see something that could be fixed/enhanced based on the PRs you've worked with earlier?

@pekkaklarck

Copy link
Copy Markdown
Member

There has been no reaction to my latest review comments, but I consider this to be in good enough shape to be merged. @Vinni82 can do more enhancements after that, including fixing the issues I mentioned, and I'll do a final cleanup after that.

@pekkaklarck
pekkaklarck merged commit de97323 into robotframework:master Sep 9, 2026
8 checks passed
pekkaklarck pushed a commit that referenced this pull request Sep 13, 2026
- Addressed review comments on PR #5710
- Reworked the deprecated messages
- Corrected the indentation

Part of #5709.

---------

Co-authored-by: Vincent <[email protected]>
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.

2 participants