You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Creating multiline documentation from CLI using \n like --doc line1\nline2 doesn't work #3981
I would like to add documentation using -D --doc arguments on multiple lines using command line.
rebot/robot help says
-D --doc documentation Set the documentation of the top level suite. Simple formatting is supported (e.g. bold). If the
documentation contains spaces, it must be quoted.
According to manual, simple formatting includes new line management using \n, but it does not work.
Using -D "line1\nline2"
results in line1\nline2
beeing displayed in the documentation instead of
line1
line2
I've tried <br> instead of \n, using an argument file, but behavior is the same.
This was tested with versions 3.2.2 and 4.0.2.
I have not tested all features of "simple formatting"
Aside from fixing what I think is a bug/limitation, having the possibility to include a file formated like the documentation section of the *** settings *** could show some usefullness.
Use case:
I'm merging different files, I would like to have in the documentation field, on separate lines (for readability) links to the individual files.
changed the title [-]rebot --doc does not allow all "simple formating" features[/-][+]Creating multiline documentation from CLI using `\n` like `--doc line1\nline2` doesn't work[/+]on May 24, 2021
Simple formatting like --doc "*Example* doc" works in general but using \nclearly doesn't. The reason is that the code explicitly escapes` so \n becomes \\n which is then rendered like \n. Escaping like this feels odd, but because it may have a reason I don't want to change it now in RF 4.0.3. I'll assign this to RF 4.1 scope so that we have more time to investigate this.
I agree reading documentation from an external file would be handy. A simple approach would be making it possible to use --doc example.txt and reading the doc from the example.txt file if it exists. Ought to be easy to implement and should be pretty safe from backwards compatibility point of view as well. It's very unlikely someone would use just a path to an existing file as a documentation. Please submit a separate issue about this.
Notice that the terminal/shell you use may support this functionality as well. For example, with Bash you can use --doc "$( < example.txt)" and the doc will be read from example.txt. Built-in functionality that works regardless the terminal would nevertheless be handy.
Activity
[-]rebot --doc does not allow all "simple formating" features[/-][+]Creating multiline documentation from CLI using `\n` like `--doc line1\nline2` doesn't work[/+]pekkaklarck commentedon May 24, 2021
Simple formatting like
--doc "*Example* doc" works in general but using\nclearly doesn't. The reason is that the code explicitly escapes` so\nbecomes\\nwhich is then rendered like\n. Escaping like this feels odd, but because it may have a reason I don't want to change it now in RF 4.0.3. I'll assign this to RF 4.1 scope so that we have more time to investigate this.pekkaklarck commentedon May 24, 2021
I agree reading documentation from an external file would be handy. A simple approach would be making it possible to use
--doc example.txtand reading the doc from theexample.txtfile if it exists. Ought to be easy to implement and should be pretty safe from backwards compatibility point of view as well. It's very unlikely someone would use just a path to an existing file as a documentation. Please submit a separate issue about this.Notice that the terminal/shell you use may support this functionality as well. For example, with Bash you can use
--doc "$( < example.txt)"and the doc will be read fromexample.txt. Built-in functionality that works regardless the terminal would nevertheless be handy.lesnake commentedon May 25, 2021
All this would be perfect.
Using bash redirection is a nice trick, but we also have to take care about people who don't even understand what we are talking about ;)
Here is the truth : In a future mission I may work on MS environment, so this is also self centered.
pekkaklarck commentedon Jun 7, 2021
Noticed we already have #3860 about this. Closing this issue as its duplicate.