Python sphinx 链接到字符串的定义

Python sphinx 链接到字符串的定义,python-sphinx,Python Sphinx,我正在记录一个API。API包括通过websocket连接发送特定格式的JSON数据。下面是一个例子 我的问题是,是否有任何方法可以将这些消息类型中的每一种作为Sphinx中的对象进行链接,就像我使用类或函数(如 :py:func:`json.dumps` 哪个会自动为我生成链接 The client must be able to handle all of these sorts of messages. It should fail gracefully without making a

我正在记录一个API。API包括通过websocket连接发送特定格式的JSON数据。下面是一个例子

我的问题是,是否有任何方法可以将这些消息类型中的每一种作为Sphinx中的对象进行链接,就像我使用类或函数(如

:py:func:`json.dumps`
哪个会自动为我生成链接

The client must be able to handle all of these sorts of messages.
It should fail gracefully without making any changes if the format of the data is not correct.

display_message
    Display a message string to the user::

        'data' : {'message' : 'Message text'}

game_list
    Sends a list of games that the logged in user is participating in.
    The client should display this, get the user to choose one and then respond with a *choose_game* message.::

        'data' : {
        'id' : 'white'
        'id' : 'black' ...}

set_square_piece
    This is the main message for dealing with the board::

        'data' : {
        'piece_colour' : str, #must be either 'white' or 'black'
        'square_name' : str, #from 'a1' to 'h8'
        'piece_type' : str, # e.g 'queen'
        }
也许(或定制的)或a会满足您的需求