Skip to content

Commit

Permalink
fix references to _generate_html_repr and adjust styles a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
bendichter committed Jun 28, 2023
1 parent 2fd1d84 commit 09a1dba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hdmf/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ def _repr_html_(self):
CSS_STYLE = """

Check warning on line 456 in src/hdmf/container.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L456

Added line #L456 was not covered by tests
<style>
.nwb-fields { font-family: "Segoe UI", Roboto, sans-serif; }
.nwb-fields .field-key { font-weight: bold; }
.nwb-fields .field-value { color: #00788E; }
.nwb-fields details > summary { cursor: pointer; }
.nwb-fields details > summary:hover { color: #0A6EAA; }
Expand Down Expand Up @@ -490,7 +489,7 @@ def _repr_html_(self):
html_repr += (

Check warning on line 489 in src/hdmf/container.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L486-L489

Added lines #L486 - L489 were not covered by tests
"<div class='nwb-header'><div class='xr-obj-type'>NWB File</div></div>"
)
html_repr += self.generate_html_repr(self.fields)
html_repr += self._generate_html_repr(self.fields)
html_repr += "</div>"
return html_repr

Check warning on line 494 in src/hdmf/container.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L492-L494

Added lines #L492 - L494 were not covered by tests

Expand All @@ -505,11 +504,12 @@ def _generate_html_repr(self, fields, level=0, access_code=".fields"):
or isinstance(value, list)
or hasattr(value, "fields")
):
html_repr += f'<details><summary style="margin-left: {level * 20}px;" class="nwb-fields field-key" title="{current_access_code}">{key}</summary>'
html_repr += f'<details><summary style="margin-left: {level * 20}px;" class="nwb-fields ' \

Check warning on line 507 in src/hdmf/container.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L507

Added line #L507 was not covered by tests
f'field-key" title="{current_access_code}"><b>{key}</b></summary>'
if hasattr(value, "fields"):
value = value.fields
current_access_code = current_access_code + ".fields"
html_repr += self.generate_html_repr(
html_repr += self._generate_html_repr(

Check warning on line 512 in src/hdmf/container.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L510-L512

Added lines #L510 - L512 were not covered by tests
value, level + 1, current_access_code
)
html_repr += "</details>"

Check warning on line 515 in src/hdmf/container.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/container.py#L515

Added line #L515 was not covered by tests
Expand Down

0 comments on commit 09a1dba

Please sign in to comment.