diff options
| author | Septatrix <24257556+Septatrix@users.noreply.github.com> | 2020-03-08 17:20:15 +0100 |
|---|---|---|
| committer | Septatrix <24257556+Septatrix@users.noreply.github.com> | 2020-03-08 17:20:15 +0100 |
| commit | da5f5078e1d574c35cfc784194f172de68feaedd (patch) | |
| tree | e477d2b198ae7f8370d25bb28b9424daf0bbefdc /sphinx/builders/html | |
| parent | 6041e7a15f4483fbf6e8d742863b14f4fa56b642 (diff) | |
| download | sphinx-git-da5f5078e1d574c35cfc784194f172de68feaedd.tar.gz | |
Check existence of dark highlighter
Diffstat (limited to 'sphinx/builders/html')
| -rw-r--r-- | sphinx/builders/html/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index 5105c4e2c..1ff529ca1 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -740,8 +740,9 @@ class StandaloneHTMLBuilder(Builder): with open(path.join(self.outdir, '_static', 'pygments.css'), 'w') as f: f.write(self.highlighter.get_stylesheet()) - with open(path.join(self.outdir, '_static', 'pygments_dark.css'), 'w') as f: - f.write(self.dark_highlighter.get_stylesheet()) + if self.dark_hightlighter: + with open(path.join(self.outdir, '_static', 'pygments_dark.css'), 'w') as f: + f.write(self.dark_highlighter.get_stylesheet()) def create_pygments_aux_style_files(self) -> None: """create a style file for pygments.""" |
