Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to use a custom html field generation method #1038

Merged
merged 6 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bug fixes
- Fixed internal links in docstrings and tutorials. @stephprince [#1031](https://github.com/hdmf-dev/hdmf/pull/1031)
- Fixed issue with creating documentation links to classes in docval arguments. @rly [#1036](https://github.com/hdmf-dev/hdmf/pull/1036)
- Fixed recursion error in html representation generation in jupyter notebooks. @stephprince [#1038](https://github.com/hdmf-dev/hdmf/pull/1038)

## HDMF 3.12.0 (January 16, 2024)

Expand Down
5 changes: 4 additions & 1 deletion src/hdmf/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,10 @@ def _generate_html_repr(self, fields, level=0, access_code="", is_field=False):
if isinstance(fields, dict):
for key, value in fields.items():
current_access_code = f"{access_code}.{key}" if is_field else f"{access_code}['{key}']"
html_repr += self._generate_field_html(key, value, level, current_access_code)
if hasattr(value, '_generate_field_html'):
html_repr += value._generate_field_html(key, value, level, current_access_code)
else:
html_repr += self._generate_field_html(key, value, level, current_access_code)
rly marked this conversation as resolved.
Show resolved Hide resolved
elif isinstance(fields, list):
for index, item in enumerate(fields):
access_code += f'[{index}]'
Expand Down
Loading