Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add FileFindHandler for Notebook static files #2175

Merged
merged 8 commits into from Jul 26, 2012
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Jul 20, 2012

The static file handler now uses a search path, instead of a single dir.

This allows easier customization of available js/css,
and provides a place for extra files to go for extending the notebook.

An empty custom.js / custom.css are added to the templates for trivial custom user styling/scripting.

The search only happens once, and the result is cached after the first.

adds NotebookApp.extra_static_paths configurable for extending the search path.

The default is to include profile/static.
With FileFindHandler, these will be useful for small user overrides of css/js.
The destination is now configurable, and the default no longer requires admin access.

Also defaults to current mathjax 2.0
@Carreau
Copy link
Member

Carreau commented Jul 22, 2012

hum, this is completely broken for me.
I need to override

+    @classmethod
+    def make_static_url(cls, settings, path):

otherwise it say that path is a list and have no attributes endwidth('/')
it still complain that cls._lock does not exist.

also get is not decorated by @authendicated...

I guess there is a commit missing ?

@minrk
Copy link
Member Author

minrk commented Jul 22, 2012

It works for me, so maybe it is a tornado version thing. I will look into doing this more carefully, and checking against various tornado versions.

also get is not decorated by @authenticated...

get must not be authenticated, or you would not even be able to see the login page without having logged in already. The default StaticFileHandler does not authenticate.

@Carreau
Copy link
Member

Carreau commented Jul 22, 2012

here is the traceback of tornado.
https://gist.github.com/3160540

and I pushed a crude thing of copy/past/things I did to make it works in Carreau/_Staticfiles

also

In [3]: tornado.version
Out[3]: '2.1.1'

@Carreau
Copy link
Member

Carreau commented Jul 23, 2012

StaticFileHandler._lock only exist since 2.2.0.
make_static_url also have some recent changes.

@minrk
Copy link
Member Author

minrk commented Jul 23, 2012

Thanks, I will look more carefully at the diff between our baseline dependency (2.1.0) and 2.2-dev, and push again in the next day or two.

@minrk
Copy link
Member Author

minrk commented Jul 23, 2012

tested against 2.1.0, and fixed by pulling a few more methods from current tornado verbatim.

@Carreau
Copy link
Member

Carreau commented Jul 23, 2012

Great ! I'll test that ! It'll be cool to load js extension !

@Carreau
Copy link
Member

Carreau commented Jul 24, 2012

That's perfect, don't even need to provide user-custom templates as you can just inject any other change or file you want into the page with custom.js and jQuery.

The only issues I see is that you might hate to install things on every profiles. Does windows allows stuff like symlinks ?

@Carreau
Copy link
Member

Carreau commented Jul 25, 2012

ha ! I didn't saw the extra_static_path configurable.
That's perfect then !
Merging in 24h if no objections.

Carreau added a commit that referenced this pull request Jul 26, 2012
add FileFindHandler for Notebook static files

  * The static file handler now uses a search path, instead of a single dir.

    This allows easier customization of available js/css,
    and provides a place for extra files to go for extending the notebook.


  * An empty custom.js / custom.css are added to the templates for trivial 
    custom user styling/scripting.

    The search only happens once, and the result is cached after the first.

  * A few methods are pulled from tornado 2.2-dev verbatim to have tornado 2.1 compatibility.

  * mathjax is now installed by default in profile.
@Carreau Carreau merged commit 0eec72e into ipython:master Jul 26, 2012
@Carreau
Copy link
Member

Carreau commented Jul 26, 2012

i'll merge this guy which is great.

@minrk minrk deleted the staticfile branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
add FileFindHandler for Notebook static files

  * The static file handler now uses a search path, instead of a single dir.

    This allows easier customization of available js/css,
    and provides a place for extra files to go for extending the notebook.


  * An empty custom.js / custom.css are added to the templates for trivial 
    custom user styling/scripting.

    The search only happens once, and the result is cached after the first.

  * A few methods are pulled from tornado 2.2-dev verbatim to have tornado 2.1 compatibility.

  * mathjax is now installed by default in profile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants