Skip to content

Commit

Permalink
fix TODO: auto-ellipsis long author lists in /cv
Browse files Browse the repository at this point in the history
add pymatgen to /cv OSS list
fix outdated author list on MBD
  • Loading branch information
janosh committed Oct 8, 2023
1 parent 7e21d89 commit 8ec3fbf
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
53 changes: 49 additions & 4 deletions src/routes/cv/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,46 @@
[`janosh`, `https://stackoverflow.com/u/4034025`, `mdi:stackoverflow`],
// [`janosh-riebesell`, `https://linkedin.com/in/janosh-riebesell`, `bi:linkedin`],
]
function truncate_authors(
author_str: string,
target_name: string,
max_authors: number = 3
): string {
const authors = author_str.split(`, `)
const target_idx = authors.indexOf(target_name)
if (authors.length <= max_authors) return author_str
let truncated_authors = [authors[0], authors[target_idx], authors[authors.length - 1]]
// Remove duplicates
truncated_authors = [...new Set(truncated_authors)]
// Fill remaining spots
let i = 1 // Start from the second author
while (truncated_authors.length < max_authors && i < authors.length - 1) {
if (!truncated_authors.includes(authors[i])) {
truncated_authors.splice(i, 0, authors[i])
}
i++
}
truncated_authors = truncated_authors.slice(0, max_authors)
// Add ellipsis
let truncated_str = truncated_authors[0]
for (let j = 1; j < truncated_authors.length; j++) {
if (
authors.indexOf(truncated_authors[j]) -
authors.indexOf(truncated_authors[j - 1]) >
1
) {
truncated_str += `, ...`
}
truncated_str += `, ${truncated_authors[j]}`
}
return truncated_str
}
</script>

<section class="title">
Expand Down Expand Up @@ -54,15 +94,17 @@
</ul>

<h2>
<Icon inline icon="iconoir:journal" />&nbsp; Recent Publications
<Icon inline icon="iconoir:journal" />&nbsp; Selected Publications
</h2>
<ul>
{#each cv.publications as { title, authors, journal, date, url: href, arxiv }}
{@const year = new Date(date).getFullYear()}
<li>
<h4>{title}</h4>
<p>
{authors} - <small><a href={arxiv} {...links}>{journal}</a></small> -
{truncate_authors(authors, `Janosh Riebesell`)} -
<small><a href={arxiv} {...links}>{journal}</a></small>
-
<small
>{year}
{#if href}
Expand All @@ -80,10 +122,13 @@
</h2>
<ul>
{#each cv.projects as { url, img_style, github, name, description, stars, logo }}
{@const logo_url = logo ?? `${url}/favicon.svg`}
<li>
<h4>
<img src={logo ?? `${url}/favicon.svg`} alt="{name} Logo" style={img_style} />
<a href={url ?? github} {...links}>{name}</a>
<a href={url ?? github} {...links}>
<img src={logo_url} alt="{name} Logo" style={img_style} />
{name}
</a>
<a href={github} {...links}>
<Icon inline icon="octicon:mark-github" />
</a>
Expand Down
12 changes: 8 additions & 4 deletions src/routes/cv/cv-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ education:
publications:
- name: Matbench Discovery
title: Matbench Discovery - Can machine learning identify stable crystals?
authors: Janosh Riebesell, Rhys Goodall, Anubhav Jain, Kristin Persson, Alpha Lee
authors: Janosh Riebesell, Rhys Goodall, Philipp Benner, Yuan Chiang, Alpha Lee, Anubhav Jain, Kristin Persson
date: 10 Feb 2023
journal: ICLR ML4Materials/arXiv
url: https://matbench-discovery.materialsproject.org
Expand All @@ -39,9 +39,7 @@ publications:
- name: Crystal Toolkit
title: Crystal Toolkit - A Web App Framework to Improve Usability and Accessibility of Materials Science Research Algorithms
arxiv: https://arxiv.org/abs/2302.06147
# TODO auto-ellipsis long author lists
# authors: Matthew Horton, Jimmy-Xuan Shen, Jordan Burns, Orion Cohen, François Chabbey, Alex M. Ganose, Rishabh Guha, Patrick Huck, Hamming Howard Li, Matthew McDermott, Joseph Montoya, Guy Moore, Jason Munro, Cody O'Donnell, Colin Ophus, Guido Petretto, Janosh Riebesell, Steven Wetizner, Brook Wander, Donald Winston, Ruoxi Yang, Steven Zeltmann, Anubhav Jain, Kristin A. Persson
authors: Matthew Horton, ..., Janosh Riebesell, ..., Anubhav Jain, Kristin A. Persson
authors: Matthew Horton, Jimmy-Xuan Shen, Jordan Burns, Orion Cohen, François Chabbey, Alex M. Ganose, Rishabh Guha, Patrick Huck, Hamming Howard Li, Matthew McDermott, Joseph Montoya, Guy Moore, Jason Munro, Cody O'Donnell, Colin Ophus, Guido Petretto, Janosh Riebesell, Steven Wetizner, Brook Wander, Donald Winston, Ruoxi Yang, Steven Zeltmann, Anubhav Jain, Kristin A. Persson
date: 13 Feb 2023
journal: arxiv
# - name: Functional Renormalization Analytically Continued
Expand All @@ -52,6 +50,12 @@ publications:
# journal: arxiv

projects:
- name: ''
url: https://pymatgen.org
logo: https://raw.githubusercontent.com/materialsproject/pymatgen/master/docs/assets/pymatgen.svg
img_style: 'min-width: 90px;'
github: https://github.com/materialsproject/pymatgen
description: One of the largest and most popular open source materials analysis codes that defines classes for structures, molecules, slabs, etc. and interfaces seamlessly with various other materials codes. It also powers the Materials Project.
- name: Matbench Discovery
url: https://matbench-discovery.materialsproject.org
img_style: 'filter: invert(1);'
Expand Down

0 comments on commit 8ec3fbf

Please sign in to comment.