最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Pythonic Doxygen function signature rendering - Stack Overflow

programmeradmin2浏览0评论

given the python function:

    @staticmethod
    def check_for_conflicting_method(
            this_scope: Scope, target_scope: Scope, new_function: Asts.FunctionPrototypeAst,
            conflict_type: FunctionConflictCheckType)\
            -> Optional[Asts.FunctionPrototypeAst]:

        """!
        Check for conflicting methods between the new function, and functions in the type scope. This function has two
        uses:
            * Check if an overload conflicts with an existing overload in the same type.
            * Check if a method is overriding a base class method (ie there is a signature conflict).

        @param this_scope The scope of the new function being checked.
        @param target_scope The scope to check for conflicts in (for example a class).
        @param new_function The new function AST (its scope is @p this_scope).
        @param conflict_type The type of conflict to check for: overload or override.

        @return A conflicting function if one is found, or None if no conflict is found.
        """

the Doxygen render is:

i'd like, at the very least, for the render to look like:

Optional[Asts.FunctionPrototypeAst]
check_for_conflicting_method(
    Scope this_scope,
    Scope target_scope,
    Asts.FunctionPrototypeAst new_function,
    FunctionConflictCheckType conflict_type)

or even better:

check_for_conflicting_method(
    this_scope: Scope,
    target_scope: Scope,
    new_function: Asts.FunctionPrototypeAst,
    conflict_type: FunctionConflictCheckType)
    -> Optional[Asts.FunctionPrototypeAst]

but i'm not too bothered about if the trailing types. really i'd just like a newline between the return type and function name, and every parameter on a newline, tabbed in.

i've tried a variety of css options with table.memname td.funcname/memproto/params/sig-parm/sig-return/tr etc but haven't found suitable css for moving all the parameters onto newlines with a visible indentation.

table.memname td.funcname {
    display: block;
    font-weight: bold;
    padding-bottom: 5px;
}

table.memname tr {
    display: block;
    margin-bottom: 5px;
}

brings the parameters, except for the first one, onto new lines, but without an indentation, but i'm not sure where to go from here.

发布评论

评论列表(0)

  1. 暂无评论