Skip to content

Commit

Permalink
List all descendants of a cls in html-doc (#267)
Browse files Browse the repository at this point in the history
Currently, only concrete descendants are listed in the generated HTML
documentation. However, many readers want to see a full list of
descendants, and not only the concrete ones.

Therefore, we introduced ``descendants`` property in [aas_core_codegen.intermediate.Class], and leverage it in this patch.

[aas_core_codegen.intermediate.Class]: https://github.com/aas-core-works/aas-core-codegen/blob/b2c0e4a8e5622d2718371a5999d4aa3be9a9af9b/aas_core_codegen/intermediate/_types.py#L1437
  • Loading branch information
zrgt authored Mar 24, 2023
1 parent 5ef70d3 commit 2e66256
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions htmlgen/for_metamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,13 +1058,13 @@ def _generate_page_for_class(
)
)

if len(cls.concrete_descendants) > 0:
if len(cls.descendants) > 0:
li_descendants = [
f"""\
<li>
{I}<a href="{descendant.name}.html">{descendant.name}</a>
</li>"""
for descendant in cls.concrete_descendants
for descendant in cls.descendants
]

li_descendants_joined = "\n".join(li_descendants)
Expand All @@ -1080,7 +1080,7 @@ def _generate_page_for_class(
f"""\
<h2>
{I}<a name="concrete-descendants"></a>
{I}Concrete Descendants
{I}Descendants
{I}<a class="aas-anchor-link" href="#concrete-descendants">🔗</a>
</h2>
{ul_descendants}"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"mypy==0.910",
"pylint==2.17.0",
"asttokens>=2.0.8,<3",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@168c84e#egg=aas-core-codegen",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@67f789e#egg=aas-core-codegen",
"astpretty==3.0.0",
"pygments>=2,<3"
],
Expand Down

0 comments on commit 2e66256

Please sign in to comment.