简体   繁体   English

Python函数中的reStructuredText未显示在Robot Framework集线器中

[英]reStructuredText in Python functions not displaying in Robot Framework hub

My sample Python module for robotframework looks like this. 我的用于机器人框架的示例Python模块如下所示。

ROBOT_LIBRARY_DOC_FORMAT = 'reST'

def foo (a, b):
    """Produces bar.

    :param ``a``: this is a.
    :param ``b``: this is b.
    """

But then using the rfhub Web app to view in browser, param a and b are smashed onto one line, and it looks like it is coming out as the wiki style. 但是,然后使用rfhub Web应用程序在浏览器中查看时,参数a和b粉碎到了一行,看起来就像是Wiki样式一样。 Is reST supported in rfhub? rfhub支持reST吗? See below screen shot. 请参阅下面的屏幕截图。

user@ubuntu-01:~$ python -m rfhub ./test-project/testcases
tornado web server running on http://127.0.0.1:7070

rfhub_example_helloworld rfhub_example_helloworld

My suspicion at this point is that it is simply not supported by robotframework hub. 我现在的怀疑是robotframework hub根本不支持它。

To doublecheck it, I did this: 要仔细检查,我这样做:

user@ubuntu-01:~$ python -m robot.libdoc ./test-project/testcases/HelloWorld.py testdoc.html user @ ubuntu-01:〜$ python -m robot.libdoc ./test-project/testcases/HelloWorld.py testdoc.html

where the HelloWorld.py was: HelloWorld.py在哪里:

ROBOT_LIBRARY_DOC_FORMAT = 'reST' 

def foo(a, b): 
    """Produces bar. 

    :param ``a``: this is a. 
    :param ``b``: this is b. 
    """ 
    return "bar" 

def foo2(a, b): 
    """Also produces bar. 

    :a: this is a. 
    :b: this is b. 
    """ 
    return "bar" 

Above produces this output in my browser: 上面在我的浏览器中产生以下输出:

libdoc_output_restructuredtext libdoc_output_restructuredtext

Which shows the fields are broken onto separate lines as I expect for reStructuredText. 如我期望的那样,该字段显示了将字段分解成单独的几行。 If I comment out the ROBOT_LIBRARY_DOC_FORMAT line, that no longer works. 如果我注释掉ROBOT_LIBRARY_DOC_FORMAT行,它将不再起作用。 I'll add a similar screenshot to my original question showing the issue in robotframework hub. 我将向原始问题添加类似的屏幕快照,以在robotframework hub中显示该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM