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

CSL4LibreOffice - C [GSoC '24] #11577

Merged
merged 105 commits into from
Aug 12, 2024
Merged

Conversation

subhramit
Copy link
Collaborator

@subhramit subhramit commented Aug 4, 2024

New features for CSL-OO/LO integration

[PR - C of the GSoC '24 CSL4LibreOffice Project]
Follow-up to #11521

Summary:

  • Implemented "reference marks" to fix resetting index issue for numeric CSL styles
  • Added feature to auto-generate and sync a bibliography section (list of references) in the LibreOffice document based on existing citations
  • Added support for in-text citations and empty citations for CSL styles
  • Added support for underlined CSL styles
  • Added support for alphanumeric CSL styles
  • Implemented "smart spaces" feature for CSL citation insertion
  • Miscellaneous refinement and additions (e.g. new icon for "add bibliography", fixed extra newlines in case of numeric styles, disabled irrelevant buttons when CSL style is selected, upgraded to StAX parsing for information from .csl files etc.)

Background:

  • Problem 1: The behavior of in-text citations was independent of bibliographic citations, even if they corresponded to the same entry. For example, they could have different numbering (for numeric styles).
  • Problem 2: As mentioned by @Siedlerchr in CSL4LibreOffice - B [GSoC '24] #11521 (comment), a major inconvenience while citing entries independently was that the numbering index (for numeric citation styles) would get reset to 1 every time.
  • Problem 3: We first tried ways to persist consistent numbering within an OO session, the numbering would get reset again on restarting JabRef or reconnecting/restarting the LibreOffice document instance.
  • Problem 4: There was no availability of a "make bibliography" feature that would automatically read the in-text citations in the document and generate a bibliography consisting of corresponding bibliographic citations.

This PR addresses these problems by introducing two new features to JabRef's OO/LO integration - (A) Reference Marks and (B) Auto-generation of bibliography.

Demos:

  • We can now seamlessly insert citation entries (both independently or in a grouped fashion) without having to worry about maintaining the numbering across citations of any type. The numbers are maintained consistently using Reference Marks attached to citation entries.
  • We can now auto-insert bibliography into the document based on our in-text citations by pressing the loop arrow ("Make bibliography") button in the OpenOffice panel.
testVideo.mp4
  • The citation numbers are now maintained consistently across JabRef and OO/LO sessions by reading existing Reference Marks in the document.
test2.mp4
  • The implementation of the internal format of Reference Marks is very similar to that of Zotero, which consists of "JABREF_{citationKey} CID_{citationNumebr} {UID}".

Special thanks to @antalk2, who had worked on similar problem statements for JStyles for JabRef's OO/LO integration, for his help in guiding and making this PR possible.

Follow-up: #11636, #11712

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@subhramit subhramit dismissed stale reviews from Siedlerchr and koppor via 97a5546 August 12, 2024 19:57
@subhramit subhramit added this pull request to the merge queue Aug 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 12, 2024
Siedlerchr
Siedlerchr previously approved these changes Aug 12, 2024
@Siedlerchr Siedlerchr merged commit 8bf6f05 into JabRef:main Aug 12, 2024
22 of 26 checks passed
@Siedlerchr Siedlerchr deleted the make-bibliography branch August 12, 2024 20:29
@koppor
Copy link
Member

koppor commented Aug 12, 2024

Next time, please do look into the small red crosses on GitHub!

image

Fixed by @Siedlerchr #11616 (needed to hurry up, because our tests on main branch were red after the merge)

@subhramit
Copy link
Collaborator Author

subhramit commented Aug 12, 2024

Next time, please do look into the small red crosses on GitHub!

image

Fixed by @Siedlerchr #11616 (needed to hurry up, because our tests on main branch were red after the merge)

For some reason:

  1. Initially, for the last 30 commits at least, only fetcher tests were failing
  2. First time the merge failed, only fetcher and checkstyle were red.
  3. Second time the merge failed, only fetcher test was red (even though architecture and checkstyle error still existed).
  4. At no point previously the unit tests were red. Only fetcher and JDK deployment tests started failing the last time.
  5. Finally unit tests panicked after merge.

@subhramit
Copy link
Collaborator Author

Look at this:
image
(from cc36acc or any commit above).

@subhramit
Copy link
Collaborator Author

subhramit commented Aug 12, 2024

Look at this:
image
(from cc36acc or any commit above).

Delayed panic of tests fixed in #11615

@koppor
Copy link
Member

koppor commented Aug 13, 2024

  1. At no point previously the unit tests were red. Only fetcher and JDK deployment tests started failing the last time.

My screenshot is from this PR and shows the red cross.

It was the last merge queue attempt.

Fortunately, triggered by this, we fixed our CI and itwill.be more easy to see the errors. 🎉

  1. Finally unit tests panicked after merge.

The PR was merged without using the merge queue. Thus, the (failing) tests by the merge queue were skipped.

@koppor
Copy link
Member

koppor commented Aug 13, 2024

Now, we all learned about the difference of "pull_request" and "pull_request_target" the long way 😅

@subhramit
Copy link
Collaborator Author

Major follow-up PR (apart from PR-D): #11712
[Adds number re-distribution for citations].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants