-
Notifications
You must be signed in to change notification settings - Fork 18
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
π§π»βπ¬ Citations & bibliography #161
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some notes!
import { IRenderMimeRegistry } from '@jupyterlab/rendermime'; | ||
|
||
import { notebookCellExecuted } from './actions'; | ||
import { mystMarkdownRendererFactory } from './mime'; | ||
import { citationRenderers } from './myst'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agoose77 we need some way to share the citation renderer into the various places we use those renderer. I don't think they necessarily need to be "connected" (i.e. an update to a bib file doesn't really need to force a re-render, but the next render should bring in the right citation).
The way we have done this in the CLI is to have a state manager, that is indexed based on file name, and then we combine citation renderers before we render the markdown.
I think this could work, and maybe that works? Curious if you know of a better way to share state between the plugins?
if (renderer) { | ||
citationRenderers[bibFile] = renderer; | ||
} else { | ||
delete citationRenderers[bibFile]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the manager changes, we just update the shared state, which is then available next time we render markdown. I don't really think we need to go full: update-the bib when the markdown changes as it could potentially render every single cell.
}; | ||
} | ||
|
||
export function combineCitationRenderers(renderers: CitationRenderer[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of this is copied from the CLI, we need to create a package, share this functionality and delete it here!
activate: (app: JupyterFrontEnd) => { | ||
console.log('Using jupyterlab-myst:bibliography'); | ||
|
||
const bibFile = 'bibliography.bib'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now this only works for a single bib file in the root.
105e29b
to
f9a0137
Compare
f9a0137
to
19beaa3
Compare
Hello! I wanted to try out this preliminary version of citations & bibliography, and so I tried building this extension from this pull request. When I run
I Googled for this error, and found the following suggestion: pypa/hatch#1114 (comment) However, it didn't work for me. I wonder if this problem is indicative of some mistake on my side...? Thank you! |
Working on a first attempt to connect up citations.
Some things to think about for this PR:
bibliography.bib