Esempio n. 1
0
def swift_get_lexer_by_name(_alias, *args, **kw):
    if _alias == 'swift':
        return swift_pygments_lexers.SwiftLexer()
    elif _alias == 'swift-console':
        return swift_pygments_lexers.SwiftConsoleLexer()
    else:
        return original_get_lexer_by_name(_alias, *args, **kw)
Esempio n. 2
0
# If false, no module index is generated.
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'

# FIXME: Define intersphinx configuration.
intersphinx_mapping = {}

# -- Options for extensions ----------------------------------------------

# Enable this if you want TODOs to show up in the generated documentation.
todo_include_todos = True

# -- Patch pygments so it will know about the Swift lexers ---------------

# Pull in the Swift lexers
from os.path import abspath, dirname, join as join_paths  # noqa (E402)
sys.path = [
    join_paths(dirname(dirname(abspath(__file__))), 'utils', 'pygments')
] + sys.path

import swift as swift_pygments_lexers  # noqa (E402 module level import not at top of file)

sys.path.pop(0)

lexers['swift'] = swift_pygments_lexers.SwiftLexer()
lexers['sil'] = swift_pygments_lexers.SILLexer()
lexers['swift-console'] = swift_pygments_lexers.SwiftConsoleLexer()