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

New features #10

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
45225b8
Working feature to upload BibTex.
cuihantao Jan 4, 2025
22e6ac2
Group BibTex menu in the UI.
cuihantao Jan 4, 2025
c394355
Restrict file types to avoid accidental mistakes. Upload Data accepts…
cuihantao Jan 4, 2025
f989a10
Fix a bug where author names go to highlight. Extend the schema to st…
cuihantao Jan 4, 2025
949fa71
Fix width of preview to remove horizontal scroll bar.
cuihantao Jan 4, 2025
e33cdbf
Add the option in `meta` to choose from A4 and letter. Add indicator …
cuihantao Jan 4, 2025
5fc3609
Store colorPrimary and theme to schema.
cuihantao Jan 4, 2025
27390f2
Editor supports picking theme. Added new theme `cuiv`
cuihantao Jan 4, 2025
4530df0
Update to new theme.
cuihantao Jan 4, 2025
79359db
Refactor the sidebar; fetch remote schema and use local as fall back.
cuihantao Jan 4, 2025
7ca9456
Clean up console logs.
cuihantao Jan 4, 2025
f261c6d
Fix publication section to work with the current schema.
cuihantao Jan 4, 2025
94985e2
Make string date formatter recognize "now" and "present".
cuihantao Jan 4, 2025
54e1658
Fix publication year to display the year only.
cuihantao Jan 4, 2025
496bb07
Fix author names in publication list.
cuihantao Jan 4, 2025
e7ca661
Fix author list and format publication venue.
cuihantao Jan 4, 2025
b6d6886
Format citations for publications from JSON and uploaded bib.
cuihantao Jan 5, 2025
ff8e689
Bib loading working again, but IEEE template not taking effect.
cuihantao Jan 5, 2025
c2669b2
WIP using IEEE CSL.
cuihantao Jan 5, 2025
8c9ae45
Enhance publication schema and BibTeX processing: Updated JSON schema…
cuihantao Jan 5, 2025
16215e5
Enhance BibTeX processing: Added fallback for release date to use pub…
cuihantao Jan 5, 2025
0cf2991
Add back pageSize and theme in meta.
cuihantao Jan 5, 2025
0a52e9d
Add dark mode for cuiv theme.
cuihantao Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enhance BibTeX processing: Added fallback for release date to use pub…
…lication year if not available, and implemented sorting of publications by release date (newest first) in the CV data. Improved debug logging for better visibility of publication updates.
cuihantao committed Jan 5, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 16215e55bb7a9db2bca52998599ed7a46b4c97ba
10 changes: 9 additions & 1 deletion src/lib/bibtex.js
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ export function processBibTeX(bibtexStr, cvData, shouldReplace = false) {
const pub = {
name: entry.title,
publisher: entry['container-title'] || entry.journal || '',
releaseDate: entry.issued?.['date-parts']?.[0]?.[0]?.toString() || '',
releaseDate: entry.issued?.['date-parts']?.[0]?.[0]?.toString() || entry.year?.toString() || '',
url: entry.DOI ? `https://doi.org/${entry.DOI}` : entry.URL || '',
type: pubType,
formattedHTML: `<div class="citation">${processedHTML}</div>`,
@@ -112,12 +112,20 @@ export function processBibTeX(bibtexStr, cvData, shouldReplace = false) {
newCvData.publications = [...(cvData.publications || []), ...publications]
}

// Sort all publications by release date (newest first)
newCvData.publications.sort((a, b) => {
const dateA = a.releaseDate ? new Date(a.releaseDate) : new Date(0);
const dateB = b.releaseDate ? new Date(b.releaseDate) : new Date(0);
return dateB - dateA;
});

console.log('[Debug] CV publications after update:', {
mode: shouldReplace ? 'replace' : 'merge',
total: newCvData.publications.length,
fromBibtex: publications.length,
})
console.log(newCvData)

return newCvData
} catch (error) {
console.error('[Error] Failed to process BibTeX:', error)