Displaying backslashes in UNC paths

41 views
Skip to first unread message

Kevin Canney

unread,
Mar 17, 2021, 12:21:03 PM3/17/21
to sphinx-users

In a Sphinx project, I'm attempting to display UNC paths. Let's take \\volume\folder\ for example.

My understanding was that I'd need to double the backslashes as follows in my reStructuredText: \\\\volume\\folder\\

Doing that works correctly for the backslashes before and after "folder" but the 4 backslashes before "volume" are still displayed as a single backslash in my output: \volume\folder\

Can anyone advise how to display the double backslashes before "volume" so my output correctly displays \volume\folder?

Thanks in advance!

Stefano David

unread,
Mar 17, 2021, 1:11:44 PM3/17/21
to sphinx...@googlegroups.com
This should do the trick:

\\\ \\\ volume\\folder\\

(i.e., escape the \ then escape a space and repeat)

HTH,
Stefano

Kevin Canney

unread,
Mar 17, 2021, 1:38:12 PM3/17/21
to sphinx-users
Thank you, Stefano! When I used \\\ \\\, the output still displayed a single backslash, but \\\\\\ (with no space) produced the double backslash I needed.

Thanks so much for your (very, very quick) help!
-Kevin

Komiya Takeshi

unread,
Mar 18, 2021, 10:54:49 AM3/18/21
to sphinx...@googlegroups.com
Hi,

It seems your example `\\\\volume\\folder\\` is rendered as two
backslases as expected.
This is a HTML output on my local.

Thanks,
Takeshi KOMIYA

2021年3月18日(木) 1:21 Kevin Canney <kmca...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/651a3c96-e4c4-4005-9c88-8f2ce9d1c7f7n%40googlegroups.com.
スクリーンショット 2021-03-18 23.53.16.png
Reply all
Reply to author
Forward
0 new messages