Skip to content

Commit

Permalink
Make constructor arguments take less horizontal space and fit better
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicd authored and lpil committed Feb 21, 2025
1 parent 538192f commit 504f20b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 35 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
making Gleam packages discoverable through global search of HexDocs.
([Diemo Gebhardt](https://github.com/diemogebhardt))

- Improved the styling of constructor argument descriptions in the generated
documentation. ([Nicd](https://git.ahlcode.fi/nicd))

- Allow users to set the `GLEAM_CACERTS_PATH` environment variable to specify a
path to a directory containing CA certificates to install Hex packages.
([winstxnhdw](https://github.com/winstxnhdw))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

Expand Down Expand Up @@ -298,21 +297,17 @@ snapshot_kind: text
Arguments
</h4>
<ul class="constructor-argument-list">
<dl class="constructor-argument-list">
<li>
<div class="constructor-argument-item">
<p class="constructor-argument-label">
<i>wabble</i>
</p>
<div class="constructor-argument-doc">
<p>Documentation!!</p>
</div>
</div>
</li>
<dt class="constructor-argument-label">
wabble
</dt>
<dd class="constructor-argument-doc">
<p>Documentation!!</p>
</dd>
</ul>
</dl>
</div>
</li>
Expand Down
10 changes: 1 addition & 9 deletions compiler-core/templates/docs-css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,8 @@ body.drawer-open .label-closed {
margin-bottom: var(--small-gap);
}

.constructor-argument-item {
display: flex;
}

.constructor-argument-label {
flex-shrink: 0;
}

.constructor-argument-doc {
margin-left: var(--gap);
font-style: italic;
}

.constructor-argument-list {
Expand Down
20 changes: 8 additions & 12 deletions compiler-core/templates/documentation_module.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,16 @@ <h4>
Arguments
</h4>

<ul class="constructor-argument-list">
<dl class="constructor-argument-list">
{% for argument in constructor.arguments %}
<li>
<div class="constructor-argument-item">
<p class="constructor-argument-label">
<i>{{ argument.name }}</i>
</p>
<div class="constructor-argument-doc">
{{ argument.doc|safe }}
</div>
</div>
</li>
<dt class="constructor-argument-label">
{{ argument.name }}
</dt>
<dd class="constructor-argument-doc">
{{ argument.doc|safe }}
</dd>
{% endfor %}
</ul>
</dl>
{% endif %}
</div>
</li>
Expand Down

0 comments on commit 504f20b

Please sign in to comment.