In my docs, I occasionally use "garbage" urls as examples and don't want them to be hyperlinks to nowhere. Is there any syntax to make these urls not hyperlinks?
There are three ways to format such URLs so that they are not hyperlinks. The first is to treat sample URLs like other code samples and enclose them in backquotes, like this:
open ``http://www.example.com`` in a web browser
The second is to use the Sphinx :samp:
role, like this:
open :samp:`http://www.example.com` in a web browser
The :samp:
role lets you have variable parts emphasized. So, for example, you could indicate a user-selected port number, like this:
open :samp:`http://www.example.com:{port}` in a web browser
and the word port would appear emphasized and braces omitted.
The last option is to prepend the sample URL with a backslash, like this:
open \http://www.example.com in a web browser
The URL will appear as ordinary text, without being a link or having any special formatting.
In addition to @ddbeck answer, to escape email addresses, prefix the @ with a slash.
login\@<hostname>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With