Skip to content

Commit

Permalink
Add size/repeat info to fields. (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchv committed Jun 15, 2023
1 parent 1bd3d0c commit f9c3d12
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
20 changes: 14 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"author": "John Chadwick <johnwchadwick@gmail.com>",
"license": "ISC",
"dependencies": {
"highlight.js": "^11.8.0",
"js-yaml": "^4.1.0",
"kaitai-struct-compiler": "^0.10.0",
"parcel-bundler": "^1.12.5",
Expand Down
6 changes: 3 additions & 3 deletions src/templates/partials/struct.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ <h3><a id="{{ struct | urlhash}}">{{ struct.id }}</a></h3>
<tr>
<td><code class="nowrap">{{ field.id }}</code></td>
{% if field.struct %}
<td><code class="nowrap">{% include 'partials/type_link.html' with type: field.struct %}</code></td>
<td><code class="nowrap">{% include 'partials/type_link.html' with type: field.struct -%}{%- if field.repeat == "expr" %}[{{ field.repeatExpr }}]{% endif %}</code></td>
{% else %}
<td><code class="nowrap">{{ field.type | default: "bytes" }}</code></td>
<td><code class="nowrap">{{ field.type | default: "bytes" }}{% if field.size %}[{{ field.size }}]{% endif %}</code></td>
{% endif %}
<td>{{ field.doc | default: "" }}</td>
</tr>
Expand All @@ -42,4 +42,4 @@ <h3><a id="{{ struct | urlhash}}">{{ struct.id }}</a></h3>
</tr>
{% endfor %}
</tbody>
</table>
</table>
2 changes: 1 addition & 1 deletion src/templates/partials/type_link.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="{{type.file | urlpath}}#{{type | urlhash}}">{{- type.id -}}</a>
<a href="{{type.file | urlpath}}#{{type | urlhash}}">{{- type.id -}}</a>{{ "" -}}

0 comments on commit f9c3d12

Please sign in to comment.