diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2022-11-22 20:27:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 20:27:15 +0300 |
commit | 0aba659891f5947d9b55ce7c70aa4d7209369717 (patch) | |
tree | 465b5630d84129c86333f79c205722127d1fc564 /doc/tools | |
parent | e3a51e53ef055a1fe94351b68173c6dfcd2cb371 (diff) | |
parent | a5e5f1aa501fe43816d29c6aab403fd68ad7d634 (diff) |
Merge pull request #68848 from Piralein/fix-class-ref
Fix warnings in class ref
Diffstat (limited to 'doc/tools')
-rwxr-xr-x | doc/tools/make_rst.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 9fb60511ae..e5a0bbb008 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -1068,12 +1068,11 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: for i, m in enumerate(method_list): if index != 0: f.write("----\n\n") - - if i == 0: - f.write( - f".. _class_{class_name}_operator_{sanitize_operator_name(m.name, state)}_{m.return_type.type_name}:\n\n" - ) - + out = f".. _class_{class_name}_operator_{sanitize_operator_name(m.name, state)}" + for parameter in m.parameters: + out += f"_{parameter.type_name.type_name}" + out += f":\n\n" + f.write(out) ret_type, signature = make_method_signature(class_def, m, "", state) f.write(f"- {ret_type} {signature}\n\n") @@ -1179,7 +1178,10 @@ def make_method_signature( if isinstance(definition, MethodDef) and ref_type != "": if ref_type == "operator": op_name = definition.name.replace("<", "\\<") # So operator "<" gets correctly displayed. - out += f":ref:`{op_name}<class_{class_def.name}_{ref_type}_{sanitize_operator_name(definition.name, state)}_{definition.return_type.type_name}>` " + out += f":ref:`{op_name}<class_{class_def.name}_{ref_type}_{sanitize_operator_name(definition.name, state)}" + for parameter in definition.parameters: + out += f"_{parameter.type_name.type_name}" + out += f">` " else: out += f":ref:`{definition.name}<class_{class_def.name}_{ref_type}_{definition.name}>` " else: |