Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent sphinx from making a url a hyperlink?

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?

like image 388
UsAaR33 Avatar asked Dec 04 '12 03:12

UsAaR33


2 Answers

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.

like image 169
ddbeck Avatar answered Sep 18 '22 04:09

ddbeck


In addition to @ddbeck answer, to escape email addresses, prefix the @ with a slash.

login\@<hostname>
like image 21
Montecarlo Avatar answered Sep 19 '22 04:09

Montecarlo