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

Add the option to select a BST style for Preview #11102

Closed
Siedlerchr opened this issue Mar 25, 2024 · 12 comments · Fixed by #11234
Closed

Add the option to select a BST style for Preview #11102

Siedlerchr opened this issue Mar 25, 2024 · 12 comments · Fixed by #11234
Assignees
Labels
entry-preview FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement

Comments

@Siedlerchr
Copy link
Member

Siedlerchr commented Mar 25, 2024

JabRef offers preview based on so called BST styles. However, currently there is no option to select them in the UI.

Things needed.

  • Add the BST styles to the preview layout list
  • Add an option to configure/add styles. Add a single style or configure a directory to load them from
  • Test if they can be selected and rendered

Additional context
Bst files can be found in https://www.ctan.org/topic/bibtex-sty

Codewise:
PreviewTabViewModel#setValues needs to check for BstPreviewLayout

@Siedlerchr Siedlerchr added type: enhancement good first issue An issue intended for project-newcomers. Varies in difficulty. labels Mar 25, 2024
@koppor
Copy link
Member

koppor commented Mar 25, 2024

After this is implemented, a next step is following:

In case a LaTeX directory is set, check that directory for .bst file. If exists: use. If not exists: check for \bibliographystyle and then use kpeswitch to find the path. Maybe, one even needs to check the \documentclass.

(This can be hard but very user-friendly)

@sahilsekr42
Copy link
Contributor

Shall I modify the setValues() method in the PreviewTabViewModel.java file to fetch and add BST styles from https://www.ctan.org/topic/bibtex-sty to the availableListProperty also what files need to be changed or dependencies need to be used . Is an arraylist of bststyles needed which will then be used to create previewlayout for availableListProperty . How do i develop a better understanding for the given issue

@Siedlerchr
Copy link
Member Author

  1. Add a button to the UI so that the user can select BST files on their computer
  2. Add the selected bst files to the available styles
  3. Adjust the check in the setValues for BstPreviewLayout
  4. Test

Copy link
Contributor

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@koppor
Copy link
Member

koppor commented Mar 26, 2024

Code hint: https://github.com/JabRef/jabref/blob/main/src/test/java/org/jabref/logic/bst/BstVMTest.java shows the usage of JabRefs functionality to transform a BibEntrty to text using a bst file

@sahilsekr42
Copy link
Contributor

I've tried to create the button and also checked the rendering in preview. Also I'm planning to implement the feature to configure bst styles from directory . please check if this is the way implementation needs to be done else provide feedback on changes to be made

bstpre.mp4

@sahilsekr42
Copy link
Contributor

@Siedlerchr @koppor please give feedback

@Siedlerchr
Copy link
Member Author

Siedlerchr commented Mar 30, 2024 via email

@koppor
Copy link
Member

koppor commented Mar 30, 2024

@Siedlerchr @koppor please give feedback

We see the selection possibility of .bst files. What is missing

  1. Usage of .bst in the preview in the entry editor
  2. Mixing .bst and CSL preview styles

Regarding 2., maybe two tabs "CSL" and "BST" would make sense. When "CSL" is selected, the list as currently existing is used, when "BST" is selected, the known .bst files (as the video shows) are used. The right list is a mix of .csl and .bst

@subhramit
Copy link
Collaborator

@sahilsekr42 hey, how's it going? Do you plan to put up a PR (for however-much has been done)?
It'll be really helpful for other people if they want to take it from there (if you are busy). Otherwise, people will review it and help you finish it.

@sahilsekr42
Copy link
Contributor

I will raise a pr by tomorrow for review ( sorry for the delay)

@sahilsekr42
Copy link
Contributor

please look into #11229. Also test checks for one of the commits in one of the files is failing and i don't know why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entry-preview FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement
Projects
Archived in project
Archived in project
4 participants