11. Reference - Rendering Showcase¶
This chapter is primarily a reference showcase for the Sphinx rendering
layer. The Waterloo project itself is best understood as a toolkit
consisting of waterlint, the Pygments lexer, the MCP server,
and the VSCode extension.
Most users will not import the internal docitem*.py modules
directly in their own projects. Those modules are implementation details
of the toolkit and are documented here mainly so the rendered API can be
inspected in a structured form.
11.1. Module docitem¶
|
|
|
|
|
|
|
is_obj_module, is_obj_class, is_obj_function, is_obj_method_like, is_attr_annotated, is_attr_final, get_obj_name, get_obj_path, get_obj_annotations, resolve_object, get_status, get_profile, get_num_indent, parse_indent_docstring, get_tree_of_section, get_tree_of_subsection, get_scopes_of_tree_var, to_string_tree, validate_docstring_method, validate_docstring_inherited_method, validate_docstring_class, validate_docstring_module, validate_docstring, validate_class_class_coverage, validate_class_method_coverage, validate_class_constant_coverage, validate_class_variable_coverage, validate_class_coverage, validate_module_class_coverage, validate_module_function_coverage, validate_module_type_coverage, validate_module_constant_coverage, validate_module_variable_coverage, validate_module_coverage, gen_documentable_objects, make_docitem_tree |
|
|
|
tracer, docitem_base, docitem_list_base, docitem_map_base, docitem_free_text_entry_base, docitem_list_of_symbols_base, docitem_profile, docitem_normative_sections, docitem_status, docitem_preamble, docitem_constructor, docitem_general, docitem_invariants, docitem_requires, docitem_ensures, docitem_base_to_inherit_from, docitem_traits, docitem_contract_module, docitem_contract_class, docitem_contract_method, docitem_contract_inherited_method, docitem_derived_from, docitem_factory_functions, docitem_factory, docitem_class_overview_entry, docitem_class_overview, docitem_public_types_entry, docitem_public_types, docitem_public_assignables_entry, docitem_public_assignables_base, docitem_method_overview_entry, docitem_method_overview, docitem_function_overview_entry, docitem_function_overview, docitem_returns, docitem_parameters_entry, docitem_parameters, docitem_raises_entry, docitem_raises, docitem_definitions_entry, docitem_definitions, docitem_terminology_entry, docitem_terminology, docitem_notes_entry, docitem_notes, docitem_description, docitem_see_also, docitem_docstring_base, docitem_docstring_module, docitem_docstring_class, docitem_docstring_method, docitem_docstring_inherited_method, Scope, Flavour, Format, Status |
|
|
|
|
|
|
Module |
sdv.doc.waterloo.docitem |
|---|
11.1.1. Fundamental helpers¶
11.1.1.1. get_obj_name¶
|
sdv.doc.waterloo.docitem_helper.get_obj_name(
obj: object
) -> str
|
|
|
|
|
|
|
|
The resolved name according to the defined hierarchy. |
|
<empty> |
|
Last review 2026-06-22 Limitations This helper is best-effort and object-local. It does not reconstruct containment context for nested instances. Behavior for property-like descriptors such as |
|
|
Function |
get_obj_name |
|---|
11.1.1.2. get_obj_fully_qualified_name¶
|
sdv.doc.waterloo.docitem_helper.get_obj_fully_qualified_name(
obj: object
) -> str
|
|
|
|
|
|
|
|
Best-effort fully qualified object name. |
|
<empty> |
|
Last review 2026-06-23 Limitations Behavior for property-like descriptors such as |
Function |
get_obj_fully_qualified_name |
|---|
11.1.1.3. get_obj_path¶
|
sdv.doc.waterloo.docitem_helper.get_obj_path(
obj: object
) -> str | None
|
|
|
|
|
|
|
|
Absolute path string or |
|
<empty> |
|
Last review 2026-02-05 |
Function |
get_obj_path |
|---|
11.1.1.4. get_obj_docstring¶
|
sdv.doc.waterloo.docitem_helper.get_obj_docstring(
obj: object
) -> str
|
|
|
|
|
|
|
|
|
|
<empty> |
|
Last review 2026-05-15 General The object-level cache avoids repeating the wrapper walk for the same object. |
Function |
get_obj_docstring |
|---|
11.1.1.5. get_obj_annotations¶
|
sdv.doc.waterloo.docitem_helper.get_obj_annotations(
obj: object
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A |
|
|
|
Result The returned object mostly results from |
Function |
get_obj_annotations |
|---|
11.1.1.6. is_obj_module¶
|
sdv.doc.waterloo.docitem_helper.is_obj_module(
obj: object
) -> TypeIs[ModuleType]
|
|
|
|
|
|
|
|
|
|
|
|
Purpose Uniform wrapper, allows us to add debugging output or hooks in case of trouble. |
Function |
is_obj_module |
|---|
11.1.1.7. is_obj_class¶
|
sdv.doc.waterloo.docitem_helper.is_obj_class(
obj: object
) -> TypeIs[type[object]]
|
|
|
|
|
|
|
|
|
|
|
|
Purpose Uniform wrapper, allows us to add debugging output or hooks in case of trouble. |
Function |
is_obj_class |
|---|
11.1.1.8. is_obj_function¶
|
sdv.doc.waterloo.docitem_helper.is_obj_function(
obj: object
) -> TypeIs[Callable[…, Any]]
|
|
|
|
|
|
|
|
|
|
|
|
Purpose Uniform wrapper, allows us to add debugging output or hooks in case of trouble. |
Function |
is_obj_function |
|---|
11.1.1.9. is_obj_method_like¶
|
sdv.doc.waterloo.docitem_helper.is_obj_method_like(
obj: object
) -> TypeIs[Callable[…, Any]]
|
|
|
|
|
|
|
|
|
|
<empty> |
Function |
is_obj_method_like |
|---|
11.1.1.10. is_obj_documentable¶
|
sdv.doc.waterloo.docitem_helper.is_obj_documentable(
obj: object
) -> TypeIs[Documentable]
|
|
|
|
|
|
|
|
|
|
<empty> |
|
Last review 2026-06-22 Documentable vs. non-documentable objects Only modules, classes, and functions are considered documentable for Waterloo docstring generation and validation. Accordingly, sections like |
Function |
is_obj_documentable |
|---|
11.1.1.11. is_obj_named_value¶
|
sdv.doc.waterloo.docitem_helper.is_obj_named_value(
obj: object
) -> TypeIs[Callable[…, Any]]
|
|
|
|
|
|
|
|
|
|
|
|
Purpose Uniform wrapper, allows us to add debugging output or hooks in case of trouble. |
Function |
is_obj_named_value |
|---|
11.1.1.12. get_func_obj_from_callable¶
|
sdv.doc.waterloo.docitem_helper.get_func_obj_from_callable(
obj: object
) -> Callable[…, Any] | None
|
|
|
|
|
|
|
|
The function object (or built-in) assigned to |
|
<empty> |
|
API The signature is stable, but we might add cases to the implementation. |
Function |
get_func_obj_from_callable |
|---|
11.1.2. Typechecking helpers¶
11.1.2.1. is_attr_annotated¶
|
sdv.doc.waterloo.docitem_helper.is_attr_annotated(
obj: AnnotatableObject
attr: str
) -> bool
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-02-04 |
Function |
is_attr_annotated |
|---|
11.1.2.2. is_attr_final¶
|
sdv.doc.waterloo.docitem_helper.is_attr_final(
obj: AnnotatableObject
attr: str
) -> bool
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-02-04 |
Function |
is_attr_final |
|---|
11.1.3. Tokenizer functions¶
11.1.3.1. get_num_indent¶
|
sdv.doc.waterloo.docitem_tokenizer.get_num_indent(
tr: tracer
line: str
indent_scheme: int
) -> int
|
|
|
|
|
|
|
|
|
|
|
|
|
Function |
get_num_indent |
|---|
11.1.3.2. parse_indent_docstring¶
|
sdv.doc.waterloo.docitem_tokenizer.parse_indent_docstring(
tr: tracer
text: str
session: DocSession
) -> DocstringTree
|
|
|
|
|
|
|
|
This section is normative. The state engine consists of the following components: 1. A 2. A stack the elements of which point to 3. An integer variable For each incoming line, processed sequentially, the following happens: If the indentation level remains unchanged, the line is appended to the substree represented by the top element of |
|
|
|
|
|
|
Function |
parse_indent_docstring |
|---|
11.1.3.3. resolve_object¶
|
sdv.doc.waterloo.docitem_validator.resolve_object(
ref: str
current_obj: object
) -> tuple[object, str]
|
|
|
|
|
|
|
|
|
|
|
|
|
Function |
resolve_object |
|---|
11.1.4. AST properties¶
11.1.4.1. get_status¶
|
sdv.doc.waterloo.docitem_validator.get_status(
tr: tracer
obj: object
top: docitem_docstring_base
) -> str
|
|
|
|
|
|
|
|
The documented object status or its default. |
|
<empty> |
|
Status Function may be renamed soon. |
Function |
get_status |
|---|
11.1.5. Per-object validators¶
11.1.5.1. validate_docstring_method¶
|
sdv.doc.waterloo.docitem_validator.validate_docstring_method(
tr: tracer
obj: Callable[…, Any]
top: docitem_docstring_method
node_contract: docitem_map_base
node_normative_sections: docitem_list_base
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
Usage This function is typically not called directly. Please call |
Function |
validate_docstring_method |
|---|
11.1.5.2. validate_docstring_class¶
|
sdv.doc.waterloo.docitem_validator.validate_docstring_class(
tr: tracer
obj: object
top: docitem_docstring_class
node_contract: docitem_map_base
node_normative_sections: docitem_list_base
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
Usage This function is typically not called directly. Please call Last review 2026-01-23 |
Function |
validate_docstring_class |
|---|
11.1.5.3. validate_docstring_module¶
|
sdv.doc.waterloo.docitem_validator.validate_docstring_module(
tr: tracer
obj: object
top: docitem_docstring_module
node_contract: docitem_map_base
node_normative_sections: docitem_list_base
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
Usage This function is typically not called directly. Please call Last review 2026-01-23 |
Function |
validate_docstring_module |
|---|
11.1.5.4. validate_docstring¶
|
sdv.doc.waterloo.docitem_validator.validate_docstring(
tr: tracer
obj: object
top: docitem_docstring_base | None
session: DocSession
) -> docitem_docstring_base
|
|
|
|
|
|
|
|
|
|
|
|
Usage This function should be pretty easy to use, if you leave out parameter |
|
|
Function |
validate_docstring |
|---|
11.1.6. Coverage validators¶
11.1.6.1. validate_class_class_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_class_class_coverage(
tr: tracer
obj: type[object]
doc_class: docitem_docstring_class
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-02-04 |
Function |
validate_class_class_coverage |
|---|
11.1.6.2. validate_class_method_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_class_method_coverage(
tr: tracer
obj: type[object]
doc_class: docitem_docstring_class
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-02-04 |
Function |
validate_class_method_coverage |
|---|
11.1.6.3. validate_class_constant_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_class_constant_coverage(
tr: tracer
obj: type[object]
doc_class: docitem_docstring_class
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
Function |
validate_class_constant_coverage |
|---|
11.1.6.4. validate_class_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_class_coverage(
tr: tracer
obj: type[object]
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
todo Missing: class-type-coverage. |
Function |
validate_class_coverage |
|---|
11.1.6.5. validate_module_class_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_module_class_coverage(
tr: tracer
obj: ModuleType
doc_module: docitem_docstring_module
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-02-04 |
Function |
validate_module_class_coverage |
|---|
11.1.6.6. validate_module_function_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_module_function_coverage(
tr: tracer
obj: ModuleType
doc_module: docitem_docstring_module
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-02-04 |
Function |
validate_module_function_coverage |
|---|
11.1.6.7. validate_module_type_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_module_type_coverage(
tr: tracer
obj: ModuleType
doc_module: docitem_docstring_module
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
Function |
validate_module_type_coverage |
|---|
11.1.6.8. validate_module_constant_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_module_constant_coverage(
tr: tracer
obj: ModuleType
doc_module: docitem_docstring_module
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
Function |
validate_module_constant_coverage |
|---|
11.1.6.9. validate_module_variable_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_module_variable_coverage(
tr: tracer
obj: ModuleType
doc_module: docitem_docstring_module
session: DocSession
) -> None
|
|
|
|
|
|
|
|
|
|
|
Function |
validate_module_variable_coverage |
|---|
11.1.6.10. validate_module_coverage¶
|
sdv.doc.waterloo.docitem_validator.validate_module_coverage(
tr: tracer
obj: ModuleType
) -> None
|
|
|
|
|
|
|
|
|
|
|
Function |
validate_module_coverage |
|---|
11.1.7. Additional helpers¶
11.1.7.1. gen_documentable_objects¶
|
sdv.doc.waterloo.docitem_helper.gen_documentable_objects(
obj: Documentable
config: ConfigTraversal = ConfigTraversal()
) -> Generator[Documentable, None, None]
|
|
|
|
|
|
|
|
|
|
<empty> |
Function |
gen_documentable_objects |
|---|
Example
import sdv.doc.waterloo.docitem as wtrl
import importlib
import sys
def main(mod_name: str) -> None:
# Configure traversal
cfg = wtrl.ConfigTraversal()
# Allow recursive traversal
cfg.enable_include_imported()
# Open module
mod = importlib.import_module(mod_name)
# Iterate over documentable objects
objs = wtrl.gen_documentable_objects(mod,cfg)
for obj in objs:
print(wtrl.get_obj_name(obj))
if __name__ == "__main__":
main("pytest_good_inheritance")
11.1.7.2. get_tree_of_section¶
|
sdv.doc.waterloo.docitem_tokenizer.get_tree_of_section(
tr: tracer
tree: DocstringTree
sec: str
) -> DocstringSubtree
|
|
|
|
|
|
|
|
|
|
|
Function |
get_tree_of_section |
|---|
11.1.7.3. get_tree_of_subsection¶
|
sdv.doc.waterloo.docitem_tokenizer.get_tree_of_subsection(
tr: tracer
tree: DocstringTree
sec: str
subsec: str
) -> DocstringSubtree
|
|
|
|
|
|
|
|
|
|
|
Function |
get_tree_of_subsection |
|---|
11.1.7.4. get_scopes_of_tree¶
|
sdv.doc.waterloo.docitem_tokenizer.get_scopes_of_tree(
tr: tracer
tree: DocstringTree
) -> Scopes
|
|
|
|
|
|
|
|
|
|
|
Function |
get_scopes_of_tree |
|---|
11.1.7.5. to_string_tree¶
|
sdv.doc.waterloo.docitem_tokenizer.to_string_tree(
tree: DocstringSubtree
indent_scheme: int = 0
indent: int = 0
) -> str
|
|
|
|
|
|
|
|
|
|
<empty> |
|
This function is helpful for idempotence tests. It is invoked e.g. in waterlint extract in order to extract sections or subsections from a docstring. |
Function |
to_string_tree |
|---|
11.1.7.6. build_anchor¶
|
sdv.doc.waterloo.docitem_helper.build_anchor(
obj: object
kind: str | None = None
) -> str
|
|
|
|
|
|
|
|
Deterministic anchor string suitable for doc-internal links. |
|
<empty> |
|
Last review 2026-06-22 |
Function |
build_anchor |
|---|
11.1.8. Diagnostics helpers¶
11.1.8.1. explain_try_self_for_section¶
|
sdv.doc.waterloo.docitem_diagnostics.explain_try_self_for_section(
label: str
profile: str
) -> str
|
|
|
|
|
|
|
|
The canonical |
|
<empty> |
|
|
Function |
explain_try_self_for_section |
|---|
11.1.8.2. explain_try_self_for_subsection¶
|
sdv.doc.waterloo.docitem_diagnostics.explain_try_self_for_subsection(
label: str
profile: str
) -> str
|
|
|
|
|
|
|
|
The canonical |
|
<empty> |
|
|
Function |
explain_try_self_for_subsection |
|---|
11.1.8.3. render_allowed_identifier¶
|
sdv.doc.waterloo.docitem_diagnostics.render_allowed_identifier(
label: str
identifiers: Iterable[str]
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that states the allowed identifier values in one line. |
|
<empty> |
Function |
render_allowed_identifier |
|---|
11.1.8.4. render_allowed_identifiers¶
|
sdv.doc.waterloo.docitem_diagnostics.render_allowed_identifiers(
label: str
identifiers: Iterable[str]
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that states the allowed identifier values in one line. |
|
<empty> |
Function |
render_allowed_identifiers |
|---|
11.1.8.5. render_base_method_docstring_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_base_method_docstring_details(
base_name: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_base_method_docstring_details |
|---|
11.1.8.6. render_base_method_reference_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_base_method_reference_details(
current_entries: Iterable[str]
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_base_method_reference_details |
|---|
11.1.8.7. render_constant_reference_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_constant_reference_details(
label: str
const_name: str
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_constant_reference_details |
|---|
11.1.8.8. render_deduplicated_identifiers¶
|
sdv.doc.waterloo.docitem_diagnostics.render_deduplicated_identifiers(
label: str
identifiers: Iterable[str]
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that states the deduplicated identifier values in one line. |
|
<empty> |
Function |
render_deduplicated_identifiers |
|---|
11.1.8.9. render_definition_reference_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_definition_reference_details(
references: str | Iterable[str]
profile: str
missing_definitions: bool
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_definition_reference_details |
|---|
11.1.8.10. render_exactly_one_identifier_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_exactly_one_identifier_details(
label: str
current_entries: Iterable[str]
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_exactly_one_identifier_details |
|---|
11.1.8.11. render_expected_identifier¶
|
sdv.doc.waterloo.docitem_diagnostics.render_expected_identifier(
label: str
expected_kind: Literal[‘identifier’, ‘qualified identifier’]
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that states the expected syntax in the Waterloo snippet format. |
|
<empty> |
Function |
render_expected_identifier |
|---|
11.1.8.12. render_expected_snippet¶
|
sdv.doc.waterloo.docitem_diagnostics.render_expected_snippet(
section_label: str | None
subsections: Iterable[str] | None = None
) -> list[str]
|
|
|
|
|
|
|
|
The canonical expected section snippet as a list of lines. |
|
<empty> |
Function |
render_expected_snippet |
|---|
11.1.8.13. render_identifier_lines¶
|
sdv.doc.waterloo.docitem_diagnostics.render_identifier_lines(
label: str
identifiers: Iterable[str]
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that states the identifier values in one line without semantic normalization. |
|
<empty> |
Function |
render_identifier_lines |
|---|
11.1.8.14. render_inherited_definition_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_inherited_definition_details(
current_inherited_terms: Iterable[str]
profile: str
expected_text: str
use_section_hint: bool = False
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_inherited_definition_details |
|---|
11.1.8.15. render_listed_object_missing_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_listed_object_missing_details(
label: str
member_name: str
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_listed_object_missing_details |
|---|
11.1.8.16. render_missing_entry_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_missing_entry_details(
container_label: str
current_entries: Iterable[str]
missing_entry: str
profile: str
top_level: bool = False
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_missing_entry_details |
|---|
11.1.8.17. render_name_object_consistency_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_name_object_consistency_details(
label: str
current_entries: Iterable[str]
profile: str
overview_item: str | None = None
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_name_object_consistency_details |
|---|
11.1.8.18. render_named_value_reference_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_named_value_reference_details(
label: str
name: str
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_named_value_reference_details |
|---|
11.1.8.19. render_normative_section_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_normative_section_details(
section_label: str
normative_sections: Iterable[str]
profile: str
action: Literal[‘add’, ‘remove’]
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_normative_section_details |
|---|
11.1.8.20. render_normativity_keyword_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_normativity_keyword_details(
section_label: str
entry_name: str
current_lines: Iterable[str]
suggestion: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_normativity_keyword_details |
|---|
11.1.8.21. render_overview_missing_member_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_overview_missing_member_details(
overview_label: str
public_label: str
current_entries: Iterable[str]
missing_name: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_overview_missing_member_details |
|---|
11.1.8.22. render_overview_requires_section_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_overview_requires_section_details(
overview_label: str
required_section: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_overview_requires_section_details |
|---|
11.1.8.23. render_parameter_signature_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_parameter_signature_details(
section_label: str
current_entries: Iterable[str]
expected_entries: Iterable[str]
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_parameter_signature_details |
|---|
11.1.8.24. render_profile_mismatch_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_profile_mismatch_details(
object_name: str
object_kind: str
current_profile: str
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_profile_mismatch_details |
|---|
11.1.8.25. render_scope_relation_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_scope_relation_details(
containing_kind: str
containing_scopes: Scopes
is_containing_scope_explicit: bool
contained_kind: str
contained_scopes: Scopes
is_contained_scope_explicit: bool
section_label: str
reference: str
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_scope_relation_details |
|---|
11.1.8.26. render_see_also_reference_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_see_also_reference_details(
reference: str
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_see_also_reference_details |
|---|
11.1.8.27. render_source_snippet¶
|
sdv.doc.waterloo.docitem_diagnostics.render_source_snippet(
section_label: str | None
subsections: Iterable[str] | None = None
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that renders the section label followed by subsection placeholders. |
|
<empty> |
Function |
render_source_snippet |
|---|
11.1.8.28. render_suggestion¶
|
sdv.doc.waterloo.docitem_diagnostics.render_suggestion(
label: str | None
suggestion: str
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that states the suggested section or subsection in one line. |
|
<empty> |
Function |
render_suggestion |
|---|
11.1.8.29. render_type_reference_details¶
|
sdv.doc.waterloo.docitem_diagnostics.render_type_reference_details(
label: str
type_name: str
expected_text: str
profile: str
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A details dictionary with |
|
<empty> |
Function |
render_type_reference_details |
|---|
11.1.8.30. render_unique_identifiers¶
|
sdv.doc.waterloo.docitem_diagnostics.render_unique_identifiers(
label: str
identifiers: Iterable[str]
) -> list[str]
|
|
|
|
|
|
|
|
A compact list of lines that states the canonical identifier values and mentions uniqueness. |
|
<empty> |
Function |
render_unique_identifiers |
|---|
11.1.9. Enum classes¶
11.1.9.1. sdv.doc.waterloo.docitem_helper.Scope¶
|
|
|
|
|
|
|
|
|
Purpose The scope is an optional parameter for rendering functions. It allows to restrict the set of rendered objects to a well-defined audience. Values The class only ensures the partial order but does not ensure particular values for the constants. |
Class |
Scope |
|---|
11.1.9.2. sdv.doc.waterloo.docitem_helper.Flavour¶
|
|
|
|
|
|
|
|
Class |
Flavour |
|---|
11.1.9.3. sdv.doc.waterloo.docitem_helper.Format¶
|
|
|
|
|
|
|
|
Class |
Format |
|---|
11.1.9.4. sdv.doc.waterloo.docitem_helper.Status¶
|
|
|
|
|
|
|
|
|
LoII This docstring violates LoII in order to preserve SSoT, see |
Class |
Status |
|---|
11.1.10. Helper classes¶
11.1.10.1. tracer¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-06-21 Parameter ‘details’ The details payload is important for the MCP server, because it gives the LLM enough debugging context to interpret tracer output and decide how to react to it. It usually is a dict with keys “found”, “expected”, and “hint”; “hint” typically contains a waterlint call for retrieving more information about the affected section or subsection. |
Class |
tracer |
|---|
Nested classes in tracer
|
|
|
|
|
|
Class |
tracer.Severity |
|---|
Public Methods in class tracer
|
sdv.doc.waterloo.docitem_helper.tracer.build_json(
severity: Severity
schema_version: str | None = None
waterloo_version: str | None = None
id_prefix: str | None = None
include_debug: bool = True
) -> dict[str, Any]
|
|
|
|
|
|
|
|
A JSON-serializable |
|
<empty> |
Method |
tracer.build_json |
|---|
|
sdv.doc.waterloo.docitem_helper.tracer.str_by_severity(
severity: Severity
) -> str
|
|
|
|
|
|
|
|
A string representation of the tracer’s content, including entries up to the specified severity level, formatted for human readability. |
|
<empty> |
|
Called by This method is invoked by the __str__ method, which defaults to showing all entries (DEBUG level), so generally you simply call :wtrl_func:`str`(tracer_instance) to get the full content or :wtrl_func:`print`(tracer_instance) to display it. |
Method |
tracer.str_by_severity |
|---|
11.1.10.2. ConfigTraversal¶
|
|
|
|
|
Experimental This class will likely be expanded in the future, and we are postponing the normative documentation for now. Configure Use Future Possible extensions include acceptance/refusal by regular expressions. Example |
Class |
ConfigTraversal |
|---|
11.1.11. Base classes¶
11.1.11.1. docitem_base¶
|
|
|
|
|
|
|
|
|
|
|
|
Class |
docitem_base |
|---|
Public Methods in class docitem_base
|
sdv.doc.waterloo.docitem_base.docitem_base.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
This docstring is located in the base class of all docitem node classes. The method is not implemented here and will raise an exception if it is invoked without a corresponding implementation in a derived class. |
|
|
|
|
|
|
|
|
Method |
docitem_base.parse |
|---|
|
sdv.doc.waterloo.docitem_base.docitem_base.items(
) -> Iterable[str]
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_base.items |
|---|
11.1.11.2. docitem_list_base¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_list_base |
|---|
Public Methods in class docitem_list_base
|
sdv.doc.waterloo.docitem_base.docitem_list_base.items(
) -> List[str]
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Method |
docitem_list_base.items |
|---|
11.1.11.3. docitem_map_base¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_map_base |
|---|
Public Methods in class docitem_map_base
|
sdv.doc.waterloo.docitem_base.docitem_map_base.items(
) -> Dict[str, docitem_base]
|
|
|
|
|
|
|
|
|
|
<empty> |
Method |
docitem_map_base.items |
|---|
11.1.11.4. docitem_docstring_base¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_docstring_base |
|---|
Public Methods in class docitem_docstring_base
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_base.parse(
tr: tracer
tree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_docstring_base.parse |
|---|
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_base.scopes(
) -> Scopes
|
|
|
|
|
|
|
|
A set of enum values representing the scopes of the documented object. |
|
|
Method |
docitem_docstring_base.scopes |
|---|
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_base.is_visible(
sc_query: Scopes
) -> bool
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_docstring_base.is_visible |
|---|
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_base.can_see(
sc_query: Scopes
) -> bool
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_docstring_base.can_see |
|---|
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_base.is_scope_compatible(
obj_trg: docitem_docstring_base
) -> bool
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_docstring_base.is_scope_compatible |
|---|
11.1.11.5. docitem_free_text_entry_base¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_free_text_entry_base |
|---|
Public Methods in class docitem_free_text_entry_base
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.11.6. docitem_list_of_symbols_base¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Class |
docitem_list_of_symbols_base |
|---|
Nested classes in docitem_list_of_symbols_base
|
|
|
|
|
|
|
|
Class |
docitem_list_of_symbols_base.ValuePattern |
|---|
Public Methods in class docitem_list_of_symbols_base
|
sdv.doc.waterloo.docitem_base.docitem_list_of_symbols_base._parse(
tr: tracer
refs: DocstringSubtree
pattern: ValuePattern
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sdv.doc.waterloo.docitem_helper.RE_IDENTIFIER, sdv.doc.waterloo.docitem_helper.RE_QUALIFIED_IDENTIFIER |
Method |
docitem_list_of_symbols_base._parse |
|---|
11.1.12. Preamble node classes¶
11.1.12.1. docitem_profile¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_profile |
|---|
Public Methods in class docitem_profile
|
sdv.doc.waterloo.docitem_preamble.docitem_profile.parse(
tr: tracer
refs: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_profile.parse |
|---|
11.1.12.2. docitem_normative_sections¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_normative_sections |
|---|
Public Methods in class docitem_normative_sections
|
sdv.doc.waterloo.docitem_preamble.docitem_normative_sections.parse(
tr: tracer
refs: DocstringSubtree
) -> None
|
|
|
|
|
Inherited_method |
docitem_normative_sections.parse |
|---|
11.1.12.3. docitem_status¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_status |
|---|
Public Methods in class docitem_status
|
sdv.doc.waterloo.docitem_preamble.docitem_status.parse(
tr: tracer
refs: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_status.parse |
|---|
11.1.12.4. docitem_scope¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_scope |
|---|
Public Methods in class docitem_scope
|
sdv.doc.waterloo.docitem_preamble.docitem_scope.parse(
tr: tracer
refs: DocstringSubtree
) -> None
|
|
|
|
|
Inherited_method |
docitem_scope.parse |
|---|
11.1.12.5. docitem_preamble¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_preamble |
|---|
Public Methods in class docitem_preamble
|
sdv.doc.waterloo.docitem_preamble.docitem_preamble.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_preamble.parse |
|---|
11.1.13. Contract node classes¶
11.1.13.1. docitem_constructor¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_constructor |
|---|
Public Methods in class docitem_constructor
|
sdv.doc.waterloo.docitem_contract.docitem_constructor.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_constructor.parse |
|---|
11.1.13.2. docitem_general¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_general |
|---|
Public Methods in class docitem_general
|
sdv.doc.waterloo.docitem_contract.docitem_general.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_general.parse |
|---|
11.1.13.3. docitem_invariants¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_invariants |
|---|
Public Methods in class docitem_invariants
|
sdv.doc.waterloo.docitem_contract.docitem_invariants.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_invariants.parse |
|---|
11.1.13.4. docitem_requires¶
|
|
|
This node represents the |
|
|
|
|
|
|
|
|
Class |
docitem_requires |
|---|
Public Methods in class docitem_requires
|
sdv.doc.waterloo.docitem_contract.docitem_requires.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_requires.parse |
|---|
11.1.13.5. docitem_ensures¶
|
|
|
This node represents the |
|
|
|
|
|
|
|
|
Class |
docitem_ensures |
|---|
Public Methods in class docitem_ensures
|
sdv.doc.waterloo.docitem_contract.docitem_ensures.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_ensures.parse |
|---|
11.1.13.6. docitem_traits¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_traits |
|---|
Public Methods in class docitem_traits
|
sdv.doc.waterloo.docitem_contract.docitem_traits.parse(
tr: tracer
refs: DocstringSubtree
) -> None
|
|
|
|
|
Inherited_method |
docitem_traits.parse |
|---|
11.1.13.7. docitem_contract_module¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_contract_module |
|---|
Public Methods in class docitem_contract_module
|
sdv.doc.waterloo.docitem_contract.docitem_contract_module.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_contract_module.parse |
|---|
11.1.13.8. docitem_contract_class¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_contract_class |
|---|
Public Methods in class docitem_contract_class
|
sdv.doc.waterloo.docitem_contract.docitem_contract_class.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_contract_class.parse |
|---|
11.1.13.9. docitem_contract_method¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_contract_method |
|---|
Public Methods in class docitem_contract_method
|
sdv.doc.waterloo.docitem_contract.docitem_contract_method.parse(
tr: tracer
subtree: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_contract_method.parse |
|---|
11.1.13.10. docitem_class_overview_entry¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_class_overview_entry |
|---|
Public Methods in class docitem_class_overview_entry
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.15. Other sections node classes¶
11.1.15.1. docitem_returns¶
|
|
|
|
|
|
|
|
Class |
docitem_returns |
|---|
Public Methods in class docitem_returns
|
sdv.doc.waterloo.docitem_sections.docitem_returns.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_returns.parse |
|---|
11.1.15.2. docitem_parameters_entry¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_parameters_entry |
|---|
Public Methods in class docitem_parameters_entry
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.15.3. docitem_parameters¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_parameters |
|---|
Public Methods in class docitem_parameters
|
sdv.doc.waterloo.docitem_sections.docitem_parameters.parse(
tr: tracer
entries: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_parameters.parse |
|---|
11.1.15.4. docitem_raises_entry¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_raises_entry |
|---|
Public Methods in class docitem_raises_entry
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.15.5. docitem_raises¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_raises |
|---|
Public Methods in class docitem_raises
|
sdv.doc.waterloo.docitem_sections.docitem_raises.parse(
tr: tracer
entries: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_raises.parse |
|---|
11.1.15.6. docitem_derived_from¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_derived_from |
|---|
Public Methods in class docitem_derived_from
|
sdv.doc.waterloo.docitem_sections.docitem_derived_from.parse(
tr: tracer
bases: DocstringSubtree
) -> None
|
|
|
|
|
Inherited_method |
docitem_derived_from.parse |
|---|
11.1.15.7. docitem_factory_functions¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_factory_functions |
|---|
Public Methods in class docitem_factory_functions
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.15.8. docitem_factory¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_factory |
|---|
Public Methods in class docitem_factory
|
sdv.doc.waterloo.docitem_sections.docitem_factory.parse(
tr: tracer
functions: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_factory.parse |
|---|
11.1.15.9. docitem_definitions_entry¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_definitions_entry |
|---|
Public Methods in class docitem_definitions_entry
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.15.10. docitem_inherited_defitems¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_inherited_defitems |
|---|
Public Methods in class docitem_inherited_defitems
11.1.15.11. docitem_definitions¶
|
|
|
|
|
|
|
|
Class |
docitem_definitions |
|---|
Public Methods in class docitem_definitions
|
sdv.doc.waterloo.docitem_sections.docitem_definitions.parse(
tr: tracer
entries: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_definitions.parse |
|---|
11.1.15.12. docitem_terminology_entry¶
|
|
|
|
|
|
|
|
|
|
|
|
Class |
docitem_terminology_entry |
|---|
Public Methods in class docitem_terminology_entry
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.15.13. docitem_terminology¶
|
|
|
A |
|
|
|
|
|
|
Class |
docitem_terminology |
|---|
Public Methods in class docitem_terminology
|
sdv.doc.waterloo.docitem_sections.docitem_terminology.parse(
tr: tracer
entries: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_terminology.parse |
|---|
11.1.15.14. docitem_description¶
|
|
|
|
|
A free-form section which informatively describes the purpose of a module, class or callable. |
|
|
|
|
|
|
Class |
docitem_description |
|---|
Public Methods in class docitem_description
|
sdv.doc.waterloo.docitem_sections.docitem_description.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_description.parse |
|---|
11.1.15.15. docitem_notes_entry¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_notes_entry |
|---|
Public Methods in class docitem_notes_entry
|
sdv.doc.waterloo.docitem_base.docitem_free_text_entry_base.parse(
tr: tracer
lines: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_free_text_entry_base.parse |
|---|
11.1.15.16. docitem_notes¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_notes |
|---|
Public Methods in class docitem_notes
|
sdv.doc.waterloo.docitem_sections.docitem_notes.parse(
tr: tracer
entries: DocstringSubtree
) -> None
|
|
|
|
|
|
|
|
|
|
|
|
|
Method |
docitem_notes.parse |
|---|
11.1.15.17. docitem_see_also¶
|
|
|
|
|
|
|
|
|
|
Class |
docitem_see_also |
|---|
Public Methods in class docitem_see_also
|
sdv.doc.waterloo.docitem_sections.docitem_see_also.parse(
tr: tracer
refs: DocstringSubtree
) -> None
|
|
|
|
|
Inherited_method |
docitem_see_also.parse |
|---|
11.1.16. Top-level node classes¶
11.1.16.1. docitem_docstring_module¶
|
|
|
|
|
|
|
|
|
|
|
|
Class |
docitem_docstring_module |
|---|
Public Methods in class docitem_docstring_module
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_module.dispatch_map(
) -> Dict[str, Type[docitem_base]]
|
|
|
|
|
|
|
|
The dict as described in |
|
<empty> |
Method |
docitem_docstring_module.dispatch_map |
|---|
11.1.16.2. docitem_docstring_class¶
|
|
|
|
|
|
|
|
|
|
|
|
Class |
docitem_docstring_class |
|---|
Public Methods in class docitem_docstring_class
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_class.dispatch_map(
) -> Dict[str, Type[docitem_base]]
|
|
|
|
|
|
|
|
The dict as described in |
|
<empty> |
Method |
docitem_docstring_class.dispatch_map |
|---|
11.1.16.3. docitem_docstring_method¶
|
|
|
|
|
|
|
|
|
|
|
|
Class |
docitem_docstring_method |
|---|
Public Methods in class docitem_docstring_method
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_method.dispatch_map(
) -> Dict[str, Type[docitem_base]]
|
|
|
|
|
|
|
|
The dict as described in |
|
<empty> |
Method |
docitem_docstring_method.dispatch_map |
|---|
11.1.16.4. docitem_docstring_inherited_method¶
|
|
|
|
|
|
|
|
|
|
|
|
Class |
docitem_docstring_inherited_method |
|---|
Public Methods in class docitem_docstring_inherited_method
|
sdv.doc.waterloo.docitem_docstring.docitem_docstring_inherited_method.dispatch_map(
) -> Dict[str, Type[docitem_base]]
|
|
|
|
|
|
|
|
The dict as described in |
|
<empty> |
Method |
docitem_docstring_inherited_method.dispatch_map |
|---|
11.1.17. Factories¶
11.1.17.1. make_docitem_tree¶
|
sdv.doc.waterloo.docitem_docstring.make_docitem_tree(
tr: tracer
doc_txt: str
) -> docitem_docstring_base
|
|
|
|
|
|
|
|
|
|
|
|
Last review 2026-01-22 |
Function |
make_docitem_tree |
|---|
11.2. Module docitem_sphinx¶
|
|
|
This module provides the Sphinx integration layer for the Waterloo documentation system. The implementation operates directly on Docutils nodes and defines custom Docutils roles to generate structured documentation output from Waterloo-style docstrings. Sphinx is used as the execution and rendering framework, but the internal data model is based on the Docutils abstract syntax tree (AST). All document structure, including sections, tables, lists, rubrics, and inline markup, is represented using Docutils node classes. The module introduces a configurable To support concise and unambiguous normative documentation, the module maintains explicit scope stacks with the semantics “current module” and “current class”. These scopes define the implicit ownership of subsequently documented functions and methods and are modified using dedicated Docutils roles or directives. The primary goal of this module is correctness, completeness, and reproducibility of normative documentation. Readability and visual presentation are considered secondary and are handled through configurable rendering layers. |
|
|
|
|
|
|
|
|
|
build_sphinx_nodes, build_sphinx_nodes_full, resolve_qualified_name, wtrl_build_autodoc_module_nodes, wtrl_build_autodoc_function_nodes, wtrl_build_autodoc_class_nodes, wtrl_build_autodoc_class_full_nodes, wtrl_build_push_current_module_nodes, wtrl_build_push_current_class_nodes, wtrl_build_push_current_scope_nodes, wtrl_build_pop_current_module_nodes, wtrl_build_pop_current_class_nodes, wtrl_build_pop_current_scope_nodes, wtrl_build_method_signature_nodes, wtrl_build_function_signature_nodes, wtrl_build_method_signature_block_nodes, wtrl_build_function_signature_block_nodes |
|
|
Module |
sdv.doc.waterloo.docitem_sphinx |
|---|
11.2.1. Functions¶
11.2.1.1. build_sphinx_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.build_sphinx_nodes(
ctx: context
obj: object
doc: mod_docitem.docitem_docstring_base
) -> List[nodes.Node]
|
|
|
|
|
|
|
|
List of |
|
|
|
Usage This function is typically not called directly. It is called by the various Linking Internal links are created using anchor ids from Last review 2026-02-15 |
Function |
build_sphinx_nodes |
|---|
11.2.1.2. build_sphinx_nodes_full¶
|
sdv.doc.waterloo.docitem_sphinx.build_sphinx_nodes_full(
ctx: context
class_obj: Any
session: mod_docitem.DocSession
) -> List[nodes.Node]
|
|
|
|
|
|
|
|
A list of sphinx nodes representing the class and public member documentation. |
|
|
Function |
build_sphinx_nodes_full |
|---|
11.2.1.3. resolve_qualified_name¶
|
sdv.doc.waterloo.docitem_sphinx.resolve_qualified_name(
ctx: context | None
qname: str
) -> tuple[object, str, str, list[str]]
|
|
|
|
|
|
|
|
|
|
|
Function |
resolve_qualified_name |
|---|
11.2.2. Directives for docstring rendering¶
11.2.2.1. wtrl_build_autodoc_module_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_autodoc_module_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of role |
|
|
|
The list of generated |
|
|
Function |
wtrl_build_autodoc_module_nodes |
|---|
11.2.2.2. wtrl_build_autodoc_function_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_autodoc_function_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
List of generated |
|
|
Function |
wtrl_build_autodoc_function_nodes |
|---|
11.2.2.3. wtrl_build_autodoc_class_full_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_autodoc_class_full_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
List of generated |
|
|
Function |
wtrl_build_autodoc_class_full_nodes |
|---|
11.2.2.4. wtrl_build_autodoc_class_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_autodoc_class_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
List of generated |
|
|
Function |
wtrl_build_autodoc_class_nodes |
|---|
11.2.3. Directives for setting default module and class¶
11.2.3.1. wtrl_build_push_current_module_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_push_current_module_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_push_current_module_nodes |
|---|
11.2.3.2. wtrl_build_push_current_class_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_push_current_class_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_push_current_class_nodes |
|---|
11.2.3.3. wtrl_build_push_current_scope_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_push_current_scope_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
scope_tag: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_push_current_scope_nodes |
|---|
11.2.3.4. wtrl_build_pop_current_module_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_pop_current_module_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_pop_current_module_nodes |
|---|
11.2.3.5. wtrl_build_pop_current_class_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_pop_current_class_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_pop_current_class_nodes |
|---|
11.2.3.6. wtrl_build_pop_current_scope_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_pop_current_scope_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
scope_tag: str
) -> list[nodes.Node]
|
|
|
|
|
|
Implementation of directive |
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_pop_current_scope_nodes |
|---|
11.2.4. Directives for expanding callable signatures¶
11.2.4.1. wtrl_build_method_signature_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_method_signature_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_method_signature_nodes |
|---|
11.2.4.2. wtrl_build_function_signature_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_function_signature_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_function_signature_nodes |
|---|
11.2.4.3. wtrl_build_method_signature_block_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_method_signature_block_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_method_signature_block_nodes |
|---|
11.2.4.4. wtrl_build_function_signature_block_nodes¶
|
sdv.doc.waterloo.docitem_sphinx.wtrl_build_function_signature_block_nodes(
app: SphinxAppProtocol | Any
inliner: InlinerProtocol
lineno: int
qname: str
) -> list[nodes.Node]
|
|
|
|
|
|
|
|
The list of generated |
|
|
|
Last review 2026-02-04 |
Function |
wtrl_build_function_signature_block_nodes |
|---|
11.3. Module docitem_convert¶
|
|
|
|
|
to_node_legend_json, to_node_docstring_tree_json, to_node_signature_json, to_string_md, build_node_json |
|
|
Module |
sdv.doc.waterloo.docitem_convert |
|---|
11.3.1. Converter functions¶
11.3.1.1. to_node_legend_json¶
|
sdv.doc.waterloo.docitem_convert.to_node_legend_json(
) -> Dict[str, WtrlJsonNode_t]
|
|
|
|
|
|
|
|
Mapping of role-name -> human-readable description. |
|
<empty> |
Function |
to_node_legend_json |
|---|
11.3.1.2. to_node_docstring_tree_json¶
|
sdv.doc.waterloo.docitem_convert.to_node_docstring_tree_json(
tree: DocstringTree
flavour: Flavour
) -> WtrlJsonNode_t
|
|
|
|
|
|
Details The docstring tree is rendered exactly as nested JSON arrays; no additional restructuring is performed. |
|
|
|
The JSON node |
|
|
|
sdv.doc.waterloo.docitem.Flavour, sdv.doc.waterloo.docitem.Format |
Function |
to_node_docstring_tree_json |
|---|
11.3.1.3. to_node_signature_json¶
|
sdv.doc.waterloo.docitem_convert.to_node_signature_json(
obj: object
) -> dict[str, WtrlJsonNode_t]
|
|
|
|
|
|
|
|
The generated JSON node |
|
|
|
Standard values for “kind” Derived from |
Function |
to_node_signature_json |
|---|
11.3.1.4. build_node_json¶
|
sdv.doc.waterloo.docitem_convert.build_node_json(
node_docstring: docitem_docstring_base
flavour: Flavour
) -> WtrlJsonNode_t
|
|
|
|
|
|
|
|
The JSON node, a |
|
|
Function |
build_node_json |
|---|
11.3.1.5. to_string_md¶
|
sdv.doc.waterloo.docitem_convert.to_string_md(
tree: DocstringTree
flavour: Flavour = <Flavour.MARKDOWN: 2>
headings: bool = True
) -> str
|
|
|
|
|
|
|
|
A Markdown string. |
|
|
|
sdv.doc.waterloo.docitem.Flavour, sdv.doc.waterloo.docitem.Format |
Function |
to_string_md |
|---|
11.4. Module docitem_genutil¶
|
|
|
|
|
This module is intended for IDE-extension workflows. A typical use case is a VSCode context-menu action on a |
|
parse_source_fragment, infer_docstring_profile, parse_signature_fragment, generate_minimal_docstring, generate_full_docstring, generate_minimal_docstring_from_node, generate_full_docstring_from_node |
|
Important JSON templates for minimal and full docstring templates can be generated by means of |
Module |
sdv.doc.waterloo.docitem_genutil |
|---|
11.4.1. parse_source_fragment¶
|
sdv.doc.waterloo.docitem_genutil.parse_source_fragment(
profile: Profile
source_fragment: str
) -> ast.AST | None
|
|
|
|
|
|
|
|
|
|
|
Function |
parse_source_fragment |
|---|
11.4.2. infer_docstring_profile¶
|
sdv.doc.waterloo.docitem_genutil.infer_docstring_profile(
obj: object
) -> Profile
|
|
|
|
|
|
|
|
|
|
|
|
Result The |
Function |
infer_docstring_profile |
|---|
11.4.3. generate_minimal_docstring¶
|
sdv.doc.waterloo.docitem_genutil.generate_minimal_docstring(
obj: object
profile: Profile | None = None
) -> str
|
|
|
|
|
|
|
|
Generated minimal docstring template. |
|
|
Function |
generate_minimal_docstring |
|---|
11.4.4. generate_full_docstring¶
|
sdv.doc.waterloo.docitem_genutil.generate_full_docstring(
obj: object
profile: Profile | None = None
) -> str
|
|
|
|
|
|
|
|
Generated full docstring template. |
|
|
Function |
generate_full_docstring |
|---|
11.4.5. generate_minimal_docstring_from_node¶
|
sdv.doc.waterloo.docitem_genutil.generate_minimal_docstring_from_node(
profile: Profile
node: ast.AST | None
) -> str
|
|
|
|
|
|
|
|
Generated minimal docstring template. |
|
|
Function |
generate_minimal_docstring_from_node |
|---|
11.4.6. generate_full_docstring_from_node¶
|
sdv.doc.waterloo.docitem_genutil.generate_full_docstring_from_node(
profile: Profile
node: ast.AST | None
) -> str
|
|
|
|
|
|
|
|
Generated full docstring template. |
|
|
Function |
generate_full_docstring_from_node |
|---|
11.5. Pygments Lexer¶
|
|
|
|
|
|
|
|
|
|
Module |
python_waterloo_lexer |
|---|
11.5.1. PythonWaterlooLexer¶
|
|
|
|
|
highlight_docstring, highlight_line, looks_like_waterloo_docstring, has_mixed_indentation, analyse_text, get_tokens_unprocessed |
Class |
PythonWaterlooLexer |
|---|
Public Methods in class PythonWaterlooLexer
|
python_waterloo_lexer.PythonWaterlooLexer.highlight_docstring(
base: int
text: str
) -> Iterable[tuple[int, object, str]]
|
|
|
|
|
|
|
|
|
|
An iterable of |
|
|
Method |
PythonWaterlooLexer.highlight_docstring |
|---|
|
python_waterloo_lexer.PythonWaterlooLexer.highlight_line(
base: int
line: str
) -> Iterable[tuple[int, object, str]]
|
|
|
|
|
|
|
|
|
|
An iterable of |
|
|
Method |
PythonWaterlooLexer.highlight_line |
|---|
|
@staticmethod
python_waterloo_lexer.PythonWaterlooLexer.looks_like_waterloo_docstring(
text: str
) -> bool
|
|
|
|
This method performs a heuristic analysis of the input text to determine if it resembles a Waterloo-docstring. For a full and exact validation use the tool |
|
|
|
|
|
|
|
|
Method |
PythonWaterlooLexer.looks_like_waterloo_docstring |
|---|
|
@staticmethod
python_waterloo_lexer.PythonWaterlooLexer.has_mixed_indentation(
text: str
) -> bool
|
|
|
|
|
|
|
|
|
|
|
Method |
PythonWaterlooLexer.has_mixed_indentation |
|---|
|
pygments.util.make_analysator.<locals>.text_analyse(
text: Any
) -> Any
|
|
|
|
This method is called by Pygments during lexer selection to prioritize the PythonWaterlooLexer over the standard PythonLexer. It analyzes the input text for patterns indicative of Waterloo-docstrings, such as the presence of “Preamble:” and “Contract:” sections, ensuring that files containing structured docstrings are highlighted appropriately by this specialized lexer. |
|
|
|
|
|
A float value: 1.0 if the text is identified as a Waterloo-docstring, 0.0 otherwise. |
|
|
Function |
make_analysator.<locals>.text_analyse |
|---|
|
python_waterloo_lexer.PythonWaterlooLexer.get_tokens_unprocessed(
text: str
) -> Iterator[tuple[int, object, str]]
|
|
|
|
|
|
This is the core tokenization method that Pygments calls to obtain syntax highlighting tokens. It iterates over tokens from the parent PythonLexer and intercepts docstrings (String.Doc tokens) to apply Waterloo-specific highlighting rules. This method is the entry point for all tokenization and determines the highlighting of the entire source code. |
|
|
|
|
|
An iterable of |
|
|
Method |
PythonWaterlooLexer.get_tokens_unprocessed |
|---|
11.6. Output layer HTML5¶
|
|
|
|
|
|
|
|
Module |
sdv.doc.waterloo.waterlint_render_html5 |
|---|
|
sdv.doc.waterloo.waterlint_render_html5.render_html5(
args: argparse.Namespace
) -> int
|
|
|
|
|
|
|
|
|
|
<empty> |
Function |
render_html5 |
|---|