If you are a git user, you can install the theme and keep up to date by cloning the repo:
git clone https://github.com/dracula/pygments.git
Download using the GitHub .zip download option and unzip them.
You can generate the CSS stylesheet (also included in this repository) by using the included dracula.py
file and the Pygments Command Line Interface:
-
Download Pygments on your machine
-
Check install location by attempting to install again (may vary depending on Python setup, e.g., Anaconda) by running.
pip install Pygments
Which will return:
Requirement already satisfied: Pygments in /path/to/pygments
Therefore:
- For an Anaconda setup it should be in
~/anaconda3/lib/python3.x/site-packages/pygments
- For a non-Anaconda setup it should be in
/usr/local/lib/python3.x/dist-packages/pygments
- For an Anaconda setup it should be in
-
Copy
dracula.py
into thestyles
folder. -
Run the following command on your terminal:
pygmentize -S dracula -f html > dracula.css
To use with iPython:
-
Run iPython on your Terminal of choice.
ipython
-
To create the blank configuration files, run:
ipython profile create [profilename]
If you leave out the profile name, the files will be created for the
default
profile. These will typically be located in~/.ipython/profile_default/
, and will be namedipython_config.py
. -
Open
ipython_config.py
file and append the following:c = get_config() c.TerminalInteractiveShell.highlighting_style = "dracula" c.TerminalInteractiveShell.true_color = True