Added a custom Export for academicpages.github.io
Closes #12727
This PR is to add a custom exporter for academicpages.github.io by adding the corresponding layouts. It also implements a way to export multiple files to this format.
Steps to test
When jabref is running, go to file->Export->Export selected entries ( or all entries) and choose "Academic Pages Markdowns" for the export type.
You can then add the markdown file(s) to your academic page to see it on your own page.
More information about academic pages on the page : https://academicpages.github.io/
Mandatory checks
- [x] I own the copyright of the code submitted and I license it under the MIT license
- [x] I manually tested my changes in running JabRef (always required)
- [x] I added JUnit tests for changes (if applicable)
- [x] I added screenshots in the PR description (if change is visible to the user)
- [x] I described the change in
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user) - [x] I checked the user 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 updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.
Hey @GreLucie!
Thank you for contributing to JabRef! Your help is truly appreciated :heart:
We have automated checks in place, based on which you will soon get feedback if any of them are failing. In a while, maintainers will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs.
Please re-check our contribution guide in case of any other doubts related to our contribution workflow.
Hi, we just wanted to clarify the mechanism that we chose to implement for this new AcademicPagesExporter so that we can have your opinion on it and know whether or not it meets your expectations : This exporter actually creates a folder at first (even when there's only one entry selected) with the name typed by the user in the export dialog and then exports all the entries selected one by one inside this folder, giving them names that match exactly what is defined by the academicpages layout as their file names in the permalink field of the markdown (that way it facilitates instant integration in the personal academic pages repository). So is this logic fine with you or is there something we need to change especially about the creation of a folder... ?
Yep that sound reasonable. Go ahead
@sadok-lajmi Please merge upstream/main. You can do it with the button "Update branch" here on this page or using your GitHub CLI.
Please fix the failing tests°!
Hello everybody, since we are extremely busy with other projects during this period we would like to apologize for the time it's taking to make the rest of the modifications and we promise to start making more progress, specifically on the layout changes, starting from next week. Sorry again for the inconvenience...
The exporter should be "intelligent"
Currently, if no PDF exists, it exports
paperurl: 'https://[insert username].github.io/files/[insert filename].pdf'This is wrong - it has to omit paperurl if there is no PDF.
slidesurlhas to be omitted in all cases, because there is "no standard" in JabRef for this.
bibtexurlcan always be provided. -- Write the BibEntry to a file.Use following method:
https://github.com/JabRef/jabref/blob/058767a58148ff0acfbd2287bbd94ef23d747d67/jablib/src/main/java/org/jabref/model/entry/BibEntry.java#L738
For
InProceedings, thevenuehas to be read frombooktitle. That means: If journal (getFieldOrAlias) is empty, useBooktitleas venue. DO NOT useUnknownleave it empty.
categoryshould also be mapped:InProceedingsisconferences,Articleisjournals, all other can go intomanuscripts.
citationneeds to be generaed out of the entry previewRight part at
`paperurl` is a file **next to** the markdown file - just copy the first attached file next to it and link it.
--
insert usernameis not acceptable. Two options:
- Use
userfromorg.jabref.logic.preferences.JabRefCliPreferences#getUserHostInfo- make this method public- Make it configurable in the preferences (for the export for acamdemic pages)
- Ask at each export using a dialog
I think, the first option is best.
you can try out the export for yourself using https://github.com/JabRef/jabref-demonstration-libraries/blob/main/chocolate/Chocolate.bib - it has even attached files.
Hi, I didn't quite understand what we're supposed to do to make these fixes specifically :
- "writing BibEntry to a file" to provide a bibtexurl
- generating the citation based on the preview
- "
paperurlis a file next to the markdown file - just copy the first attached file next to it and link it." - the use of the user constant from preferences (based on the first fixes demanded there should be no case where we would have to write [insert username] anymore...) So could you please explain a little bit more ?.. Thank you
JUnit tests of jablib are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Source Code Tests / Unit tests (pull_request)" and click on it.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
`paperurl` is a file **next to** the markdown file - just copy the first attached file next to it and link it.