Skip to content

Commit

Permalink
Merge branch 'dev' into improve-book
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjabbour authored Aug 15, 2024
2 parents 5521fae + 5503583 commit 212d244
Show file tree
Hide file tree
Showing 230 changed files with 4,094 additions and 1,160 deletions.
248 changes: 131 additions & 117 deletions .all-contributorsrc

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions .github/workflows/contributors/update_contributors.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import hashlib
import json
import os
import json
import random
import hashlib

import pandas as pd
import requests
import pandas as pd
from absl import app
from absl import logging

Expand Down Expand Up @@ -87,6 +87,7 @@ def main(_):
next_page = res.links.get("next", {}).get("url", None)
last_page = res.links.get("last", {}).get("url", None)

usernames = set()
commit_data = []
for node in data:
commit_message = node.get("commit", {}).get("message", pd.NA)
Expand All @@ -111,6 +112,14 @@ def main(_):
elif committer_login_info:
username = committer_login_info["login"]

try:
if username:
usernames.add(username)
except Exception as e:
logging.error(f"Error parsing username: {username}")



commit_data.append(
{
"commit_message": commit_message,
Expand All @@ -119,6 +128,12 @@ def main(_):
}
)
commit_data_df = pd.DataFrame(commit_data)

username_to_fullname = {}
for username in usernames:
user_data = get_user_data_from_username(username)
username_to_fullname[username] = user_data['user_full_name']

co_authors_list = [get_co_authors_from_commit_message(row["commit_message"])
for index, row in commit_data_df.iterrows()]
co_authors_df = pd.concat(co_authors_list, ignore_index=True)
Expand Down Expand Up @@ -194,6 +209,11 @@ def main(_):
lambda row: row['username'] if '@' in row['user_full_name'] else row[
'user_full_name'],
axis=1)

commit_data_df['user_full_name'] = commit_data_df.apply(
lambda row: username_to_fullname[row['username']] if row['username'] in username_to_fullname else row['user_full_name'], axis=1
)


def generate_gravatar_url(name):
random.seed(name)
Expand Down
147 changes: 87 additions & 60 deletions README.md

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions _extensions/nmfs-opensci/titlepage/_author-affiliation-themes.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
$if(false)$
% This sectrion defines the author block and affiliation blocks
% based on the author and affiliation theme
$endif$
\newcommand{\authorstyle}[1]{{$if(titlepage-theme.author-fontsize)$\fontsize{$titlepage-theme.author-fontsize$}{$titlepage-theme.author-spacing$}\selectfont
$endif$$for(titlepage-theme.author-fontstyle)$\$titlepage-theme.author-fontstyle${$endfor$#1$for(titlepage-theme.author-fontstyle)$}$endfor$}}
\newcommand{\affiliationstyle}[1]{{$if(titlepage-theme.affiliation-fontsize)$\fontsize{$titlepage-theme.affiliation-fontsize$}{$titlepage-theme.affiliation-spacing$}\selectfont
$endif$$for(titlepage-theme.affiliation-fontstyle)$\$titlepage-theme.affiliation-fontstyle${$endfor$#1$for(titlepage-theme.affiliation-fontstyle)$}$endfor$}}
$if(titlepage-style-code.author.none)$
\newcommand{\titlepageauthorblock}{}
$endif$
$if(titlepage-style-code.author.plain)$
\newcommand{\titlepageauthorblock}{
$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$for(by-author)$\nohyphens{$by-author.name.literal$}$sep$$titlepage-theme.author-sep$$if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$\\}}
}
$endif$
$if(titlepage-style-code.author.plain-with-and)$
\newcommand{\titlepageauthorblock}{
$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$if(by-author/allbutlast)$$for(by-author/allbutlast)$\nohyphens{$by-author.name.literal$}$sep$$titlepage-theme.author-sep$ $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$$for(by-author/last)$ and \nohyphens{$by-author.name.literal$}$endfor$$else$$for(by-author/last)$\nohyphens{$by-author.name.literal$}$if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$$endif$}}
}
$endif$
$if(titlepage-style-code.author.superscript)$
\newcommand{\titlepageauthorblock}{
$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$for(by-author)$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep${\textsuperscript{,}}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$sep$$titlepage-theme.author-sep$ $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$}}
}
$endif$
$if(titlepage-style-code.author.superscript-with-and)$
\newcommand{\titlepageauthorblock}{
$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$if(by-author/allbutlast)$$for(by-author/allbutlast)$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$sep$$titlepage-theme.author-sep$ $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$$endfor$$for(by-author/last)$ and $if(titlepage-theme.author-space-between)$~\\ \vspace{$titlepage-theme.author-space-between$}$endif$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{*}}$endif$$endfor$$else$$for(by-author/last)$\nohyphens{$by-author.name.literal$}$for(by-author.affiliations)${\textsuperscript{$it.number$}}$sep$\textsuperscript{,}$endfor$$if(by-author.email)$$if(by-author.affiliations)$\textsuperscript{,}$endif${\textsuperscript{,*}}$endif$$endfor$$endif$}}}
$endif$
$if(titlepage-style-code.author.author-address)$
\newcommand{\titlepageauthorblock}{
$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{
$for(by-author)$$by-author.name.literal$$if(by-author.affiliations)$$titlepage-theme.affiliation-sep$$for(by-author.affiliations)$$by-author.affiliations.name$$if(by-author.affiliations.department)$$titlepage-theme.affiliation-sep$$by-author.affiliations.department$$endif$$if(by-author.affiliations.address)$$titlepage-theme.affiliation-sep$$for(by-author.affiliations.address)$$by-author.affiliations.address$$sep$$titlepage-theme.affiliation-sep$$endfor$$endif$$sep$$titlepage-theme.affiliation-sep$$endfor$$endif$$if(by-author.email)$$titlepage-theme.affiliation-sep$$by-author.email$$endif$$sep$\\
$if(titlepage-theme.author-space-between)$\vspace{$titlepage-theme.author-space-between$}$endif$$endfor$}}}
$endif$
$if(titlepage-style-code.author.two-column)$
\newcommand{\titlepageauthorblock}{
\newlength{\miniA}
\setlength{\miniA}{0pt}
\newlength{\namelen}
$for(by-author)$\settowidth{\namelen}{$by-author.name.literal$}\setlength{\miniA}{\maxof{\miniA}{\namelen}}$endfor$
\setlength{\miniA}{\miniA+0.05\textwidth}
\newlength{\miniB}
\setlength{\miniB}{0.99\textwidth - \miniA}
\begin{minipage}{\miniA}
\begin{flushleft}
$if(titlepage-theme.author-color)$\textcolor{$titlepage-theme.author-color$}$endif${\authorstyle{$for(by-author)$$by-author.name.literal$$sep$\\ $if(titlepage-theme.author-space-between)$
\vspace{$titlepage-theme.author-space-between$}$endif$$endfor$}}
\end{flushleft}
\end{minipage}
\begin{minipage}{\miniB}
\begin{flushright}
$if(titlepage-theme.affiliation-color)$\textcolor{$titlepage-theme.affiliation-color$}$endif${\affiliationstyle{$for(by-author)$$for(by-author.affiliations/first)$$by-author.affiliations.name$
$endfor$$sep$\\
$if(titlepage-theme.affiliation-space-between)$\vspace{$titlepage-theme.affiliation-space-between$}
$endif$$endfor$\\}}
\end{flushright}
\end{minipage}}
$endif$
$if(titlepage-style-code.affiliation.none)$
\newcommand{\titlepageaffiliationblock}{}
$endif$
$if(titlepage-style-code.affiliation.numbered-list)$
\newcommand{\titlepageaffiliationblock}{
\hangindent=1em
\hangafter=1
\affiliationstyle{$for(by-affiliation)${$it.number$}.~$if(by-affiliation.name)$$it.name$$endif$$if(by-affiliation.department)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$endif$$it.department$$endif$$if(by-affiliation.address)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$else$$if(by-affiliation.department)$$titlepage-theme.affiliation-sep$$endif$$endif$$it.address$$endif$%
$sep$\par\hangindent=1em\hangafter=1$if(titlepage-theme.affiliation-space-between)$
\vspace{$titlepage-theme.affiliation-space-between$}$endif$
$endfor$
}}
$endif$
$if(titlepage-style-code.affiliation.numbered-list-with-correspondence)$
\newcommand{\titlepageaffiliationblock}{
\hangindent=1em
\hangafter=1
{\affiliationstyle{
$for(by-affiliation)${$it.number$}.~$if(by-affiliation.name)$$it.name$$endif$$if(by-affiliation.department)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$endif$$it.department$$endif$$if(by-affiliation.address)$$if(by-affiliation.name)$$titlepage-theme.affiliation-sep$$else$$if(by-affiliation.department)$$titlepage-theme.affiliation-sep$$endif$$endif$$it.address$$endif$
$sep$\par\hangindent=1em\hangafter=1$if(titlepage-theme.affiliation-space-between)$
\vspace{$titlepage-theme.affiliation-space-between$}$endif$
$endfor$
\vspace{1\baselineskip}
$if(author)$
$for(by-author)$
$if(by-author.email)$
* \textit{Correspondence:}~$by-author.name.literal$~$by-author.email$
$endif$$endfor$$endif$
}}
}
$endif$
121 changes: 121 additions & 0 deletions _extensions/nmfs-opensci/titlepage/_coverpage.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
% This is a combination of Pandoc templating and LaTeX
% Pandoc templating https://pandoc.org/MANUAL.html#templates
% See the README for help

\thispagestyle{empty}

$if(coverpage-geometry)$
\newgeometry{$for(coverpage-geometry)$$coverpage-geometry$$sep$,$endfor$}
$else$
\newgeometry{top=-100in}
$endif$

% Page color
$if(coverpage-theme.page-html-color)$
\definecolor{pgcolor}{HTML}{$coverpage-theme.page-html-color$}
\pagecolor{pgcolor}\afterpage{\nopagecolor}
$endif$

\newcommand{\coverauthorstyle}[1]{{$if(coverpage-theme.author-fontsize)$\fontsize{$coverpage-theme.author-fontsize$}{$coverpage-theme.author-spacing$}\selectfont
$endif$$for(coverpage-theme.author-fontstyle)$\$coverpage-theme.author-fontstyle${$endfor$#1$for(coverpage-theme.author-fontstyle)$}$endfor$}}
\begin{tikzpicture}[remember picture, overlay, inner sep=0pt, outer sep=0pt]
$if(coverpage-bg-image)$
\tikzfading[name=fadeout, inner color=transparent!0,outer color=transparent!100]
\tikzfading[name=fadein, inner color=transparent!100,outer color=transparent!0]
\node[$if(coverpage-theme.bg-image-fading)$ scope fading=$coverpage-theme.bg-image-fading$, $endif$anchor=south west$if(coverpage-theme.bg-image-rotate)$, rotate=$coverpage-theme.bg-image-rotate$$endif$$if(coverpage-theme.bg-image-opacity)$, opacity=$coverpage-theme.bg-image-opacity$$endif$] at ($$(current page.south west)+($if(coverpage-theme.bg-image-left)$$coverpage-theme.bg-image-left$$else$0cm$endif$, $if(coverpage-theme.bg-image-bottom)$$coverpage-theme.bg-image-bottom$$else$0cm$endif$)$$) {
\includegraphics[width=$coverpage-theme.bg-image-size$, keepaspectratio]{$coverpage-bg-image$}};
$endif$
$if(coverpage-style-code.title.plain)$
$if(coverpage-title)$
% Title
\newcommand{\titlelocationleft}{$coverpage-theme.title-left$}
\newcommand{\titlelocationbottom}{$coverpage-theme.title-bottom$}
\newcommand{\titlealign}{$coverpage-theme.title-align$}
\begin{scope}{%
$if(coverpage-theme.title-fontsize)$\fontsize{$coverpage-theme.title-fontsize$}{$coverpage-theme.title-spacing$}\selectfont
$endif$$if(coverpage-theme.title-fontfamily)$\coverpagetitlefont
$endif$\node[anchor=$coverpage-theme.title-anchor$, align=$coverpage-theme.title-align$, rotate=$coverpage-theme.title-rotate$] (Title1) at ($$(current page.south west)+(\titlelocationleft,\titlelocationbottom)$$) [text width = $coverpage-theme.title-width$$if(coverpage-theme.title-node-spec)$, $coverpage-theme.title-node-spec$$endif$] {$if(coverpage-theme.title-color)$\textcolor{$coverpage-theme.title-color$}$endif${$for(coverpage-theme.title-fontstyle)$\$coverpage-theme.title-fontstyle${$endfor$\nohyphens{$coverpage-title$}$for(coverpage-theme.title-fontstyle)$}$endfor$}};
}
\end{scope}
$endif$
$endif$
$if(coverpage-style-code.author.plain)$
$if(coverpage-author)$
% Author
\newcommand{\authorlocationleft}{$coverpage-theme.author-left$}
\newcommand{\authorlocationbottom}{$coverpage-theme.author-bottom$}
\newcommand{\authoralign}{$coverpage-theme.author-align$}
\begin{scope}
{%
$if(coverpage-theme.author-fontsize)$\fontsize{$coverpage-theme.author-fontsize$}{$coverpage-theme.author-spacing$}\selectfont
$endif$$if(coverpage-theme.author-fontfamily)$\coverpageauthorfont
$endif$\node[anchor=$coverpage-theme.author-anchor$, align=$coverpage-theme.author-align$, rotate=$coverpage-theme.author-rotate$] (Author1) at ($$(current page.south west)+(\authorlocationleft,\authorlocationbottom)$$) [text width = $coverpage-theme.author-width$$if(coverpage-theme.author-node-spec)$, $coverpage-theme.author-node-spec$$endif$] {
$if(coverpage-theme.author-color)$\textcolor{$coverpage-theme.author-color$}$endif$\coverauthorstyle{$for(coverpage-author)$$coverpage-author$$sep$$coverpage-theme.author-sep$$endfor$\\}};
}
\end{scope}
$endif$
$endif$
$if(coverpage-style-code.header.plain)$
$if(coverpage-header)$
% Header
\newcommand{\headerlocationleft}{$coverpage-theme.header-left$}
\newcommand{\headerlocationbottom}{$coverpage-theme.header-bottom$}
\newcommand{\headerlocationalign}{$coverpage-theme.header-align$}
\begin{scope}
{%
$if(coverpage-theme.header-fontsize)$\fontsize{$coverpage-theme.header-fontsize$}{$coverpage-theme.header-spacing$}\selectfont
$endif$ $if(coverpage-theme.header-fontfamily)$\coverpageheaderfont
$endif$\node[anchor=$coverpage-theme.header-anchor$, align=$coverpage-theme.header-align$, rotate=$coverpage-theme.header-rotate$] (Header1) at %
($$(current page.south west)+(\headerlocationleft,\headerlocationbottom)$$) [text width = $coverpage-theme.header-width$$if(coverpage-theme.header-node-spec)$, $coverpage-theme.header-node-spec$$endif$] {$if(coverpage-theme.header-color)$\textcolor{$coverpage-theme.header-color$}$endif${$for(coverpage-theme.header-fontstyle)$\$coverpage-theme.header-fontstyle${$endfor$\nohyphens{$coverpage-header$}$for(coverpage-theme.header-fontstyle)$}$endfor$}};
}
\end{scope}
$endif$
$endif$
$if(coverpage-style-code.footer.plain)$
$if(coverpage-footer)$
% Footer
\newcommand{\footerlocationleft}{$coverpage-theme.footer-left$}
\newcommand{\footerlocationbottom}{$coverpage-theme.footer-bottom$}
\newcommand{\footerlocationalign}{$coverpage-theme.footer-align$}
\begin{scope}
{%
$if(coverpage-theme.footer-fontsize)$\fontsize{$coverpage-theme.footer-fontsize$}{$coverpage-theme.footer-spacing$}\selectfont
$endif$ $if(coverpage-theme.footer-fontfamily)$\coverpagefooterfont
$endif$\node[anchor=$coverpage-theme.footer-anchor$, align=$coverpage-theme.footer-align$, rotate=$coverpage-theme.footer-rotate$] (Footer1) at %
($$(current page.south west)+(\footerlocationleft,\footerlocationbottom)$$) [text width = $coverpage-theme.footer-width$$if(coverpage-theme.footer-node-spec)$, $coverpage-theme.footer-node-spec$$endif$] {$if(coverpage-theme.footer-color)$\textcolor{$coverpage-theme.footer-color$}$endif${$for(coverpage-theme.footer-fontstyle)$\$coverpage-theme.footer-fontstyle${$endfor$\nohyphens{$coverpage-footer$}$for(coverpage-theme.footer-fontstyle)$}$endfor$}};
}
\end{scope}
$endif$
$endif$
$if(coverpage-style-code.date.plain)$
$if(coverpage-date)$
% Date
\newcommand{\datelocationleft}{$coverpage-theme.date-left$}
\newcommand{\datelocationbottom}{$coverpage-theme.date-bottom$}
\newcommand{\datelocationalign}{$coverpage-theme.date-align$}
\begin{scope}
{%
$if(coverpage-theme.date-fontsize)$\fontsize{$coverpage-theme.date-fontsize$}{$coverpage-theme.date-spacing$}\selectfont
$endif$ $if(coverpage-theme.date-fontfamily)$\coverpagedatefont
$endif$\node[anchor=$coverpage-theme.date-anchor$, align=$coverpage-theme.date-align$, rotate=$coverpage-theme.date-rotate$] (Date1) at %
($$(current page.south west)+(\datelocationleft,\datelocationbottom)$$) [text width = $coverpage-theme.date-width$$if(coverpage-theme.date-node-spec)$, $coverpage-theme.date-node-spec$$endif$] {$if(coverpage-theme.date-color)$\textcolor{$coverpage-theme.date-color$}$endif${$for(coverpage-theme.date-fontstyle)$\$coverpage-theme.date-fontstyle${$endfor$\nohyphens{$coverpage-date$}$for(coverpage-theme.date-fontstyle)$}$endfor$}};
}
\end{scope}
$endif$
$endif$
\end{tikzpicture}
\clearpage
\restoregeometry
20 changes: 20 additions & 0 deletions _extensions/nmfs-opensci/titlepage/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
title: titlepage
author: Eli Holmes
quarto-required: ">=1.1.0"
version: 3.3.10
contributes:
format:
pdf:
filters:
- titlepage-theme.lua
- coverpage-theme.lua
template-partials:
- "_coverpage.tex"
- "_author-affiliation-themes.tex"
- "_header-footer-date-themes.tex"
- "_title-themes.tex"
- "_titlepage.tex"
- "before-body.tex"
- "pandoc.tex"
format-resources:
- "fonts/qualitype/opentype/QTDublinIrish.otf"
Loading

0 comments on commit 212d244

Please sign in to comment.