Skip to content

Commit f2d431b

Browse files
committed
Remove relative URL that breaks distribution (#715)
* Remove relative URL that breaks distribution! * Export doc-url
1 parent 1e3c827 commit f2d431b

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/web/common.rkt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
(provide render-menu render-warnings render-large render-comparison render-program
1414
render-bogosity render-help
15-
format-percent
15+
format-percent doc-url
1616
program->fpcore program->tex render-reproduction js-tex-include)
1717

1818
(define (program->fpcore expr ctx #:ident [ident #f])
@@ -42,6 +42,10 @@
4242
(define top (if ident (format "FPCore ~a ~a" ident args) (format "FPCore ~a" args)))
4343
(pretty-format `(,top ,@props* ,expr) #:mode 'display))
4444

45+
46+
(define (doc-url page)
47+
(format "https://herbie.uwplse.org/doc/~a/~a" (*herbie-version*) page))
48+
4549
(define/contract (render-menu #:path [path "."] name links)
4650
(->* (string? (listof (cons/c string? string?)))
4751
(#:path string?)
@@ -265,7 +269,7 @@
265269
(summary
266270
(h2 "Reproduce")
267271
(a ([class "help-button float"]
268-
[href "/doc/latest/report.html#reproduction"]
272+
[href ,(doc-url "report.html#reproduction")]
269273
[target "_blank"]) "?"))
270274
(pre ((class "shell"))
271275
(code
@@ -279,7 +283,7 @@
279283

280284
(define (render-help url #:float [float? #t])
281285
`(a ([class ,(if float? "help-button float" "help-button")]
282-
[href ,(format "/doc/latest/~a" url)]
286+
[href ,(doc-url url)]
283287
[target "_blank"]) "?"))
284288

285289
(define js-tex-include

src/web/make-graph.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
(summary (h2 "Specification")
127127
,dropdown
128128
(a ([class "help-button float"]
129-
[href "/doc/latest/report.html#spec"]
129+
[href ,(doc-url "report.html#spec")]
130130
[target "_blank"]) "?"))
131131
,body
132132
(p "Sampling outcomes in " (kbd ,(~a (representation-name repr))) " precision:")
@@ -137,7 +137,7 @@
137137
(h2 "Local Percentage Accuracy vs "
138138
(span ([id "variables"]))
139139
(a ([class "help-button float"]
140-
[href "/doc/latest/report.html#graph"]
140+
[href ,(doc-url "report.html#graph")]
141141
[target "_blank"]) "?"))
142142
(svg)
143143
(div ([id "functions"]))
@@ -155,7 +155,7 @@
155155
,@(if target-cost `([data-target-cost ,(~a target-cost)]) '()))
156156
(h2 "Accuracy vs Speed"
157157
(a ([class "help-button float"]
158-
[href "/doc/latest/report.html#cost-accuracy"]
158+
[href ,(doc-url "report.html#cost-accuracy")]
159159
[target "_blank"]) "?"))
160160
(div ([class "figure-row"])
161161
(svg)

src/web/resources/doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/web/traceback.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
(summary (h2 "Specification")
3535
,dropdown
3636
(a ([class "help-button float"]
37-
[href "/doc/latest/report.html#spec"]
37+
[href ,(doc-url "report.html#spec")]
3838
[target "_blank"]) "?"))
3939
,body)))
4040

0 commit comments

Comments
 (0)