Giter Club home page Giter Club logo

Comments (5)

jlphillipsphd avatar jlphillipsphd commented on August 19, 2024

One more thing: I can see in install.py that the user=True option is used throughout. Would a simple user=False option probably make this work?

Edit: Tried the above and installed via flit. Looks like the python bits started working now, so the cite2c/zotero_oauth now works! However, the rendering problems remain, and it appears that most of the js files are being requested at server root url (/) instead of using 'base_url' (which seems to be fine for the python scripts). For example, /nbextension is being used instead of /my/hub/user/uid/nbextension. So, I guess the question would be: what would I use in the js parts of the extension to get that url, or is that even possible? I would like to prepend that onto the jquery/ajax requests so that the other files (.css and .js) can be used.

Getting close now, any help would be greatly appreciated.

from cite2c.

takluyver avatar takluyver commented on August 19, 2024

Hi, you're the first person I've heard from trying to install cite2c with Jupyterhub - I'm excited to see it being used for a group like that.

The short answer is that I think modifying the install functions to use user=False should do what you need, so long as all your users are on the same filesystem (not in e.g. docker containers).

(If the users are in docker containers, then I expect it's just a case of installing and enabling cite2c inside the docker container)

There are four pieces I can think of that need to be in place for cite2c to work:

  • The Python package cite2c needs to be somewhere that the users individual notebook server can import it. This is what pip typically takes care of. Depend on how your single user servers are set up, there may be a shared directory that you can install it in, or you might need to install it for every user.
  • The cite2c/nbext subfolder needs to be copied to an nbextensions directory called cite2c. If your users are working on the same filesystem, it can go in /usr/local/share/jupyter/nbextensions/cite2c (see the 'data' section on jupyter --paths for the list of places it looks for nbextensions).
  • The server config needs to tell the server to load the cite2c.handlers module as an extension. There's some extra code (jupyter/notebook#2108) so extensions can be specified systemwide without system and user config clashing.
  • The frontend config needs to tell the Javascript to load cite2c/main for the nbextension part of cite2c.

from cite2c.

jlphillipsphd avatar jlphillipsphd commented on August 19, 2024

Thanks for the info, I'll definitely be using it moving forward.

I made some progress getting cite2c to work with JupyterHub so that the extension can at least now be installed by each user locally. There were a couple of changes necessary to get it work, and those can be found here: #36
With the update, and with cite2c installed alongside JupyterHub, users are able to run 'python -m cite2c.install' from a terminal to activate the extension on a case-by-case basis.

I have not yet had luck getting the system-wide install to work. Setting user=False in the installation script seemed easy enough, but the files get copied to /usr/local/ instead of where the jupyterhub shared files seem to be located (I am using virtualenv). However, I will keep working on this and hopefully have something to contribute back soon...

from cite2c.

jlphillipsphd avatar jlphillipsphd commented on August 19, 2024

Given that I am also running JupyterLab on the same JupyterHub installation and that I am happy with the current way that cite2c works with JupyterHub now, I am thinking that putting more time into making cite2c compatible with JupyterLab/Hub might be a better use of time instead of the standard notebook server.

Currently, users can visit the standard server at /tree and use cite2c, but JupyterLab is just out of luck for now -> citations do not render (but that's pretty much expected since cite2c isn't compatible with JupyterLab yet).

Any thoughts or concerns about this?

from cite2c.

TS-CUBED avatar TS-CUBED commented on August 19, 2024

Thanks for this plugin.

I use cite2c in jupyter notebook, and have tried to get it to work in jupyterhub. Reading this thread I thought the problems were fixed, but while I can get it installed and started, I do get the layout and (not) rendering problems mentioned in this thread:
Installation issues:

  • jupyter notebook installation does not carry over to the spawned notebook servers, need to repeat cite2c installation for the jupyterhub user from within the spawned server (not sure why, but if that's required I can live with that).

After that the cite2c extension is loaded and shows the icons, but:

  • On first start it tries to connect to Zotero for authentication, but the link points to a file:// address -> error 404, I can solve this by copying the zotero auth file from the earlier installation manually (no problem)
  • cite2c starts, but the search window expands the list of references into a very narrow sliver.
  • inserting a reference will create the cite tags and the bibliography can be inserted and creates the proper code as well. However, it does not render anything. Seems that citeproc isn't called correctly.

Should this work, or have I misinterpreted jlphillipsphd: "... and that I am happy with the current way that cite2c works with JupyterHub now,.." and it still only works in jupyter notebook? Or is my installation broken?

from cite2c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.