13. Test: Scopes¶
This chapter demonstrates the effect of subsection Preamble.scope
in combination with the scope state stack. The goal is to render a Sphinx
document for a given target audience, according to the rules defined in
Scopes and visibility.
To this end, the objects of module test_scope_mix are rendered
once for each target scope, each within its own section of this chapter.
The scope is set at the beginning of each section using the directive
.. wtrl_push_current_scope::.
The active scope determines which objects are rendered at all, and which references in the resulting HTML artifact are clickable. In this way, a consistent subgraph of the complete set of docstrings of the module is obtained.
The three sections below illustrate how the visible subset of objects changes with increasing scope.
13.1. Scope: Public¶
|
|
|
|
|
X_public, |
|
f_public, |
|
|
Module |
test_scope_mix |
|---|
|
test_scope_mix.f_public(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Function |
f_public |
|---|
|
|
|
|
|
|
|
|
Class |
X_public |
|---|
Nested classes in X_public
Public Methods in class X_public
13.2. Scope: Extension¶
|
|
|
|
|
X_public, X_extension, |
|
f_public, f_extension, |
|
|
Module |
test_scope_mix |
|---|
|
test_scope_mix.f_public(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Function |
f_public |
|---|
|
test_scope_mix.f_extension(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Function |
f_extension |
|---|
|
|
|
|
|
Y_extension, |
|
m_extension, |
Class |
X_public |
|---|
Nested classes in X_public
|
|
|
|
Class |
X_public.Y_extension |
|---|
Public Methods in class X_public
|
test_scope_mix.X_public.m_extension(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Method |
X_public.m_extension |
|---|
|
|
|
|
|
|
|
|
|
|
|
|
Class |
X_extension |
|---|
Nested classes in X_extension
Public Methods in class X_extension
13.3. Scope: Core¶
|
|
|
|
|
|
|
|
|
|
Module |
test_scope_mix |
|---|
|
test_scope_mix.f_public(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Function |
f_public |
|---|
|
test_scope_mix.f_extension(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Function |
f_extension |
|---|
|
test_scope_mix.f_core(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Function |
f_core |
|---|
|
|
|
|
|
|
|
|
Class |
X_public |
|---|
Nested classes in X_public
|
|
|
|
Class |
X_public.Y_extension |
|---|
|
|
|
|
|
|
Class |
X_public.Y_core |
|---|
Public Methods in class X_public
|
test_scope_mix.X_public.m_extension(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
|
Method |
X_public.m_extension |
|---|
|
test_scope_mix.X_public.m_core(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
X_public.m_extension, X_public.Y_core, f_public, f_extension, f_core |
Method |
X_public.m_core |
|---|
|
|
|
|
|
|
|
|
|
|
|
|
Class |
X_extension |
|---|
Nested classes in X_extension
|
|
|
|
|
|
Class |
X_extension.Y_core |
|---|
Public Methods in class X_extension
|
test_scope_mix.X_extension.m_core(
) -> None
|
|
|
|
|
|
|
|
|
|
<empty> |
|
X_public.m_extension, X_public.m_core, X_extension.Y_core, f_public, f_extension, f_core |
Method |
X_extension.m_core |
|---|
|
|
|
|
|
|
Class |
X_core |
|---|