Skip to content

Commit

Permalink
Remove relative URL that breaks distribution (#715)
Browse files Browse the repository at this point in the history
* Remove relative URL that breaks distribution!

* Export doc-url
  • Loading branch information
pavpanchekha committed Jan 31, 2024
1 parent 1e3c827 commit f2d431b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
10 changes: 7 additions & 3 deletions src/web/common.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

(provide render-menu render-warnings render-large render-comparison render-program
render-bogosity render-help
format-percent
format-percent doc-url
program->fpcore program->tex render-reproduction js-tex-include)

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


(define (doc-url page)
(format "https://herbie.uwplse.org/doc/~a/~a" (*herbie-version*) page))

(define/contract (render-menu #:path [path "."] name links)
(->* (string? (listof (cons/c string? string?)))
(#:path string?)
Expand Down Expand Up @@ -265,7 +269,7 @@
(summary
(h2 "Reproduce")
(a ([class "help-button float"]
[href "/doc/latest/report.html#reproduction"]
[href ,(doc-url "report.html#reproduction")]
[target "_blank"]) "?"))
(pre ((class "shell"))
(code
Expand All @@ -279,7 +283,7 @@

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

(define js-tex-include
Expand Down
6 changes: 3 additions & 3 deletions src/web/make-graph.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
(summary (h2 "Specification")
,dropdown
(a ([class "help-button float"]
[href "/doc/latest/report.html#spec"]
[href ,(doc-url "report.html#spec")]
[target "_blank"]) "?"))
,body
(p "Sampling outcomes in " (kbd ,(~a (representation-name repr))) " precision:")
Expand All @@ -137,7 +137,7 @@
(h2 "Local Percentage Accuracy vs "
(span ([id "variables"]))
(a ([class "help-button float"]
[href "/doc/latest/report.html#graph"]
[href ,(doc-url "report.html#graph")]
[target "_blank"]) "?"))
(svg)
(div ([id "functions"]))
Expand All @@ -155,7 +155,7 @@
,@(if target-cost `([data-target-cost ,(~a target-cost)]) '()))
(h2 "Accuracy vs Speed"
(a ([class "help-button float"]
[href "/doc/latest/report.html#cost-accuracy"]
[href ,(doc-url "report.html#cost-accuracy")]
[target "_blank"]) "?"))
(div ([class "figure-row"])
(svg)
Expand Down
1 change: 0 additions & 1 deletion src/web/resources/doc

This file was deleted.

2 changes: 1 addition & 1 deletion src/web/traceback.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
(summary (h2 "Specification")
,dropdown
(a ([class "help-button float"]
[href "/doc/latest/report.html#spec"]
[href ,(doc-url "report.html#spec")]
[target "_blank"]) "?"))
,body)))

Expand Down

0 comments on commit f2d431b

Please sign in to comment.