diff --git a/airflow/www/app.py b/airflow/www/app.py index 7460761f0a3e3..27135d062979c 100644 --- a/airflow/www/app.py +++ b/airflow/www/app.py @@ -2,6 +2,7 @@ from datetime import datetime, timedelta import dateutil.parser from functools import wraps +import inspect import json import logging import os @@ -128,6 +129,8 @@ def wrapped_markdown(s): 'doc_rst': lambda x: pygment_html_render(x, lexers.RstLexer), 'doc_yaml': lambda x: pygment_html_render(x, lexers.YamlLexer), 'doc_md': wrapped_markdown, + 'python_callable': lambda x: pygment_html_render( + inspect.getsource(x), lexers.PythonLexer), }