Giter Club home page Giter Club logo

cite2c's Introduction

Live citations in IPython notebooks

screenshot

To install this:

python3 -m pip install cite2c
python3 -m cite2c.install
(Start/Restart the Notebook server)

It requires Jupyter Notebook 4.2 or above.

After (re)starting the notebook server, you will see two new toolbar buttons: toolbar buttons. The left one inserts a citation at the current point in a Markdown cell. The right one inserts a bibliography.

This extension has two main components:

  • UI for finding citations from a Zotero library and inserting them into Markdown cells. The citations are stored in the notebook metadata, and referenced by an ID.
  • Code to run citeproc-js when a Markdown cell is rendered, rendering both bibliographies and inline citations.

cite2c's People

Contributors

jlphillipsphd avatar jona-sassenhagen avatar ohjeah avatar rgbkrk avatar takluyver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cite2c's Issues

Question: I modified `citeproc.js` to prevent line-breaks between number & text in citations. Wondering if there are any unintended consequences

Hi,
Thank you so much for creating cite2c. It is really great. The following figure shows an example rendering in the default (chicago-author-date) citation style.

chicago

I wanted to change the citation style from chicago-author-date to another style (specifically to frontiers-in-optics). So, after downloading the appropriate CSL files from Zotero reference, I changed chicago-author-date.csl to frontiers-in-optics.csl in rendering.js. However, I got the following output:

frontiers-in-optics

As you can see, a line break was inserted after every number in the numbered list.

In order to prevent this from happening I changed the <div>...</div> to <span>...</span> for rendering csl-left-margin and csl-right-inline in the file citeproc.js which produced the following (expected) output:

frontiers-in-optics_afterchangetospan

The problem is that I'm not sure if this change could have any adverse effect on the code. If you think that it will, it would be get if you could suggest an alternative.

Thank you.

installation issues

ruxi@lifemint ~/git/cite2c $ ./install.py
from: can't read /var/mail/os.path
from: can't read /var/mail/IPython.html.nbextensions
from: can't read /var/mail/IPython.html.services.config
./install.py: line 5: syntax error near unexpected token "Installing nbextension ..."' ./install.py: line 5:print("Installing nbextension ...")'

Not loading

Hi, I just wanted to try the extension, I got a bit of a problem, maybe you've come around it before. I followed the instructions, copying the directory inside $(ipython locate)/nbextensions/ and copying IPython.load_extensions('cite2c/main'); to my config.js file. Nonetheless I get always the following error message when i'm trying to load a file.

WARNING:tornado.access:404 GET /static/services/config.js (127.0.0.1) 0.43ms referer=http://localhost:8888/tree
WARNING:tornado.access:404 GET /static/services/config.js (127.0.0.1) 0.41ms referer=http://localhost:8888/notebooks/Untitled0.ipynb

And the it simply doesn't run.

Any ideas? Thanks!

Install problem

Hi,

I juste pulled the last version (today) of the official repo. and the install don't work anymore.
This is because the dir nbextensions do not exist anymore.

Cheers,

New icons don't appear in Jupyter notebook

While my python 3.6 fully updated conda environment was active, I did:

  • pip install cite2c
  • python -m cite2c.install

After launching a new notebook server, and opening a notebook, I was expecting to see the new icons meantioned in the README, but they are not there.

FYI, I am using the nbextension configurator with a couple of other extensions that create new icons in the notebook toolbar, i'm just thinking if you used absolute icon positions, maybe they are overwritten by some of my other extensions?
Otherwise I don't see any errors.

Work out some story for exporting citations to Latex

People will inevitably want to export notebooks to Latex, despite my misgivings about it. This will involve turning the citations into latex \cite{foo} commands (see the citation filter in nbconvert), possibly re-keying them, and creating a bibtex file with the corresponding citation data.

For creating the bibtex file: I've not yet found a tool that will convert CSL JSON to bibtex. Pandoc-citeproc does the other way. Bibutils goes between various citation format, but not CSL JSON, and it's GPLed, so I'd rather avoid it if possible. Is there something out there to do it? Is Bibtex simple enough that we can do it ourselves?

Zotero can import CSL JSON and export Bibtex, so it must have the necessary code, but I don't know how easy it would be to pull it out.

Failing anything else, references can be re-downloaded from the Zotero web API in Bibtex format, but then all the citations must be in Zotero, and in one user/group library. That's how citations are inserted, but at present, once they're in the document, it doesn't matter where they came from, and it would be nice to preserve that abstraction.

I can't execute the cite2c/main.

I had install cite2c/main. But in my configurable nbextensions, the cite2/main is gray as following figure , it can't be used. Why? Would you help me? Thank you very much.

Uploading A9174681-3AED-4CE2-BF34-842248A1E58F.png…

500 : Internal Server Error

I installed cite2c on windows 10 but get a 500 error on the site http://localhost:8888/cite2c/zotero_oauth while pressing the cite button. I have restart.

After the startup of my notebook I get:
[W 13:44:33.614 NotebookApp] Could not find Zotero citation styles directory.

After pressing the Cite button I get the following messages/calllstack:

[I 13:44:33.976 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 13:45:33.182 NotebookApp] Kernel started: f7f86268-89ed-410f-8ec2-6dc4334f3b27
[W 13:45:33.413 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200306134433 (::1) 15.04ms referer=http://localhost:8888/notebooks/Emmissivity.ipynb
[I 13:45:34.486 NotebookApp] Adapting to protocol v5.1 for kernel f7f86268-89ed-410f-8ec2-6dc4334f3b27
[E 13:45:36.480 NotebookApp] Uncaught exception GET /cite2c/zotero_oauth (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/cite2c/zotero_oauth', version='HTTP/1.1', remote_ip='::1', headers={'Host': 'localhost:8888', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36', 'Sec-Fetch-Dest': 'document', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-User': '?1', 'Referer': 'http://localhost:8888/notebooks/Emmissivity.ipynb', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.9', 'Cookie': '_xsrf=2|86ded06b|5f1b66826a8f048a894e912f397c4c4c|1582727828; username-localhost-8889="2|1:0|10:1583410043|23:username-localhost-8889|44:YzE1NjM0ODFlMWY5NGFmMTk0MmM4OGFmOWM3MjZiZTM=|02c2b870066f4fd514e02cec1ad6894fba547a9b038edd2e302f50fd5ac6477c"; username-localhost-8888="2|1:0|10:1583498673|23:username-localhost-8888|44:MGNjMzcwMDk0YjE3NGJiYWIxZjkxY2VmYTkwMjFiZTU=|c85014303590dcf3672fff77560919081cdb2b2207eecead265fdb4a40f9b97f"'})
Traceback (most recent call last):
File "c:\IntelPython3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 441, in wrap_socket
cnx.do_handshake()
File "c:\IntelPython3\lib\site-packages\OpenSSL\SSL.py", line 1806, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "c:\IntelPython3\lib\site-packages\OpenSSL\SSL.py", line 1546, in _raise_ssl_error
_raise_current_error()
File "c:\IntelPython3\lib\site-packages\OpenSSL_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\IntelPython3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "c:\IntelPython3\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "c:\IntelPython3\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "c:\IntelPython3\lib\site-packages\urllib3\connection.py", line 326, in connect
    ssl_context=context)
  File "c:\IntelPython3\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "c:\IntelPython3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 448, in wrap_socket
    raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\IntelPython3\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "c:\IntelPython3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "c:\IntelPython3\lib\site-packages\urllib3\util\retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.zotero.org', port=443): Max retries exceeded with url: /oauth/request?oauth_consumer_key=8cc04771a4e2ef9c9c4d&oauth_nonce=72b39765172c341dcd321f481cc5a0eff75384ff&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1583498736&oauth_version=1.0&oauth_callback=http%3A%2F%2Flocalhost%3A8888%2Fcite2c%2Fzotero_oauth_cb&oauth_signature=iB8TDW6HGpkQB5UHgBgJnwWC%2FXc%3D (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\IntelPython3\lib\site-packages\tornado\web.py", line 1509, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "c:\IntelPython3\lib\site-packages\cite2c\zotero_oauth.py", line 42, in get
    params={'oauth_callback': callback}
  File "c:\IntelPython3\lib\site-packages\rauth\service.py", line 242, in get_request_token
    r = self.get_raw_request_token(method=method, **kwargs)
  File "c:\IntelPython3\lib\site-packages\rauth\service.py", line 215, in get_raw_request_token
    **kwargs)
  File "c:\IntelPython3\lib\site-packages\rauth\session.py", line 210, in request
    return super(OAuth1Session, self).request(method, url, **req_kwargs)
  File "c:\IntelPython3\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\IntelPython3\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\IntelPython3\lib\site-packages\requests\adapters.py", line 506, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.zotero.org', port=443): Max retries exceeded with url: /oauth/request?oauth_consumer_key=8cc04771a4e2ef9c9c4d&oauth_nonce=72b39765172c341dcd321f481cc5a0eff75384ff&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1583498736&oauth_version=1.0&oauth_callback=http%3A%2F%2Flocalhost%3A8888%2Fcite2c%2Fzotero_oauth_cb&oauth_signature=iB8TDW6HGpkQB5UHgBgJnwWC%2FXc%3D (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))

[E 13:45:36.505 NotebookApp] {
"Host": "localhost:8888",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36",
"Sec-Fetch-Dest": "document",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-User": "?1",
"Referer": "http://localhost:8888/notebooks/Emmissivity.ipynb",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Cookie": "_xsrf=2|86ded06b|5f1b66826a8f048a894e912f397c4c4c|1582727828; username-localhost-8889="2|1:0|10:1583410043|23:username-localhost-8889|44:YzE1NjM0ODFlMWY5NGFmMTk0MmM4OGFmOWM3MjZiZTM=|02c2b870066f4fd514e02cec1ad6894fba547a9b038edd2e302f50fd5ac6477c"; username-localhost-8888="2|1:0|10:1583498673|23:username-localhost-8888|44:MGNjMzcwMDk0YjE3NGJiYWIxZjkxY2VmYTkwMjFiZTU=|c85014303590dcf3672fff77560919081cdb2b2207eecead265fdb4a40f9b97f""
}
[E 13:45:36.506 NotebookApp] 500 GET /cite2c/zotero_oauth (::1) 474.68ms referer=http://localhost:8888/notebooks/Emmissivity.ipynb

More user friendly connection to Zotero

At present, the user has to go to a Zotero settings page, and copy down a user ID that is different from their username. This is less than ideal. I'd like to be able to just use their username, but I've yet to find an API to get the userID from the username. Question on Zotero forums.

It's probably possible to do this using oauth (docs), but that's complicated. If we want access to private Zotero libraries, however, we will need to jump through that hoop. (Are user libraries public by default? I can't remember)

Source text in cell should include citation.

When I insert a citation into a Markdown cell, I get the raw text <cite data-cite="undefined"></cite> (which is then rendered as the author's name and year). This is how it's stored in the .ipynb file:

   "source": [
    "<cite data-cite=\"undefined\"></cite>"
   ]

The raw text should include the author and year of the paper, a DOI, or something else.

Multiple citations in a cluster

Citeproc-js can handle citation clusters, where you cite several references in one go, which may be rendered as '[5-7]', or '(Smith 1997, Bloggs et al. 2004)'. Cite2c should have a way to create and render these.

No Bibliography in PDF

I've gotten cite2c work in so far as that both citations and bibliography are rendered in the jupyter notebook web UI (and beautifully so!) Unfortunately, trying to export the notebook as a PDF (either via the same web UI or via

jupyter-nbconvert --SphinxTransformer.author=Jonathan --to latex --template report TestDocument.ipynb

only yields an empty Bibliography and no citations at all. It looks like #28, but that is marked as closed, so I'm not sure what I'm doing wrong? Please help!

Error while installing

I just cloned your project to my computer and tried to run python install.py. I got the following error message and if I start my notebooks with ipython notebook I do not see my folders and files anymore. Instead I see a folder called nbext and three files, init.py, handlers.py and install.py

Installing nbextension ...
Enabling the nbextension ...
Enabling the server extension ...
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/notebook/serverextensions.py", line 111, in validate_serverextension
    mod = importlib.import_module(import_name)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'cite2c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "install.py", line 26, in <module>
    main()
  File "install.py", line 22, in main
    enable_server_ext()
  File "install.py", line 17, in enable_server_ext
    toggle_serverextension_python('cite2c.handlers', enabled=True, user=True)
  File "/usr/local/lib/python3.5/dist-packages/notebook/serverextensions.py", line 84, in toggle_serverextension_python
    validate_serverextension(import_name, logger)
  File "/usr/local/lib/python3.5/dist-packages/notebook/serverextensions.py", line 114, in validate_serverextension
    logger.warning("Error loading server extension %s", import_name)
AttributeError: 'NoneType' object has no attribute 'warning'

can't install on mac

Hi,

I've managed to install it on windows, but now I need to switch to mac. When I run pip install cite2c it said Successfully installed, but when comes to python -m cite2c.install it said No module named cite2c, and the two buttons never shows up.

I can't figure out what's missing, can you help?

Thanks ahead!

"sticky loading"? citeproc-js fails to retrieve each citation

Hello,

After adding citations to a notebook and restarting the jupyter server, some (occasionally all) citations fail to load. Here's the debugger output from Firefox Version 63.0.3 (64-bit).

TypeError: item is undefined[Learn More] rendering.js:19:13

retrieveItem
http://localhost:8888/nbextensions/cite2c/rendering.js:19:13
CSL.Engine.prototype.retrieveItem
http://localhost:8888/nbextensions/cite2c/citeproc.js:1613:12
CSL.Engine.prototype.processCitationCluster
http://localhost:8888/nbextensions/cite2c/citeproc.js:3457:16
process_cell_citations
http://localhost:8888/nbextensions/cite2c/rendering.js:76:27
reprocess_all
http://localhost:8888/nbextensions/cite2c/rendering.js:116:17
success
http://localhost:8888/nbextensions/cite2c/rendering.js:133:17
u
jquery.min.js:2
fireWith
jquery.min.js:2
k
jquery.min.js:2
n/<
jquery.min.js:2
Exception in event handler for rendered.MarkdownCell TypeError: "item is undefined"

	retrieveItem http://localhost:8888/nbextensions/cite2c/rendering.js:19:13
	retrieveItem http://localhost:8888/nbextensions/cite2c/citeproc.js:1613:12
	processCitationCluster http://localhost:8888/nbextensions/cite2c/citeproc.js:3457:16
	process_cell_citations http://localhost:8888/nbextensions/cite2c/rendering.js:76:27
	md_cell_rendered http://localhost:8888/nbextensions/cite2c/rendering.js:103:9
	dispatch http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:41720
	handle http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:39774
	trigger http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:69549
	trigger http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:70138
	each http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:2571
	each http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:1238
	trigger http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:70117
	trigger http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:28677:13
	render http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:33474:17
	done http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:30566:11
	marked http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:30580:31
	marked http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:30578:8
	render http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:33438:13
	execute http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:33191:9
	execute_cells http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:44771:13
	execute_selected_cells http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:44783:9
	handler http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:48271:17
	<anonymous> http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:48997:25
	call http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:49099:36
	call_handler http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:34185:20
	handle_keydown http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:49322:20
	bind_events http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:49288:20
	dispatch http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:41720
	handle http://localhost:8888/static/notebook/js/main.min.js?v=9ff2eb1d7b82b8735bb6f86206d48c5a:2:39774
Arguments
​
0: "rendered.MarkdownCell"
​
1: Object { cell: {…} }
​
callee: Getter & Setter
​
length: 2
​
Symbol(Symbol.iterator): function values()
​
<prototype>: Object { … }
events.js:33
events.trigger
events.js:33
MarkdownCell.prototype.render/<
textcell.js:438
done
marked.js:1411
marked/<
marked.js:1425
marked
marked.js:1423
MarkdownCell.prototype.render
textcell.js:402
TextCell.prototype.execute
textcell.js:155
Notebook.prototype.execute_cells
notebook.js:2432
Notebook.prototype.execute_selected_cells
notebook.js:2444
handler
actions.js:164
<anonymous>
actions.js:890
ActionHandler.prototype.call
actions.js:992
ShortcutManager.prototype.call_handler
keyboard.js:554
KeyboardManager.prototype.handle_keydown
keyboardmanager.js:213
KeyboardManager.prototype.bind_events/<
keyboardmanager.js:179
dispatch
jquery.min.js:2
add/y.handle
jquery.min.js:2

expected result

I expect executing a markdown cell with a valid instance of <cite data-cite="foo/bar"></cite> to call

retrieveItem
http://localhost:8888/nbextensions/cite2c/rendering.js:19:13
CSL.Engine.prototype.retrieveItem
http://localhost:8888/nbextensions/cite2c/citeproc.js:1613:12
CSL.Engine.prototype.processCitationCluster

and render all citations in that cell appropriately.

attempted workarounds

  1. edit, and re-execute markdown cell
    • produces error above
  2. restart jupyter server
    • produces error above
  3. call window.location.reload() to try to force citeproj-js to run again
    • produces error above
  4. try 1 with google chrome
  5. go through notebook and at each instance of <cite data-cite="foo/bar"></cite>, use the tool bar to re-insert the citation
    • produces no errors, but is a hassle

Thank you,
-Colton

jupyterhub: hub-wide installation and/or hub compatibility

I have a jupyterhub installation serving single-user notebooks (wonderful tools!), and would like to have everyone be able to use cite2c for inline citations in their notebooks.

I guess my short question would be: Looking at the install.py script, it looks like it's only able to install for the local user? Is there any known way to install for all users under jupyterhub?

I realize they may need some local files installed in their accounts (like .cls files and such that are installed with zotero - which I have done for one user account for testing purposes). However, the handlers still don't seem to be working properly. Even if I use "python -m cite2c.install" as that user, the cite2c/zotero_oauth page doesn't load and results in a 404 response. I can get a little farther if I manually set up the cite2c.json file with my credentials, but the search gui isn't displaying correctly, and (even though I can get it to read my library, and insert the correct tag information) the citations don't get rendered inline nor in the bibliography. I don't understand the software enough to make any more headway at the moment, but if there are any suggestions on what might need to be altered, I might be able to make some more progress.

Sorry if this has already been addressed before, but I couldn't find any mention of cite2c being used with jupyterhub anywhere.

Can't authenticate?

I've installed via pip. Opening a new notebook, I get the cite toolbar items. When I click it, a new tab opens at http://localhost:8888/cite2c/zotero_oauth and I get a popup Opened a new tab to authenticate with Zotero. Once you have done this, please click OK.. However, the new tab (cite2c/zotero_oauth) is a 404, and I can't see how I can authenticate anything. What am I doing wrong? Thanks!

Drop citations from bibliography more reliably

At present, deleted citations are only dropped from the bibliography the next time a citation is processed. So if you delete a cell containing citations, or edit a cell and remove all citations from it, those removed citations linger in the bibliography until the next time a Markdown cell containing citations is rendered. They should disappear more promptly.

Search Zotero brings up nothing / can't see how to change Zotero ID

I am running Jupyter 4.3.0using Firefox and Opera as browsers. I have just installed cite2c. When I use the 'Insert citation' button in Opera, it always tells me there are no matches - regardless of what the search terms were. When I do it in Firefox, I get no response at all. Either way, no citation is inserted.

It occurs to me that there may have been a problem in connecting to Zotero (e.g. I suppose it's possible that I entered the ID incorrectly, though there was no error message at the time), but I can't see any way of changing or resetting this and reconnecting.

nothing happens when clicking insert citation

I was trying to get the 'insert citation' feature to work but it couldn't fetch any papers, so I looked at the issues and found I had to make my Zotero librabry public. I did it but still no citations found.

So I tried to refresh my account name by setting it to None as suggested in #9.
From that moment, whenever I click on insert citation nothing happens (I tried to reset my username correctly).

Privacy settings in zotero

The README should mention that it is necessary to check the "Publish entire library" setting in "Settings->Privacy" in the Zotero webapp. Otherwise, none of your citations will show up since there is no auth being done. Thanks to this blog post for pointing this out.

Show rendered output without extension installed

It would be very helpful if the output of cite2c (after rendering) would be visible without cite2c installed. For example, it is quite useful to have a quick look at a notebook in Github:

Sample.ipynb

But there is nothing shown. Could this feature be added?

DOWNGRADE NECESSARY - With Jupyter Notebook > 6.2.0: reference not visible in the notebook - "template_paths" error -

Necesssary to downgrade the version of jupyter notebook to 6.2.0 otherwise the reference not appear in the notebook.
The metadatas are integrated but a difference appear ( the id is not appearing in the JSON)

"citations": {
"2272257/24VKMX7M": {
"ISBN": "978-1-107-14507-8",
"abstract": "This book investigates the working mechanisms of public opinion in Late Republican Rome as a part of informal politics. It explores the political interaction (and sometimes opposition) between the elite and the people through various means, such as rumours, gossip, political literature, popular verses and graffiti. It also proposes the existence of a public sphere in Late Republican Rome and analyses public opinion in that time as a system of control. By applying the spatial turn to politics, it becomes possible to study sociability and informal meetings where public opinion circulated. What emerges is a wider concept of the political participation of the people, not just restricted to voting or participating in the assemblies.",
"author": [
{
"family": "Rosillo-López",
"given": "Cristina"
}
],
"event-place": "Cambridge",
"id": "2272257/24VKMX7M", DOESN'T APPEAR in Jupyter Notebook > 6.2.9
"issued": {
"year": 2017
},
"language": "en",
"note": "Google-Books-ID: K9zFDgAAQBAJ",
"number-of-pages": "283",
"publisher": "Cambridge University Press",
"publisher-place": "Cambridge",
"title": "Public Opinion and Politics in the Late Roman Republic",
"type": "book"
},

install problem

Hi,

Sorry but I am new to github, python etc, hope I don't annoy anyone too much. I am trying to install cite2c using jupyer notebook on sagemathcloud. In my ignorance:

  1. I copied all the cite2c files, folders into a seperate empty folder
  2. .gitignore wouldn't copy over for some reason, so I carried on anyway
  3. whilst in this new folder I typed python install.py into a box which said 'terminal command' and hit the 'play' button
  4. the 'terminal command' box output the following:

Traceback (most recent call last):
File "install.py", line 3, in
from IPython.html.nbextensions import install_nbextension
ImportError: No module named html.nbextensions

I am running Windows 7 in case that has anything to do with it (can't see how as it is in the cloud). From this description it'll be clear I don't know much.

I attach a screenshot in case it helps.
screenshot_install_fail

Is the problem that I am using sagemathcloud instead of installing Jupyter locally?

Any chance of some help or advice?
Kind regards, Paul

cite2c in jupyterlab

Hi,
the plugin works a treat in the notebooks (thanks!), but I don't seem to be able to use it in jupyterlab - are there any tricks I could use/plans to make it available for jupyterlab, too?

Thanks
T

Share citations

The citations are not showing after the notebook is uploaded to git, or if other project members open the notebook locally. Probably since the citing extension uses personal credentials. Is there a workaround for that?

Does not work in nbviewer?

Hi, nice tool! Is there a way to make it work on gitHub and the nbviewer? Currently, no content is displayed, neither the citation, nor the bibliography. Thanks!

Page numbers in citations

At the moment, it doesn't seem to be possible to cite a particular page (paragraph, clause, chapter, etc) within a source. Might this feature be added? I'm not familiar with citeproc-js, but it's possible with e.g. pandoc-citeproc.

I'm hoping to use Jupyter with students, so cite2c will be a very important part of that decision - but they do need to be able to identify page numbers in their citations.

Switching citation style

A little bit tricky, because you need to initialise a new citeproc-js engine, but there's no reason this should be impossible.

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.