roboneuro 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/.env-example +12 -0
- data/.env.test +8 -0
- data/.github/workflows/docker-image.yml +63 -0
- data/.github/workflows/tests.yml +28 -0
- data/.gitignore +3 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +135 -0
- data/LICENSE +21 -0
- data/README.md +190 -0
- data/Rakefile +13 -0
- data/bin/whedon +131 -0
- data/fixtures/latex_paper/paper.tex +0 -0
- data/fixtures/paper/10.21105.jcon.00017.crossref.xml +88 -0
- data/fixtures/paper/crossref-metadata.yaml +34 -0
- data/fixtures/paper/paper-bib.md +27 -0
- data/fixtures/paper/paper-single-author.md +24 -0
- data/fixtures/paper/paper-with-harder-names.md +27 -0
- data/fixtures/paper/paper-with-missing-affiliations.md +21 -0
- data/fixtures/paper/paper.bib +65 -0
- data/fixtures/paper/paper.html +14 -0
- data/fixtures/paper/paper.md +27 -0
- data/fixtures/paper/paper.pdf +0 -0
- data/fixtures/paper/paper.xml +28 -0
- data/fixtures/paper/paper_with_missing_title.md +26 -0
- data/fixtures/review_body.txt +48 -0
- data/fixtures/test_paper/nested/paper.bib +0 -0
- data/fixtures/test_paper/nested/paper.md +0 -0
- data/fixtures/test_paper/paper.bib +0 -0
- data/fixtures/test_paper/paper.md +0 -0
- data/fixtures/vcr_cassettes/joss-lookup.yml +58 -0
- data/fixtures/vcr_cassettes/review.yml +237 -0
- data/fixtures/vcr_cassettes/reviews.yml +270 -0
- data/lib/whedon/auditor.rb +39 -0
- data/lib/whedon/author.rb +81 -0
- data/lib/whedon/bibtex_parser.rb +103 -0
- data/lib/whedon/compilers.rb +379 -0
- data/lib/whedon/github.rb +12 -0
- data/lib/whedon/orcid_validator.rb +83 -0
- data/lib/whedon/processor.rb +178 -0
- data/lib/whedon/review.rb +25 -0
- data/lib/whedon/reviews.rb +29 -0
- data/lib/whedon/version.rb +3 -0
- data/lib/whedon.rb +387 -0
- data/paperdraft.Dockerfile +48 -0
- data/pkg/roboneuro-0.1.0.gem +0 -0
- data/resources/.DS_Store +0 -0
- data/resources/NeuroLibre/.DS_Store +0 -0
- data/resources/NeuroLibre/aas-logo.png +0 -0
- data/resources/NeuroLibre/apa.csl +1919 -0
- data/resources/NeuroLibre/defaults.yaml +14 -0
- data/resources/NeuroLibre/latex.template +541 -0
- data/resources/NeuroLibre/logo.png +0 -0
- data/resources/NeuroLibre/logo_link.png +0 -0
- data/resources/apa.csl +1919 -0
- data/resources/crossref.template +89 -0
- data/resources/docker-defaults.yaml +42 -0
- data/resources/docker-entrypoint.sh +37 -0
- data/resources/jats.csl +204 -0
- data/resources/jats.template +105 -0
- data/resources/jose/apa.csl +1919 -0
- data/resources/jose/defaults.yaml +14 -0
- data/resources/jose/latex.template +486 -0
- data/resources/jose/logo.png +0 -0
- data/resources/joss/aas-logo.png +0 -0
- data/resources/joss/apa.csl +1919 -0
- data/resources/joss/defaults.yaml +14 -0
- data/resources/joss/latex.template +525 -0
- data/resources/joss/logo.png +0 -0
- data/resources/latex.template +485 -0
- data/resources/time.lua +8 -0
- data/roboneuro.gemspec +39 -0
- data/spec/auditor_spec.rb +22 -0
- data/spec/author_spec.rb +17 -0
- data/spec/bibtex_spec.rb +31 -0
- data/spec/orcid_validator_spec.rb +33 -0
- data/spec/processor_spec.rb +66 -0
- data/spec/review_spec.rb +12 -0
- data/spec/reviews_spec.rb +18 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/whedon_spec.rb +93 -0
- metadata +386 -0
@@ -0,0 +1,485 @@
|
|
1
|
+
\documentclass[10pt,a4paper,onecolumn]{article}
|
2
|
+
\usepackage{marginnote}
|
3
|
+
\usepackage{graphicx}
|
4
|
+
\usepackage{xcolor}
|
5
|
+
\usepackage{authblk,etoolbox}
|
6
|
+
\usepackage{titlesec}
|
7
|
+
\usepackage{calc}
|
8
|
+
\usepackage{tikz}
|
9
|
+
\usepackage{hyperref}
|
10
|
+
\hypersetup{colorlinks,breaklinks,
|
11
|
+
urlcolor=[rgb]{0.0, 0.5, 1.0},
|
12
|
+
linkcolor=[rgb]{0.0, 0.5, 1.0}}
|
13
|
+
\usepackage{caption}
|
14
|
+
\usepackage{tcolorbox}
|
15
|
+
\usepackage{amssymb,amsmath}
|
16
|
+
\usepackage{ifxetex,ifluatex}
|
17
|
+
\usepackage{seqsplit}
|
18
|
+
\usepackage{xstring}
|
19
|
+
|
20
|
+
\usepackage{float}
|
21
|
+
\let\origfigure\figure
|
22
|
+
\let\endorigfigure\endfigure
|
23
|
+
\renewenvironment{figure}[1][2] {
|
24
|
+
\expandafter\origfigure\expandafter[H]
|
25
|
+
} {
|
26
|
+
\endorigfigure
|
27
|
+
}
|
28
|
+
|
29
|
+
\usepackage{fixltx2e} % provides \textsubscript
|
30
|
+
\usepackage[
|
31
|
+
backend=biber,
|
32
|
+
% style=alphabetic,
|
33
|
+
% citestyle=numeric
|
34
|
+
]{biblatex}
|
35
|
+
\bibliography{$bibliography$}
|
36
|
+
|
37
|
+
% --- Splitting \texttt --------------------------------------------------
|
38
|
+
|
39
|
+
\let\textttOrig=\texttt
|
40
|
+
\def\texttt#1{\expandafter\textttOrig{\seqsplit{#1}}}
|
41
|
+
\renewcommand{\seqinsert}{\ifmmode
|
42
|
+
\allowbreak
|
43
|
+
\else\penalty6000\hspace{0pt plus 0.02em}\fi}
|
44
|
+
|
45
|
+
|
46
|
+
% --- Pandoc does not distinguish between links like [foo](bar) and
|
47
|
+
% --- [foo](foo) -- a simplistic Markdown model. However, this is
|
48
|
+
% --- wrong: in links like [foo](foo) the text is the url, and must
|
49
|
+
% --- be split correspondingly.
|
50
|
+
% --- Here we detect links \href{foo}{foo}, and also links starting
|
51
|
+
% --- with https://doi.org, and use path-like splitting (but not
|
52
|
+
% --- escaping!) with these links.
|
53
|
+
% --- Another vile thing pandoc does is the different escaping of
|
54
|
+
% --- foo and bar. This may confound our detection.
|
55
|
+
% --- This problem we do not try to solve at present, with the exception
|
56
|
+
% --- of doi-like urls, which we detect correctly.
|
57
|
+
|
58
|
+
|
59
|
+
\makeatletter
|
60
|
+
\let\href@Orig=\href
|
61
|
+
\def\href@Urllike#1#2{\href@Orig{#1}{\begingroup
|
62
|
+
\def\Url@String{#2}\Url@FormatString
|
63
|
+
\endgroup}}
|
64
|
+
\def\href@Notdoi#1#2{\def\tempa{#1}\def\tempb{#2}%
|
65
|
+
\ifx\tempa\tempb\relax\href@Urllike{#1}{#2}\else
|
66
|
+
\href@Orig{#1}{#2}\fi}
|
67
|
+
\def\href#1#2{%
|
68
|
+
\IfBeginWith{#1}{https://doi.org}%
|
69
|
+
{\href@Urllike{#1}{#2}}{\href@Notdoi{#1}{#2}}}
|
70
|
+
\makeatother
|
71
|
+
|
72
|
+
$if(csl-refs)$
|
73
|
+
\newlength{\cslhangindent}
|
74
|
+
\setlength{\cslhangindent}{1.5em}
|
75
|
+
\newlength{\csllabelwidth}
|
76
|
+
\setlength{\csllabelwidth}{3em}
|
77
|
+
\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing
|
78
|
+
{% don't indent paragraphs
|
79
|
+
\setlength{\parindent}{0pt}
|
80
|
+
% turn on hanging indent if param 1 is 1
|
81
|
+
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
|
82
|
+
% set entry spacing
|
83
|
+
\ifnum #2 > 0
|
84
|
+
\setlength{\parskip}{#2\baselineskip}
|
85
|
+
\fi
|
86
|
+
}%
|
87
|
+
{}
|
88
|
+
\usepackage{calc}
|
89
|
+
\newcommand{\CSLBlock}[1]{#1\hfill\break}
|
90
|
+
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
|
91
|
+
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}}
|
92
|
+
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
|
93
|
+
$endif$
|
94
|
+
|
95
|
+
% --- Page layout -------------------------------------------------------------
|
96
|
+
\usepackage[top=3.5cm, bottom=3cm, right=1.5cm, left=1.0cm,
|
97
|
+
headheight=2.2cm, reversemp, includemp, marginparwidth=4.5cm]{geometry}
|
98
|
+
|
99
|
+
% --- Default font ------------------------------------------------------------
|
100
|
+
% \renewcommand\familydefault{\sfdefault}
|
101
|
+
|
102
|
+
% --- Style -------------------------------------------------------------------
|
103
|
+
\renewcommand{\bibfont}{\small \sffamily}
|
104
|
+
\renewcommand{\captionfont}{\small\sffamily}
|
105
|
+
\renewcommand{\captionlabelfont}{\bfseries}
|
106
|
+
|
107
|
+
% --- Section/SubSection/SubSubSection ----------------------------------------
|
108
|
+
\titleformat{\section}
|
109
|
+
{\normalfont\sffamily\Large\bfseries}
|
110
|
+
{}{0pt}{}
|
111
|
+
\titleformat{\subsection}
|
112
|
+
{\normalfont\sffamily\large\bfseries}
|
113
|
+
{}{0pt}{}
|
114
|
+
\titleformat{\subsubsection}
|
115
|
+
{\normalfont\sffamily\bfseries}
|
116
|
+
{}{0pt}{}
|
117
|
+
\titleformat*{\paragraph}
|
118
|
+
{\sffamily\normalsize}
|
119
|
+
|
120
|
+
|
121
|
+
% --- Header / Footer ---------------------------------------------------------
|
122
|
+
\usepackage{fancyhdr}
|
123
|
+
\pagestyle{fancy}
|
124
|
+
\fancyhf{}
|
125
|
+
%\renewcommand{\headrulewidth}{0.50pt}
|
126
|
+
\renewcommand{\headrulewidth}{0pt}
|
127
|
+
\fancyhead[L]{\hspace{-0.75cm}\includegraphics[width=5.5cm]{$logo_path$}}
|
128
|
+
\fancyhead[C]{}
|
129
|
+
\fancyhead[R]{}
|
130
|
+
\renewcommand{\footrulewidth}{0.25pt}
|
131
|
+
|
132
|
+
\fancyfoot[L]{\parbox[t]{0.98\headwidth}{\footnotesize{\sffamily $citation_author$, ($year$). $title$. \textit{$journal_name$}, $volume$($issue$), $page$. \url{https://doi.org/$formatted_doi$}}}}
|
133
|
+
|
134
|
+
|
135
|
+
\fancyfoot[R]{\sffamily \thepage}
|
136
|
+
\makeatletter
|
137
|
+
\let\ps@plain\ps@fancy
|
138
|
+
\fancyheadoffset[L]{4.5cm}
|
139
|
+
\fancyfootoffset[L]{4.5cm}
|
140
|
+
|
141
|
+
% --- Macros ---------
|
142
|
+
|
143
|
+
\definecolor{linky}{rgb}{0.0, 0.5, 1.0}
|
144
|
+
|
145
|
+
\newtcolorbox{repobox}
|
146
|
+
{colback=red, colframe=red!75!black,
|
147
|
+
boxrule=0.5pt, arc=2pt, left=6pt, right=6pt, top=3pt, bottom=3pt}
|
148
|
+
|
149
|
+
\newcommand{\ExternalLink}{%
|
150
|
+
\tikz[x=1.2ex, y=1.2ex, baseline=-0.05ex]{%
|
151
|
+
\begin{scope}[x=1ex, y=1ex]
|
152
|
+
\clip (-0.1,-0.1)
|
153
|
+
--++ (-0, 1.2)
|
154
|
+
--++ (0.6, 0)
|
155
|
+
--++ (0, -0.6)
|
156
|
+
--++ (0.6, 0)
|
157
|
+
--++ (0, -1);
|
158
|
+
\path[draw,
|
159
|
+
line width = 0.5,
|
160
|
+
rounded corners=0.5]
|
161
|
+
(0,0) rectangle (1,1);
|
162
|
+
\end{scope}
|
163
|
+
\path[draw, line width = 0.5] (0.5, 0.5)
|
164
|
+
-- (1, 1);
|
165
|
+
\path[draw, line width = 0.5] (0.6, 1)
|
166
|
+
-- (1, 1) -- (1, 0.6);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
% --- Title / Authors ---------------------------------------------------------
|
171
|
+
% patch \maketitle so that it doesn't center
|
172
|
+
\patchcmd{\@maketitle}{center}{flushleft}{}{}
|
173
|
+
\patchcmd{\@maketitle}{center}{flushleft}{}{}
|
174
|
+
% patch \maketitle so that the font size for the title is normal
|
175
|
+
\patchcmd{\@maketitle}{\LARGE}{\LARGE\sffamily}{}{}
|
176
|
+
% patch the patch by authblk so that the author block is flush left
|
177
|
+
\def\maketitle{{%
|
178
|
+
\renewenvironment{tabular}[2][]
|
179
|
+
{\begin{flushleft}}
|
180
|
+
{\end{flushleft}}
|
181
|
+
\AB@maketitle}}
|
182
|
+
\makeatletter
|
183
|
+
\renewcommand\AB@affilsepx{ \protect\Affilfont}
|
184
|
+
%\renewcommand\AB@affilnote[1]{{\bfseries #1}\hspace{2pt}}
|
185
|
+
\renewcommand\AB@affilnote[1]{{\bfseries #1}\hspace{3pt}}
|
186
|
+
\renewcommand{\affil}[2][]%
|
187
|
+
{\newaffiltrue\let\AB@blk@and\AB@pand
|
188
|
+
\if\relax#1\relax\def\AB@note{\AB@thenote}\else\def\AB@note{#1}%
|
189
|
+
\setcounter{Maxaffil}{0}\fi
|
190
|
+
\begingroup
|
191
|
+
\let\href=\href@Orig
|
192
|
+
\let\texttt=\textttOrig
|
193
|
+
\let\protect\@unexpandable@protect
|
194
|
+
\def\thanks{\protect\thanks}\def\footnote{\protect\footnote}%
|
195
|
+
\@temptokena=\expandafter{\AB@authors}%
|
196
|
+
{\def\\{\protect\\\protect\Affilfont}\xdef\AB@temp{#2}}%
|
197
|
+
\xdef\AB@authors{\the\@temptokena\AB@las\AB@au@str
|
198
|
+
\protect\\[\affilsep]\protect\Affilfont\AB@temp}%
|
199
|
+
\gdef\AB@las{}\gdef\AB@au@str{}%
|
200
|
+
{\def\\{, \ignorespaces}\xdef\AB@temp{#2}}%
|
201
|
+
\@temptokena=\expandafter{\AB@affillist}%
|
202
|
+
\xdef\AB@affillist{\the\@temptokena \AB@affilsep
|
203
|
+
\AB@affilnote{\AB@note}\protect\Affilfont\AB@temp}%
|
204
|
+
\endgroup
|
205
|
+
\let\AB@affilsep\AB@affilsepx
|
206
|
+
}
|
207
|
+
\makeatother
|
208
|
+
\renewcommand\Authfont{\sffamily\bfseries}
|
209
|
+
\renewcommand\Affilfont{\sffamily\small\mdseries}
|
210
|
+
\setlength{\affilsep}{1em}
|
211
|
+
|
212
|
+
|
213
|
+
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
214
|
+
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
|
215
|
+
\usepackage[utf8]{inputenc}
|
216
|
+
|
217
|
+
\else % if luatex or xelatex
|
218
|
+
\ifxetex
|
219
|
+
\usepackage{mathspec}
|
220
|
+
\else
|
221
|
+
\usepackage{fontspec}
|
222
|
+
\fi
|
223
|
+
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
|
224
|
+
|
225
|
+
\fi
|
226
|
+
% use upquote if available, for straight quotes in verbatim environments
|
227
|
+
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
|
228
|
+
% use microtype if available
|
229
|
+
\IfFileExists{microtype.sty}{%
|
230
|
+
\usepackage{microtype}
|
231
|
+
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
|
232
|
+
}{}
|
233
|
+
|
234
|
+
\usepackage{hyperref}
|
235
|
+
$if(colorlinks)$
|
236
|
+
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
|
237
|
+
$endif$
|
238
|
+
\hypersetup{unicode=true,
|
239
|
+
$if(title-meta)$
|
240
|
+
pdftitle={$title-meta$},
|
241
|
+
$endif$
|
242
|
+
$if(author-meta)$
|
243
|
+
pdfauthor={$author-meta$},
|
244
|
+
$endif$
|
245
|
+
$if(keywords)$
|
246
|
+
pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
|
247
|
+
$endif$
|
248
|
+
$if(colorlinks)$
|
249
|
+
colorlinks=true,
|
250
|
+
linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
|
251
|
+
citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
|
252
|
+
urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
|
253
|
+
$else$
|
254
|
+
pdfborder={0 0 0},
|
255
|
+
$endif$
|
256
|
+
breaklinks=true}
|
257
|
+
\urlstyle{same} % don't use monospace font for urls
|
258
|
+
$if(lang)$
|
259
|
+
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
260
|
+
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
|
261
|
+
$if(babel-newcommands)$
|
262
|
+
$babel-newcommands$
|
263
|
+
$endif$
|
264
|
+
\else
|
265
|
+
\usepackage{polyglossia}
|
266
|
+
\setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
|
267
|
+
$for(polyglossia-otherlangs)$
|
268
|
+
\setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
|
269
|
+
$endfor$
|
270
|
+
\fi
|
271
|
+
$endif$
|
272
|
+
$if(natbib)$
|
273
|
+
\usepackage{natbib}
|
274
|
+
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
|
275
|
+
$endif$
|
276
|
+
$if(biblatex)$
|
277
|
+
\usepackage$if(biblio-style)$[style=$biblio-style$]$endif${biblatex}
|
278
|
+
$if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$
|
279
|
+
$for(bibliography)$
|
280
|
+
\addbibresource{$bibliography$}
|
281
|
+
$endfor$
|
282
|
+
$endif$
|
283
|
+
$if(listings)$
|
284
|
+
\usepackage{listings}
|
285
|
+
$endif$
|
286
|
+
$if(lhs)$
|
287
|
+
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
|
288
|
+
$endif$
|
289
|
+
$if(highlighting-macros)$
|
290
|
+
$highlighting-macros$
|
291
|
+
$endif$
|
292
|
+
$if(verbatim-in-note)$
|
293
|
+
\usepackage{fancyvrb}
|
294
|
+
\VerbatimFootnotes % allows verbatim text in footnotes
|
295
|
+
$endif$
|
296
|
+
$if(tables)$
|
297
|
+
\usepackage{longtable,booktabs}
|
298
|
+
$endif$
|
299
|
+
|
300
|
+
% --- We redefined \texttt, but in sections and captions we want the
|
301
|
+
% --- old definition
|
302
|
+
\let\addcontentslineOrig=\addcontentsline
|
303
|
+
\def\addcontentsline#1#2#3{\bgroup
|
304
|
+
\let\texttt=\textttOrig\addcontentslineOrig{#1}{#2}{#3}\egroup}
|
305
|
+
\let\markbothOrig\markboth
|
306
|
+
\def\markboth#1#2{\bgroup
|
307
|
+
\let\texttt=\textttOrig\markbothOrig{#1}{#2}\egroup}
|
308
|
+
\let\markrightOrig\markright
|
309
|
+
\def\markright#1{\bgroup
|
310
|
+
\let\texttt=\textttOrig\markrightOrig{#1}\egroup}
|
311
|
+
|
312
|
+
|
313
|
+
$if(graphics)$
|
314
|
+
\usepackage{graphicx,grffile}
|
315
|
+
\makeatletter
|
316
|
+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
|
317
|
+
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
|
318
|
+
\makeatother
|
319
|
+
% Scale images if necessary, so that they will not overflow the page
|
320
|
+
% margins by default, and it is still possible to overwrite the defaults
|
321
|
+
% using explicit options in \includegraphics[width, height, ...]{}
|
322
|
+
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
|
323
|
+
$endif$
|
324
|
+
$if(links-as-notes)$
|
325
|
+
% Make links footnotes instead of hotlinks:
|
326
|
+
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
|
327
|
+
$endif$
|
328
|
+
$if(strikeout)$
|
329
|
+
\usepackage[normalem]{ulem}
|
330
|
+
% avoid problems with \sout in headers with hyperref:
|
331
|
+
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
|
332
|
+
$endif$
|
333
|
+
$if(indent)$
|
334
|
+
$else$
|
335
|
+
\IfFileExists{parskip.sty}{%
|
336
|
+
\usepackage{parskip}
|
337
|
+
}{% else
|
338
|
+
\setlength{\parindent}{0pt}
|
339
|
+
\setlength{\parskip}{6pt plus 2pt minus 1pt}
|
340
|
+
}
|
341
|
+
$endif$
|
342
|
+
\setlength{\emergencystretch}{3em} % prevent overfull lines
|
343
|
+
\providecommand{\tightlist}{%
|
344
|
+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
345
|
+
$if(numbersections)$
|
346
|
+
\setcounter{secnumdepth}{5}
|
347
|
+
$else$
|
348
|
+
\setcounter{secnumdepth}{0}
|
349
|
+
$endif$
|
350
|
+
$if(subparagraph)$
|
351
|
+
$else$
|
352
|
+
% Redefines (sub)paragraphs to behave more like sections
|
353
|
+
\ifx\paragraph\undefined\else
|
354
|
+
\let\oldparagraph\paragraph
|
355
|
+
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
|
356
|
+
\fi
|
357
|
+
\ifx\subparagraph\undefined\else
|
358
|
+
\let\oldsubparagraph\subparagraph
|
359
|
+
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
|
360
|
+
\fi
|
361
|
+
$endif$
|
362
|
+
$if(dir)$
|
363
|
+
\ifxetex
|
364
|
+
% load bidi as late as possible as it modifies e.g. graphicx
|
365
|
+
$if(latex-dir-rtl)$
|
366
|
+
\usepackage[RTLdocument]{bidi}
|
367
|
+
$else$
|
368
|
+
\usepackage{bidi}
|
369
|
+
$endif$
|
370
|
+
\fi
|
371
|
+
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
372
|
+
\TeXXeTstate=1
|
373
|
+
\newcommand{\RL}[1]{\beginR #1\endR}
|
374
|
+
\newcommand{\LR}[1]{\beginL #1\endL}
|
375
|
+
\newenvironment{RTL}{\beginR}{\endR}
|
376
|
+
\newenvironment{LTR}{\beginL}{\endL}
|
377
|
+
\fi
|
378
|
+
$endif$
|
379
|
+
$for(header-includes)$
|
380
|
+
$header-includes$
|
381
|
+
$endfor$
|
382
|
+
|
383
|
+
$if(title)$
|
384
|
+
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
|
385
|
+
$endif$
|
386
|
+
$if(subtitle)$
|
387
|
+
\providecommand{\subtitle}[1]{}
|
388
|
+
\subtitle{$subtitle$}
|
389
|
+
$endif$
|
390
|
+
|
391
|
+
$if(authors)$
|
392
|
+
$for(authors)$
|
393
|
+
$if(authors.affiliation)$
|
394
|
+
\author[$authors.affiliation$]{$authors.name$}
|
395
|
+
$else$
|
396
|
+
\author{$authors.name$}
|
397
|
+
$endif$
|
398
|
+
$endfor$
|
399
|
+
$endif$
|
400
|
+
|
401
|
+
$if(affiliations)$
|
402
|
+
$for(affiliations)$
|
403
|
+
\affil[$affiliations.index$]{$affiliations.name$}
|
404
|
+
$endfor$
|
405
|
+
$endif$
|
406
|
+
\date{\vspace{-5ex}}
|
407
|
+
|
408
|
+
\begin{document}
|
409
|
+
$if(title)$
|
410
|
+
\maketitle
|
411
|
+
$endif$
|
412
|
+
$if(abstract)$
|
413
|
+
\begin{abstract}
|
414
|
+
$abstract$
|
415
|
+
\end{abstract}
|
416
|
+
$endif$
|
417
|
+
|
418
|
+
\marginpar{
|
419
|
+
\sffamily\small
|
420
|
+
|
421
|
+
{\bfseries DOI:} \href{https://doi.org/$formatted_doi$}{\color{linky}{$formatted_doi$}}
|
422
|
+
|
423
|
+
\vspace{2mm}
|
424
|
+
|
425
|
+
{\bfseries Software}
|
426
|
+
\begin{itemize}
|
427
|
+
\setlength\itemsep{0em}
|
428
|
+
\item \href{$review_issue_url$}{\color{linky}{Review}} \ExternalLink
|
429
|
+
\item \href{$repository$}{\color{linky}{Repository}} \ExternalLink
|
430
|
+
\item \href{$archive_doi$}{\color{linky}{Archive}} \ExternalLink
|
431
|
+
\end{itemize}
|
432
|
+
|
433
|
+
\vspace{2mm}
|
434
|
+
|
435
|
+
{\bfseries Submitted:} $submitted$\\
|
436
|
+
{\bfseries Published:} $published$
|
437
|
+
|
438
|
+
\vspace{2mm}
|
439
|
+
{\bfseries License}\\
|
440
|
+
Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (\href{https://creativecommons.org/licenses/by/4.0/}{\color{linky}{CC BY 4.0}}).
|
441
|
+
}
|
442
|
+
|
443
|
+
$for(include-before)$
|
444
|
+
$include-before$
|
445
|
+
|
446
|
+
$endfor$
|
447
|
+
$if(toc)$
|
448
|
+
{
|
449
|
+
$if(colorlinks)$
|
450
|
+
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
|
451
|
+
$endif$
|
452
|
+
\setcounter{tocdepth}{$toc-depth$}
|
453
|
+
\tableofcontents
|
454
|
+
}
|
455
|
+
$endif$
|
456
|
+
$if(lot)$
|
457
|
+
\listoftables
|
458
|
+
$endif$
|
459
|
+
$if(lof)$
|
460
|
+
\listoffigures
|
461
|
+
$endif$
|
462
|
+
$body$
|
463
|
+
|
464
|
+
$if(natbib)$
|
465
|
+
$if(bibliography)$
|
466
|
+
$if(biblio-title)$
|
467
|
+
$if(book-class)$
|
468
|
+
\renewcommand\bibname{$biblio-title$}
|
469
|
+
$else$
|
470
|
+
\renewcommand\refname{$biblio-title$}
|
471
|
+
$endif$
|
472
|
+
$endif$
|
473
|
+
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
|
474
|
+
|
475
|
+
$endif$
|
476
|
+
$endif$
|
477
|
+
$if(biblatex)$
|
478
|
+
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
|
479
|
+
|
480
|
+
$endif$
|
481
|
+
$for(include-after)$
|
482
|
+
$include-after$
|
483
|
+
|
484
|
+
$endfor$
|
485
|
+
\end{document}
|
data/resources/time.lua
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
function Meta (meta)
|
2
|
+
local curtime = os.date('*t')
|
3
|
+
meta.timestamp = meta.timestamp or os.date('%Y%m%d%H%M%S')
|
4
|
+
meta.day = meta.day or tostring(curtime.day)
|
5
|
+
meta.month = meta.month or tostring(curtime.month)
|
6
|
+
meta.year = meta.year or tostring(curtime.year)
|
7
|
+
return meta
|
8
|
+
end
|
data/roboneuro.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'whedon/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "roboneuro"
|
8
|
+
spec.version = Whedon::VERSION
|
9
|
+
spec.authors = ["Agah Karakuzu"]
|
10
|
+
spec.email = ["agahkarakuzu@gmail.com"]
|
11
|
+
spec.summary = "A collection of command-line utilities to manage NeuroLibre submissions."
|
12
|
+
spec.homepage = "https://github.com/neurolibre/roboneuro-gem"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency "bibtex-ruby", "~> 6.0.0"
|
21
|
+
spec.add_dependency "dotenv"
|
22
|
+
spec.add_dependency "latex-decode"
|
23
|
+
spec.add_dependency "github-linguist", "~> 5.3"
|
24
|
+
spec.add_dependency "openjournals-nameable"
|
25
|
+
spec.add_dependency "octokit", "~> 4.20"
|
26
|
+
spec.add_dependency "rest-client", ">= 1.8"
|
27
|
+
spec.add_dependency "redcarpet", "~> 3.3"
|
28
|
+
spec.add_dependency "tilt"
|
29
|
+
spec.add_dependency "thor", "~> 0.19"
|
30
|
+
spec.add_dependency "unicode", "~> 0.4.4"
|
31
|
+
|
32
|
+
spec.add_development_dependency "bundler"
|
33
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
34
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.3"
|
36
|
+
spec.add_development_dependency "vcr", "~> 6.0"
|
37
|
+
spec.add_development_dependency "webmock", "~> 3.11.2"
|
38
|
+
spec.add_development_dependency "nokogiri", "= 1.10.8"
|
39
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
describe Whedon::Auditor do
|
4
|
+
|
5
|
+
subject { Whedon::Auditor.new(File.read('fixtures/review_body.txt')) }
|
6
|
+
|
7
|
+
it "knows how to find the author from the issue body" do
|
8
|
+
expect(subject.verify_author).to eql("Author: @zhaozhang")
|
9
|
+
end
|
10
|
+
|
11
|
+
it "knows how to find the version from the issue body" do
|
12
|
+
expect(subject.verify_version).to eql("Version: v1.2")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "knows how to find the repository from the issue body" do
|
16
|
+
expect(subject.verify_repository).to eql("Repository: \"https://github.com/applicationskeleton/Skeleton\"")
|
17
|
+
end
|
18
|
+
|
19
|
+
it "knows how to find the archive from the issue body" do
|
20
|
+
expect(subject.verify_archive).to eql("Archive: \"http://dx.doi.org/10.5281/zenodo.13750\"")
|
21
|
+
end
|
22
|
+
end
|
data/spec/author_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
describe Whedon::Author do
|
4
|
+
|
5
|
+
context "#initials" do
|
6
|
+
it "should return first name and middle name initials" do
|
7
|
+
subject = Whedon::Author.new("Sarah Michelle Gellar", "", nil, nil)
|
8
|
+
expect(subject.initials).to eq("S. M.")
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return first name initial if no middle name present" do
|
12
|
+
subject = Whedon::Author.new("Buffy Summers", "", nil, nil)
|
13
|
+
expect(subject.initials).to eq("B.")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/spec/bibtex_spec.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
describe Whedon::BibtexParser do
|
5
|
+
|
6
|
+
subject { Whedon::BibtexParser.new('fixtures/paper/paper.bib') }
|
7
|
+
|
8
|
+
it "should know how to generate DOI citations" do
|
9
|
+
citations_xml = Nokogiri::XML(subject.generate_citations)
|
10
|
+
expect(citations_xml.search('citation[key="ref1"]').children[1].name).to eql("doi")
|
11
|
+
expect(citations_xml.search('citation[key="ref1"]').text.strip).to eql("10.1109/SERVICES.2007.63")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should know how to generate shortDOI citations" do
|
15
|
+
citations_xml = Nokogiri::XML(subject.generate_citations)
|
16
|
+
expect(citations_xml.search('citation[key="ref2"]').children[1].name).to eql("doi")
|
17
|
+
expect(citations_xml.search('citation[key="ref2"]').text.strip).to eql("10/fm2vqj")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should know how to generate non-DOI citations" do
|
21
|
+
citations_xml = Nokogiri::XML(subject.generate_citations)
|
22
|
+
expect(citations_xml.search('citation[key="ref6"]').children[1].name).to eql("unstructured_citation")
|
23
|
+
expect(citations_xml.search('citation[key="ref6"]').text).to match(/Integrating Abstractions to Enhance the Execution of Distributed Applications, Turilli, Matteo and Zhang, Zhao and Merzky, Andre and Wilde, Michael and Weissman, Jon and Katz, Daniel S and Jha, Shantenu and others, arXiv preprint arXiv:1504.04720, 2015/)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should know how to generate a limited set of citations when passed keys" do
|
27
|
+
citations_in_paper = ['@SWIFT09', '@PEGASUS04']
|
28
|
+
citations_xml = Nokogiri::XML(subject.generate_citations(citations_in_paper))
|
29
|
+
expect(citations_xml.search('citation').size).to eql(2)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
describe Whedon::OrcidValidator do
|
4
|
+
|
5
|
+
context "checksum validations" do
|
6
|
+
it "should return true for a valid ORCID" do
|
7
|
+
subject = Whedon::OrcidValidator.new("0000-0002-3957-2474")
|
8
|
+
expect(subject.validate).to be_truthy
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return false for an invalid ORCID" do
|
12
|
+
subject = Whedon::OrcidValidator.new("0000-0002-3957-247X")
|
13
|
+
expect(subject.validate).to be_falsey
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context "structure validations" do
|
18
|
+
it "should fail for a valid ORCID that's badly structured" do
|
19
|
+
subject = Whedon::OrcidValidator.new("0000000239572474")
|
20
|
+
expect(subject.validate).to be_falsey
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should fail for an ORCID with the wrong length" do
|
24
|
+
subject = Whedon::OrcidValidator.new("0000-0002-3957-247")
|
25
|
+
expect(subject.validate).to be_falsey
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should fail for an ORCID invalid characters" do
|
29
|
+
subject = Whedon::OrcidValidator.new("0000-000X-3957-2474")
|
30
|
+
expect(subject.validate).to be_falsey
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|