Document that Libdoc's DocumentationBuilder
expects .robot
files to be suite files, not resource files
#4517
Labels
DocumentationBuilder
expects .robot
files to be suite files, not resource files
#4517
RF 6.0 made is possible to generate keyword documentation for suite files, not only libraries and resource files (#4493). As the result Libdoc's
DocumentationBuilder
factory method nowadays returnsSuiteDocBuilder
, notResourceDocBuillder
, for all files with the.robot
extension. This causes problems with resource files having.robot
extension becauseSuiteDocBuilder
only works with suite files.We have few different approaches how to handle this change:
DocumentationBuilder
so that it would actually parse.robot
files to see are they suite or resource files instead of only looking at the extension. This would basically mean we always parse these files twice, but I doubt it would have a significant performance penalty. The main reason I don't like this too much is that the factory method already earlier didn't handle resource files that are imported from PYTHONPATH correctly and that special case needs to be anyway handled later.SuiteDocBuilder
so that it works also with resource files. Feels a bit strange for me.ResourceDocBuilder
explicitly with resource files.My current thinking is that option 3. is adequate even though it doesn't actually fix the issue. This is why I believe so:
LibraryDocumentation
factory method instead ofDocumentationBuilder
. The former method uses the latter and handles different special cases like a resource file with the.robot
extension..resource
extension instead of.robot
.ResourceDocBuilder
explicitly.Let me know in the comments if you have concrete needs to use
DocumentationBuilder
directly that would benefit from it handling.robot
files better.The text was updated successfully, but these errors were encountered: