Skip to content

Conversation

@koppor
Copy link
Collaborator

@koppor koppor commented May 30, 2025

This ports (the beginning of) JabRef#13185 to here.

This adds an inital cite-as-you-write endpoint.

Usage:

  1. Start JabSrv: ./gradlew :jabsrv-cli:run
  2. curl http://localhost:6050/better-bibtex/cayw
  3. See a poup with references. Click some.
  4. Click "Finish search"
  5. See JSON result
 [
  "Garcia_2018",
  "Di_Renzo_2012",
  "Tokede_2011"
]

If you dont have any JDK installed, you can do following:

  1. Download gg.cmd - https://github.com/eirikb/gg/releases/latest/download/gg.cmd
  2. Place gg.cmd in the jabref repository
  3. Windows: Execute .\gg.cmd gradle :jabsrv-cli:run
  4. macOS: Execute sh ./gg.cmd gradle :jabsrv-cli:run

You can use this endpoint for the search functionality of JabMap.

You need to add new resources to org.jabref.http.server.LibraryResource to interact with a single BibTeX entry (e.g., getting the preview). - Alternatively, you can do a GET with Accept: application/x-bibtex-library-csl+json on .../demo to geth CSL data objects, which you can feed to citeprojc-js - which is probably much more effort.


private ObservableList<CAYWEntry<T>> selectedEntries = javafx.collections.FXCollections.observableArrayList();

private final static int MAX_LINES = 3;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck> reported by reviewdog 🐶
Static variable definition in wrong order.

private ObservableList<CAYWEntry<T>> selectedEntries = javafx.collections.FXCollections.observableArrayList();

private final static int MAX_LINES = 3;
private final static int ESTIMATED_CHARS_PER_LINE = 80;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck> reported by reviewdog 🐶
Static variable definition in wrong order.


private final static int MAX_LINES = 3;
private final static int ESTIMATED_CHARS_PER_LINE = 80;
private final static int TOOLTIP_WIDTH = 400;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck> reported by reviewdog 🐶
Static variable definition in wrong order.

@@ -0,0 +1,44 @@
.search-dialog {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck> reported by reviewdog 🐶
File does not end with a newline.

@koppor koppor changed the title Add cyaw Add cayw Jun 9, 2025
@koppor
Copy link
Collaborator Author

koppor commented Jun 9, 2025

Team decision: Even if tests fail, we merge this in to provide an initial endpoint for cite-as-you-write - to unblock JabMap UI development.

@koppor koppor merged commit 3404185 into jabmap Jun 9, 2025
33 of 44 checks passed
@koppor koppor deleted the add-cyaw branch June 9, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants