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

Put hyperlinks in bibliography #45

Closed
quantitative-technologies opened this issue Mar 18, 2022 · 10 comments · Fixed by #47
Closed

Put hyperlinks in bibliography #45

quantitative-technologies opened this issue Mar 18, 2022 · 10 comments · Fixed by #47
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@quantitative-technologies

All my bibliography entries have URL links to arXiv, doi, a direct link to a pdf version of the paper, etc...

However, these links are not clickable. Wouldn't it be better if they were?

@krassowski
Copy link
Owner

Thanks for the suggestion. Could you please post a screenshot of the element where links are not clickable that you are referring too?

@quantitative-technologies
Copy link
Author

Hello. Yes, here are the first couple of entries in the bibliography. Nothing is clickable in the bibliograpy, even though these are URLs:

Screenshot_2022-03-19_02-35-04

@krassowski
Copy link
Owner

I get it now, thanks!

It looks like citeproc-js has a built-in, undocumented, extension which is off by default which allows to achieve that. It is called wrap_url_and_doi and the fix may be as simple as enabling it (if user chooses to do so).

I also considered re-using the JupyterLab autolinking code. It would require some modofications or a strong assumption that there is no formatting HTML in the URL as returned by cireproc-js. In either case, we must rely on implementation detail of citeproc-js, so I lean towards the first solution (enabling wrap_url_and_doi).

Conveniently I left a comment on how to enable development extensions:

// engine.opt.development_extensions.apply_citation_wrapper = true;

I believe that user should be able to turn it off, so we would need to have an extra setting as in the case of linkToBibliography which was added in #42.

@krassowski krassowski added enhancement New feature or request good first issue Good for newcomers labels Mar 19, 2022
@quantitative-technologies
Copy link
Author

OK, thanks. I'm afraid I'm not familiar with citeproc-js, so I probably will not attempt to enable wrap_url_and_doi myself.

@krassowski
Copy link
Owner

This feature was just released in version 0.3.0; for now it is enabled by default (and can be disabled in settings), but in the future we can revise whether most users want it on or off by default.

@krassowski
Copy link
Owner

We could also think about styling it so that the link color is not as bright blue? Please let me know what you think.

@quantitative-technologies
Copy link
Author

I upgraded to try it out. The existing bibliography looks the same as before, I guess to be expected.

However, when I click the insert bibliography button, it just puts:

<!-- BIBLIOGRAPHY START -->
<div class="csl-bib-body">
</div>
<!-- BIBLIOGRAPHY END -->

Did I do something wrong?

@krassowski
Copy link
Owner

  • Do you see the new setting in the Advanced Settings Editor?
  • Is there any error in web developer console tab?

@krassowski
Copy link
Owner

Also, what version of JupyterLab are you using? I would recommend the latest 3.3 (I do not have bandwidth to support older versions on this project).

@quantitative-technologies
Copy link
Author

I tried again and it works just fine:

Screenshot_2022-03-27_13-28-17

I don't know what i did wrong, maybe forgot to restart jupyter-lab? I'm using version 3.2.9 btw.

As far as appearance, I think it looks good as is!

What happened though, is I found that a jupyter notebook was not suitable for sharing my work (e.g. it does not support foldable code outputs, and including images did not work nicely: HTML code cannot be hidden but is needed AFAIK to resize the image, and so on...)

So I made a jupyter-book. This has its own system for the bibliography, using a .bib file. Here is what the result looks like:

Screenshot_2022-03-27_13-29-11

The thing is I missed your plugin for adding the references to the jupyter-book document using jupyter-lab. I had to copy and paste the identifier from the .bib file each time. But I supposed that would be for a different plugin...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants