Skip to content

Commit

Permalink
Render ranges as closed intervals in HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Apr 2, 2024
1 parent e6ef56b commit 538e62f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions templates/output.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ <h1>Output <span class=monospace>{{self.outpoint}}</span></h1>
<h2>{{"Sat Range".tally(sat_ranges.len())}}</h2>
<ul class=monospace>
%% for (start, end) in sat_ranges {
%% if end - start == 1 {
%% if start == end {
<li><a href=/sat/{{start}} class={{Sat(*start).rarity()}}>{{start}}</a></li>
%% } else {
<li><a href=/range/{{start}}/{{end}} class={{Sat(*start).rarity()}}>{{start}}–{{end}}</a></li>
<li><a href=/range/{{start}}/{{end+1}} class={{Sat(*start).rarity()}}>{{start}}–{{end}}</a></li>
%% }
%% }
</ul>
Expand Down
2 changes: 1 addition & 1 deletion templates/range.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Sat Range {{self.start}}–{{self.end}}</h1>
<h1>Sat Range {{self.start}}–{{self.end.n()-1}}</h1>
<dl>
<dt>value</dt><dd>{{self.end.n() - self.start.n()}}</dd>
<dt>first</dt><dd><a href=/sat/{{self.start.n()}} class={{self.start.rarity()}}>{{self.start.n()}}</a></dd>
Expand Down

0 comments on commit 538e62f

Please sign in to comment.