From de7e55688fc895c6e6bab4eb02d18fdc91fcba45 Mon Sep 17 00:00:00 2001 From: Zach Shepherd Date: Thu, 8 Jun 2017 15:56:38 -0700 Subject: [PATCH] fixup! Add documentation for Google --- certbot-dns-google/docs/_ext/jsonlexer.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 certbot-dns-google/docs/_ext/jsonlexer.py diff --git a/certbot-dns-google/docs/_ext/jsonlexer.py b/certbot-dns-google/docs/_ext/jsonlexer.py new file mode 100644 index 000000000..1ad004d2b --- /dev/null +++ b/certbot-dns-google/docs/_ext/jsonlexer.py @@ -0,0 +1,16 @@ +"""Copied from https://stackoverflow.com/a/16863232""" + +def setup(app): + # enable Pygments json lexer + try: + import pygments + if pygments.__version__ >= '1.5': + # use JSON lexer included in recent versions of Pygments + from pygments.lexers import JsonLexer + else: + # use JSON lexer from pygments-json if installed + from pygson.json_lexer import JSONLexer as JsonLexer + except ImportError: + pass # not fatal if we have old (or no) Pygments and no pygments-json + else: + app.add_lexer('json', JsonLexer())