Skip to content

Commit 57ed4fe

Browse files
authored
Add syntax highlighting to readme (#63)
2 parents ace4525 + ee99294 commit 57ed4fe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Shellingham detects what shell the current Python executable is running in.
1111
Usage
1212
=====
1313

14-
::
14+
.. code-block:: python
1515
1616
>>> import shellingham
1717
>>> shellingham.detect_shell()
@@ -43,13 +43,16 @@ Shellingham raises ``ShellDetectionFailure`` if there is no shell to detect,
4343
but *your application should almost never do this to your user*.
4444

4545
A practical approach to this is to wrap ``detect_shell`` in a try block, and
46-
provide a sane default on failure::
46+
provide a sane default on failure
47+
48+
.. code-block:: python
4749
4850
try:
4951
shell = shellingham.detect_shell()
5052
except shellingham.ShellDetectionFailure:
5153
shell = provide_default()
5254
55+
5356
There are a few choices for you to choose from.
5457

5558
* The POSIX standard mandates the environment variable ``SHELL`` to refer to
@@ -63,7 +66,9 @@ There are a few choices for you to choose from.
6366
This can always be used to launch a usable command prompt (e.g. `cmd.exe` on
6467
Windows).
6568

66-
Here's a simple implementation to provide a default shell::
69+
Here's a simple implementation to provide a default shell
70+
71+
.. code-block:: python
6772
6873
import os
6974

0 commit comments

Comments
 (0)