Reputation: 24535
I have tried following code statements to show a URL:
#lang scribble/base
@title{Testing Hyperlinks}
@section{URLs}
Getting started: @hyperlink["https://docs.racket-lang.org/scribble/getting-started.html"]
Getting started: @hyperlink{"https://docs.racket-lang.org/scribble/getting-started.html"}
Getting started: @(hyperlink "https://docs.racket-lang.org/scribble/getting-started.html")
The html page is generating without any error with command "$ scribble hyperlinks.scrbl" but it is not displaying the URLs with any of the hyperlink statement:
Testing Hyperlinks
1 URLs
Getting started:
Getting started:
Getting started:
The generated html file contains following link:
<p>Getting started:</p><p><a href=""https://docs.racket-lang.org/scribble/getting-started.html""></a></p>
Where is the problem and how can I correct this error?
Upvotes: 4
Views: 269
Reputation: 43842
The hyperlink
function expects the actual textual content to be supplied separately from the link itself. That is, you’re supposed to use it like this:
@hyperlink["http://example.com"]{some link}
And the rendered HTML will look like this:
<a href="http://example.com">some link</a>
If you want to typeset a literal URL, which links to its own content, use the url
function instead.
Upvotes: 4