forked from shashwatup9k/acl-anthology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.html
419 lines (396 loc) · 20.1 KB
/
single.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
{{ define "meta" }}
{{ $volume_id := index (split .Params.anthology_id "-") 0 }}
{{ $paper := index (index .Site.Data.papers $volume_id) .Params.anthology_id }}
<meta content="{{ $paper.title }}" name="citation_title" >
{{ range $paper.author }}
{{ $first_letter := slicestr .id 0 1 }}
<meta content="{{ (index $.Site.Data.people $first_letter .id).full }}" name="citation_author" >
{{ end }}
{{ with $paper.parent_volume_id }}
{{ $volume := index $.Site.Data.volumes . }}
{{ if isset $volume "meta_journal_title" }}
<meta content="{{ $volume.meta_journal_title }}" name="citation_journal_title" >
{{ else }}
<meta content="{{ $volume.title }}" name="citation_conference_title" >
{{ end }}
{{ with $volume.meta_volume }}<meta content="{{ . }}" name="citation_volume" >{{ end }}
{{ with $volume.meta_issue }}<meta content="{{ . }}" name="citation_issue" >{{ end }}
{{ with $volume.meta_date }}<meta content="{{ . }}" name="citation_publication_date" >{{ end }}
{{ end }}
{{ with $paper.pdf }}
<meta content="{{ . }}" name="citation_pdf_url" >
{{ end }}
{{ with $paper.page_first }}<meta content="{{ . }}" name="citation_firstpage" >{{ end }}
{{ with $paper.page_last }}<meta content="{{ . }}" name="citation_lastpage" >{{ end }}
{{ with $paper.doi }}<meta content="{{ . }}" name="citation_doi" >{{ end }}
<meta property="og:title" content="{{ $paper.title }}" />
{{ with $paper.thumbnail }}
<meta property="og:image" content="{{ . }}" />
<meta property="og:image:alt" content="First page of paper PDF." />
{{ end }}
<meta property="og:type" content="article" />
<meta property="og:site_name" content="ACL Anthology" />
<meta property="og:url" content="{{ $paper.url }}" />
<meta property="og:description" content="{{ $paper.author_string }}. {{ $paper.booktitle }}. {{ $paper.year }}." />
<link rel="canonical" href="{{ $paper.url }}" />
{{ end }}
{{ define "javascript" }}
<script src="{{ "/js/clipboard.min.js" | relURL }}"></script>
<script>
$( document ).ready(function() {
if (ClipboardJS.isSupported()) {
success_fn = function(e) {
// turns button into "copy successful"-style for 2 seconds
var src = $(e.trigger);
src.toggleClass("btn-success");
src.children("i").toggleClass("far fa-clipboard fas fa-clipboard-check");
e.clearSelection();
setTimeout(function() {
src.toggleClass("btn-success");
src.children("i").toggleClass("far fa-clipboard fas fa-clipboard-check");
}, 2000);
};
var clipboard = new ClipboardJS(".btn-clipboard");
clipboard.on('success', success_fn);
$(".btn-clipboard").removeClass("d-none");
// buttons outside the "cite" popup can't copy the content the usual way
// because the content element is hidden at the time; therefore we fetch
// and return the text to be copied manually
var clipboard_outside = new ClipboardJS(".btn-clipboard-outside", {
text: function(trigger) {
var target = trigger.getAttribute("data-clipboard-target");
return $(target).text();
}
});
clipboard_outside.on('success', success_fn);
$(".btn-clipboard-outside").removeClass("d-none");
}
});
</script>
{{ end }}
{{ define "main" }}
{{ $anthology_id := .Params.anthology_id }}
{{ $volume_id := index (split .Params.anthology_id "-") 0 }}
{{ $paper := index (index .Site.Data.papers $volume_id) .Params.anthology_id }}
{{ $has_bib := fileExists (printf "/data-export/%s.bib" $anthology_id) }}
{{ $has_xml := fileExists (printf "/data-export/%s.xml" $anthology_id) }}
{{ $has_endf := fileExists (printf "/data-export/%s.endf" $anthology_id) }}
<section id="main">
<div {{ if or $paper.retracted $paper.removed }} style="text-decoration: line-through" {{ end }}>
<h2 id="title">
{{ with $paper.pdf }}
<a href="{{ . }}">{{ $paper.title_html | safeHTML }}</a>
{{ else }}
{{ $paper.title_html | safeHTML }}
{{ end }}
</h2>
{{ with $paper.author }}
<p class="lead">
{{ $len := (len .) }}
{{ range $index, $person := . }}
{{ partial "author_link.html" (dict "ctx" $ "person" $person) | chomp }}{{ if ne (add $index 1) $len }}, {{ end }}
{{ end }}
{{ end }}
</p>
</div>
<hr />
<div class="row acl-paper-details">
<div class="col col-lg-10 order-2">
{{ with $paper.retracted }}
<div class="alert alert-danger" role="alert">
<b>This paper has been retracted.</b> {{ . }}
</div>
{{ end }}
{{ with $paper.removed }}
<div class="alert alert-danger" role="alert">
<b>This paper has been <a href="https://aclanthology.org/info/corrections/#removal">removed</a>.</b>
{{ . }}
</div>
{{ end }}
{{ with $paper.abstract_html }}
<div class="card bg-light mb-2 mb-lg-3">
<div class="card-body acl-abstract">
<h5 class="card-title">Abstract</h5>
<span {{ with $paper.retracted }} style="text-decoration: line-through" {{ end }}>
{{ . | safeHTML }}
</span>
</div>
</div>
{{ end }}
<!-- To avoid cluttering this template with Bootstrap classes, the styling
for this list is defined in assets/css/_papers.scss -->
<dl>
<dt>Anthology ID:</dt>
<dd>{{ $anthology_id }}</dd>
{{ range $paper.revision }}
{{ if eq .id "1" }}
<dt>Original:</dt>
{{ else }}
<dt>Version {{ .id }}:</dt>
{{ end }}
<dd><a href="{{ .url }}">{{ .value }}</a></dd>
{{ end }}
{{ range $paper.erratum }}
<dt>Erratum e{{ .id }}:</dt>
<dd><a href="{{ .url }}">{{ .value }}</a></dd>
{{ end }}
<dt>Volume:</dt>
<dd>
{{- with $paper.parent_volume_id -}}
{{ $volume := index $.Site.Data.volumes . }}
{{ $volume_page := printf "/volumes/%s.md" . }}
<a href="{{ relref $ $volume_page }}">{{ $volume.title }}</a>
{{- end -}}
</dd>
<dt>Month:</dt>
<dd>{{ with $paper.month }}{{ . }}{{ end }}</dd>
<dt>Year:</dt>
<dd>{{ with $paper.year }}{{ . }}{{ end }}</dd>
<dt>Address:</dt>
<dd>{{ with $paper.address }}{{ . }}{{ end }}</dd>
{{ with $paper.parent_volume_id }}
{{ $volume := index $.Site.Data.volumes . }}
<dt>{{ if gt (len $volume.venues) 1 }}Venues:{{ else }}Venue:{{ end }}</dt>
<dd>
{{- $len := (len $volume.venues) -}}
{{- range $index, $venue := $volume.venues -}}
{{ $acronym := index $.Site.Data.venues $venue "acronym" }}
<a href="{{ relref $ (printf "/venues/%s.md" ($venue)) }}">
{{- $acronym -}}
</a>
{{ if ne (add $index 1) $len }} | {{ end }}
{{- end -}}
</dd>
<dt>{{ if gt (len $volume.sigs) 1 }}SIGs:{{ else }}SIG:{{ end }}</dt>
<dd>
{{- $len := (len $volume.sigs) -}}
{{- range $index, $sig := $volume.sigs -}}
{{ $slug := index $.Site.Data.sigs $sig "slug" }}
<a href="{{ relref $ (printf "/sigs/%s.md" $slug) }}">{{ $sig }}</a>
{{ if ne (add $index 1) $len }} | {{ end }}
{{- end -}}
</dd>
{{ end }}
<dt>Publisher:</dt>
<dd>{{ with $paper.publisher }}{{ . }}{{ end }}</dd>
<dt>Note:</dt>
<dd>{{ with $paper.note }}{{ . }}{{ end }}</dd>
<dt>Pages:</dt>
<dd>{{ with $paper.pages }}{{ . }}{{ end }}</dd>
<dt>Language:</dt>
<dd>{{ with $paper.language }}{{ . }}{{ end }}</dd>
<dt>URL:</dt>
<dd><a href="{{ $paper.url }}">{{ $paper.url }}</a></dd>
<dt>DOI:</dt>
<dd>{{ with $paper.doi }}<a href="http://dx.doi.org/{{ . }}" title="To the current version of the paper by DOI">{{ . }}</a>{{ end }}</dd>
{{ range $paper.award }}
<dt>Award:</dt>
<dd><i class="fas fa-award"></i> {{ . }}</dd>
{{ end }}
<!--
<dt>Bibtype:</dt>
<dd>{{ with $paper.bibtype }}{{ . }}{{ end }}</dd>
-->
{{ if and (not $paper.retracted) (not $paper.removed) }}
<dt class="acl-button-row">Bibkey:</dt>
<dd class="acl-button-row">{{ with $paper.bibkey }}<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citePaperBibkey"><i class="far fa-clipboard"></i><span id="citePaperBibkey" class="pl-2 text-monospace">{{ . }}</span></button>{{ end }}</dd>
{{ with $paper.citation_acl }}
<dt>Cite (ACL):</dt><dd><span id="citeACL">{{ safeHTML . }}</span><button type="button" class="btn btn-clipboard btn-secondary btn-sm d-none ml-2" data-clipboard-target="#citeACL"><i class="far fa-clipboard"></i></button></dd>
{{ end }}
{{ with $paper.citation }}
<dt>Cite (Informal):</dt><dd><span id="citeRichText">{{ markdownify . }}</span><button type="button" class="btn btn-clipboard btn-secondary btn-sm d-none ml-2" data-clipboard-target="#citeRichText"><i class="far fa-clipboard"></i></button></dd>
{{ end }}
<dt class="acl-button-row">Copy Citation:</dt>
<dd class="acl-button-row">
{{ if $has_bib }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeBibtexContent"><i class="far fa-clipboard pr-2"></i>BibTeX</button>
{{ end }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeMarkdownContent"><i class="far fa-clipboard pr-2"></i>Markdown</button>
{{ if $has_xml }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeModsContent"><i class="far fa-clipboard pr-2"></i>MODS XML</button>
{{ end }}
{{ if $has_endf }}
<button type="button" class="btn btn-clipboard-outside btn-secondary btn-sm d-none" data-clipboard-target="#citeEndnoteContent"><i class="far fa-clipboard pr-2"></i>Endnote</button>
{{ end }}
<button type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#citeModal">More options…</button>
</dd>
{{ end }} <!-- if not $paper.retracted -->
{{ with $paper.pdf }}
<dt>PDF:</dt><dd><a href="{{ . }}">{{ . }}</a></dd>
{{ end }}
{{ range $paper.attachment }}
<dt class="acl-button-row">{{ humanize .type }}:</dt>
<dd class="acl-button-row"><a href="{{ .url }}" class="btn btn-attachment btn-sm">{{ partial "attachment_repr.html" . }} {{ .filename }}</a></dd>
{{ end }}
{{ range $paper.video }}
<dt class="acl-button-row">Video:</dt>
<dd class="acl-button-row"><a href="{{ . }}" class="btn btn-attachment btn-sm"><i class="fas fa-video"></i> {{ . }}</a></dd>
{{ end }}
{{ with $paper.pwccode }}
<dt>Code</dt>
<dd>
{{ if .url }}
<a href="{{ .url }}">
{{- if in .url "github.com/" -}}
<i class="fab fa-github"></i>
{{- else if in .url "gitlab.com/" -}}
<i class="fab fa-gitlab"></i>
{{- else if in .url "bitbucket" -}}
<i class="fab fa-bitbucket"></i>
{{- end -}} {{ .name }}
</a>
{{ end }}
{{ if (and (eq .additional "true") .url) }}
+
{{ end }}
{{ if eq .additional "true" }}
<a href="https://paperswithcode.com/paper/?acl={{ $anthology_id }}"><svg xmlns="http://www.w3.org/2000/svg" class="pwc-icon" viewBox="0 0 512 512"><path stroke="#4d8093" fill="#4d8093" d="M88 128h48v256H88zM232 128h48v256h-48zM160 144h48v224h-48zM304 144h48v224h-48zM376 128h48v256h-48z"></path><path stroke="#4d8093" fill="#4d8093" d="M104 104V56H16v400h88v-48H64V104zM408 56v48h40v304h-40v48h88V56z"></path></svg> additional community code
</a>
{{ end }}
</dd>
{{ end }}
{{ with $paper.pwcdataset }}
<dt>Data</dt>
<dd>
{{ range $i, $t := . }}{{ if $i }}, {{ end }}<a href="{{ $t.url }}">{{ $t.name }}</a>{{ end }}
</dd>
{{ end }}
</dl>
</div>
<!-- Most of the styling for this block is set in _papers.scss to avoid clutter -->
<div class="acl-paper-link-block">
{{ if isset $paper "revision" }}
{{ range last 1 $paper.revision }}
<a class="btn btn-primary" href="{{ .url }}" title="Open latest revision PDF of '{{ $paper.title | htmlEscape }}'">
<i class="far fa-file-pdf"></i><span class="pl-2">PDF <small>(v{{ .id }})</small></span>
</a>
{{ end }}
{{ range first 1 $paper.revision }}
<a class="btn btn-secondary" href="{{ .url }}" title="Open original PDF of '{{ $paper.title | htmlEscape }}'">
<i class="far fa-file-pdf"></i><span class="pl-2">PDF <small>(v{{ .id }})</small></span>
</a>
{{ end }}
{{ else }}
{{ with $paper.pdf }}
<a class="btn btn-primary" href="{{ . }}" title="Open PDF of '{{ $paper.title | htmlEscape }}'">
<i class="far fa-file-pdf"></i><span class="pl-2">PDF</span>
</a>
{{ end }}
{{ end }}
{{ if and (not $paper.retracted) (not $paper.removed) (or $has_bib $has_xml $has_endf) }}
<a class="btn btn-secondary" title="Open dialog for exporting citations" data-toggle="modal" data-target="#citeModal" href="#">
<i class="fas fa-quote-left"></i><span class="pl-2">Cite</span>
</a>
{{ end }}
<a class="btn btn-secondary" href="https://www.semanticscholar.org/search?{{ (querify "q" $paper.title) | safeURL }}" title="Search for '{{ $paper.title | htmlEscape }}' on Semantic Scholar">
<i class="ai ai-semantic-scholar"></i><span class="pl-sm-2 d-none d-sm-inline">Search</span>
</a>
{{ with $paper.pwccode }}
{{ if (or (eq .additional "true") .url) }}
<a class="btn btn-secondary d-flex flex-wrap justify-content-center" href="https://paperswithcode.com/paper/?acl={{ $anthology_id }}" title="Code for '{{ $paper.title | htmlEscape }}' on Papers with Code">
<svg xmlns="http://www.w3.org/2000/svg" class="pwc-icon-big" viewBox="0 0 512 512"><path stroke="#4d8093" fill="#4d8093" d="M88 128h48v256H88zM232 128h48v256h-48zM160 144h48v224h-48zM304 144h48v224h-48zM376 128h48v256h-48z"></path><path stroke="#4d8093" fill="#4d8093" d="M104 104V56H16v400h88v-48H64V104zM408 56v48h40v304h-40v48h88V56z"></path></svg>
<span class="pl-sm-2 d-none d-sm-inline">Code</span>
</a>
{{ end }}
{{ end }}
{{ range $paper.attachment }}
<a class="btn btn-attachment d-flex flex-wrap justify-content-center" href="{{ .url }}" title="Open {{ .type | humanize | lower }} for '{{ $paper.title | htmlEscape }}'">
<span class="align-self-center px-1">{{ partial "attachment_repr.html" . -}}</span>
<span class="px-1">{{ humanize .type }}</span>
</a>
{{ end }}
{{ range $paper.video }}
<a class="btn btn-attachment d-flex flex-wrap justify-content-center" href="{{ . }}" title="Open video for '{{ $paper.title | htmlEscape }}'">
<span class="align-self-center px-1"><i class="fas fa-video"></i></span>
<span class="px-1">Video</span>
</a>
{{ end }}
</div>
</div>
<hr />
<div class="modal fade" id="citeModal" tabindex="-1" role="dialog" aria-labelledby="citeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="citeModalLabel">Export citation</h5>
<button class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<ul class="nav nav-tabs mb-2" id="citeFormats" role="tablist">
<li class="nav-item">
<a class="nav-link {{ if not $has_bib }}disabled{{ else }}active{{ end }}" data-toggle="list" href="#citeBibtex" role="tab" aria-controls="citeBibtex" aria-selected="{{ if $has_bib }}true{{ else }}false{{ end }}">BibTeX</a>
</li>
<li class="nav-item">
<a class="nav-link {{ if not $has_xml }}disabled{{ end }}" data-toggle="list" href="#citeMods" role="tab" aria-controls="citeMods" aria-selected="false">MODS XML</a>
</li>
<li class="nav-item">
<a class="nav-link {{ if not $has_endf }}disabled{{ end }}" data-toggle="list" href="#citeEndnote" role="tab" aria-controls="citeEndnote" aria-selected="false">Endnote</a>
</li>
<li class="nav-item">
<a class="nav-link {{ if not $has_bib }}active{{ end }}" data-toggle="list" href="#citeMarkdown" role="tab" aria-controls="citeMarkdown" aria-selected="{{ if $has_bib }}false{{ else }}true{{ end }}">Preformatted</a>
</li>
</ul>
<div class="tab-content" id="citeFormatsContent">
<div class="tab-pane active" id="citeBibtex" role="tabpanel">
{{- if $has_bib -}}
<pre id="citeBibtexContent" class="bg-light border p-2" style="max-height: 50vh;">
{{- readFile (printf "/data-export/%s.bib" $anthology_id) -}}
</pre>
<div class="modal-footer pb-1">
<a class="btn btn-secondary" href="{{ (printf "/%s.bib" $anthology_id) | relURL }}"><i class="fas fa-download pr-2"></i>Download as File</a>
<button class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeBibtexContent"><i class="far fa-clipboard pr-2"></i>Copy to Clipboard</button>
</div>
{{- end -}}
</div>
<div class="tab-pane" id="citeMods" role="tabpanel">
{{- if $has_xml -}}
<pre id="citeModsContent" class="bg-light border p-2" style="max-height: 50vh;">
{{- readFile (printf "/data-export/%s.xml" $anthology_id) -}}
</pre>
<div class="modal-footer pb-1">
<a class="btn btn-secondary" href="{{ (printf "/%s.xml" $anthology_id) | relURL }}"><i class="fas fa-download pr-2"></i>Download as File</a>
<button class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeModsContent"><i class="far fa-clipboard pr-2"></i>Copy to Clipboard</button>
</div>
{{- end -}}
</div>
<div class="tab-pane" id="citeEndnote" role="tabpanel">
{{- if $has_endf -}}
<pre id="citeEndnoteContent" class="bg-light border p-2" style="max-height: 50vh;">
{{- readFile (printf "/data-export/%s.endf" $anthology_id) -}}
</pre>
<div class="modal-footer pb-1">
<a class="btn btn-secondary" href="{{ (printf "/%s.endf" $anthology_id) | relURL }}"><i class="fas fa-download pr-2"></i>Download as File</a>
<button class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeEndnoteContent"><i class="far fa-clipboard pr-2"></i>Copy to Clipboard</button>
</div>
{{- end -}}
</div>
<div class="tab-pane" id="citeMarkdown" role="tabpanel">
<h5>Markdown (Informal)</h5>
<p id="citeMarkdownContent" class="text-monospace small bg-light border p-2">
{{- $paper.citation -}}
</p>
<ul class="mt-2">
<li>{{- $paper.citation | markdownify -}}</li>
</ul>
{{ with $paper.citation_acl }}
<h5>ACL</h5>
<ul class="mt-2">
<li id="citeACLstyleContent">{{- $paper.citation_acl | safeHTML -}}</li>
</ul>
{{ end }}
<div class="modal-footer pb-1">
<button type="button" class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeMarkdownContent"><i class="far fa-clipboard pr-2"></i>Copy Markdown to Clipboard</button>
{{ with $paper.citation_acl }}
<button type="button" class="btn btn-clipboard btn-primary d-none" data-clipboard-target="#citeACLstyleContent"><i class="far fa-clipboard pr-2"></i>Copy ACL to Clipboard</button>
{{ end }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{{ end }}