Comments (5)
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.
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 whatpip
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 onjupyter --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.
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.
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.
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)
- I can't execute the cite2c/main. HOT 15
- New icons don't appear in Jupyter notebook HOT 8
- nothing happens when clicking insert citation HOT 5
- cite2c in jupyterlab HOT 13
- Can't authenticate? HOT 5
- Why is it not in jupyter_contrib_nbextensions?
- "sticky loading"? citeproc-js fails to retrieve each citation HOT 3
- Can we change the citation style ? HOT 1
- No Bibliography in PDF HOT 2
- can't install on mac HOT 3
- Zotero gives no matches for any keyword HOT 1
- Is there a posibility to use this extension without zotero? HOT 1
- 500 : Internal Server Error
- Show rendered output without extension installed HOT 1
- Share citations
- references dissapear when i download .ipynb as html on jupyter notebook
- DOWNGRADE NECESSARY - With Jupyter Notebook > 6.2.0: reference not visible in the notebook - "template_paths" error -
- Reference type software integrated as a book in the metadata
- When using jupyter notebook Version: 6.5.4, it cannot be displayed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cite2c.