def add_require_js_path(app, env):
    """Insert the require javascript package url, to pages created from notebooks."""
    config = app.config
    if not (getattr(env, 'ipysphinx_created_from_nb', set()) or config.
        ipysphinx_always_add_jsurls):
        return
    if config.ipysphinx_require_jsurl is None:
        requirejs_path = (
            'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js'
            )
    else:
        requirejs_path = config.ipysphinx_require_jsurl
    if config.ipysphinx_requirejs_options is None:
        requirejs_options = {'integrity':
            'sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=',
            'crossorigin': 'anonymous'}
    else:
        requirejs_options = config.ipysphinx_requirejs_options
    app.add_js_file(requirejs_path, **requirejs_options)
