External JS url - Pretty Print Highlighter


#1

Hello,
Can anyone help me with the issue ?
I can’t append external JS, but external CSS works very well.

Warning:

UserWarning:
A local version of https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js is not available. 

Code (cut):

import dash 
import dash_core_components as dcc 
import dash_html_components as html 
from dash.dependencies import Input, Output 
import plotly.graph_objs as go 

app = dash.Dash(__name__, static_folder='assets')

app.css.append_css({'external_url': 'assets/body.css'})

app.css.append_css({'external_url': 'https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css'})

app.scripts.append_script({'external_url': 'https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js'})

# , className="prettyprint"      # Google Prettify class

app.scripts.config.serve_locally = False 

# ...
# ... 

html.Div([
                            html.Pre([
                                code_text                             # i want to highlight this text
                            ], className="prettyprint" )              # Google Prettify class
                        ], className="ui segment", style={'overflow':'auto', 'height':'600px'}) 
 

# .......
# ......... 

if __name__=='__main__':
app.run_server(debug=True)

Thanks