Add citation configuration in form of a test
Change-Id: Ib0b480cf1ae2aa26d838cf085420fa8cb5b8e927
diff --git a/dev/scss/main/tutorial.scss b/dev/scss/main/tutorial.scss
index 6ccc32e..d743ee1 100644
--- a/dev/scss/main/tutorial.scss
+++ b/dev/scss/main/tutorial.scss
@@ -44,6 +44,16 @@
}
}
+p.bibentry {
+ font-size: 80%;
+ margin-left: 3em;
+ margin-bottom: 3em;
+ cite {
+ font-weight: bold;
+ }
+ text-indent: -1.5em;
+}
+
body.embedded {
background-color: $nearly-white;
aside {
diff --git a/t/custom/partial/citation.html.ep b/t/custom/partial/citation.html.ep
new file mode 100644
index 0000000..c7f8d88
--- /dev/null
+++ b/t/custom/partial/citation.html.ep
@@ -0,0 +1,27 @@
+<section>
+ <h4><%= loc 'recentCorpusPub' %></h4>
+
+ <p class="bibentry">IDS (2020a): <cite><a href="https://www.ids-mannheim.de/DeReKo">Deutsches Referenzkorpus / Archiv der Korpora geschriebener Gegenwartssprache</a></cite> 2020-I (Release vom 21.01.2020).<br />Mannheim: Leibniz-Institut für Deutsche Sprache. PID: <a href="http://hdl.handle.net/10932/00-04B6-B898-AD1A-8101-4">00-04B6-B898-AD1A-8101-4</a>.
+ <span class='Z3988' title='url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fzotero.org%3A2&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=report&rft.btitle=Deutsches%20Referenzkorpus%20%2F%20Archiv%20der%20Korpora%20geschriebener%20Gegenwartssprache%202020-I&rft.place=Mannheim&rft.publisher=Leibniz-Institut%20f%C3%BCr%20Deutsche%20Sprache&rft.date=2020'></span>
+ </p>
+
+ <p class="bibentry">Kupietz, Marc/Lüngen, Harald/Kamocki, Paweł/Witt, Andreas (2018): <cite>The German Reference Corpus DeReKo: New Developments – New Opportunities</cite><br />In: Calzolari, Nicoletta/Choukri, Khalid/Cieri, Christopher/Declerck, Thierry/Goggi, Sara/Hasida, Koiti/Isahara, Hitoshi/Maegaard, Bente/Mariani, Joseph/Mazo, Hélène/Moreno, Asuncion/Odijk, Jan/Piperidis, Stelios/Tokunaga, Takenobu (Hrsg.): Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018). Miyazaki: European Language Resources Association (ELRA), 2018. S. 4353-4360.
+ <span class='Z3988' title='url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fzotero.org%3A2&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.atitle=The%20German%20Reference%20Corpus%20DeReKo%3A%20New%20Developments%20%E2%80%93%20New%20Opportunities&rft.btitle=Proceedings%20of%20the%20Eleventh%20International%20Conference%20on%20Language%20Resources%20and%20Evaluation%20(LREC%202018)&rft.place=Miyazaki&rft.publisher=European%20Language%20Resources%20Association%20(ELRA)&rft.aufirst=Marc&rft.aulast=Kupietz&rft.au=Marc%20Kupietz&rft.au=Harald%20L%C3%BCngen&rft.au=Pawe%C5%82%20Kamocki&rft.au=Andreas%20Witt&rft.date=2018&rft.pages=4353-4360&rft.spage=4353&rft.epage=4360'></span>
+ </p>
+
+ <p class="bibentry">Kupietz, Marc/Belica, Cyril/Keibel, Holger/Witt, Andreas (2010): <cite><a class="extern" href="http://www.lrec-conf.org/proceedings/lrec2010/pdf/414_Paper.pdf">The German Reference Corpus DeReKo: A primordial sample for linguistic research</a></cite><br />In: Calzolari, Nicoletta et al. (eds.): Proceedings of the 7th conference on International Language Resources and Evaluation (LREC 2010). Valletta, Malta: European Language Resources Association (ELRA), 1848-1854.
+ <span class='Z3988' title='url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fzotero.org%3A2&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.atitle=The%20German%20Reference%20Corpus%20DeReKo%3A%20A%20primordial%20sample%20for%20linguistic%20research&rft.btitle=Proceedings%20of%20the%207th%20conference%20on%20International%20Language%20Resources%20and%20Evaluation%20(LREC%202010).&rft.place=Valletta%2C%20Malta&rft.publisher=European%20Language%20Resources%20Association%20(ELRA)&rft.aufirst=Marc&rft.aulast=Kupietz&rft.au=Marc%20Kupietz&rft.au=Cyril%20Belica&rft.au=Holger%20Keibel&rft.au=Andreas%20Witt&rft.date=2010&rft.pages=1848-1854&rft.spage=1848&rft.epage=1854'></span>
+ </p>
+</section>
+
+<section>
+ <h4><%= loc 'recentToolPub' %></h4>
+
+ <p class="bibentry">Kupietz, Marc/Diewald, Nils/Margaretha, Eliza/Bodmer, Franck/Stallkamp, Helge/Harders, Peter (2020): <cite>Recherche in Social-Media-Korpora mit KorAP</cite><br />In: Marx, Konstanze/Lobin, Henning/Schmidt, Axel (Hrsg.), Deutsch in Sozialen Medien. Interaktiv, multimodal, vielfältig, Jahrbuch des Instituts für Deutsche Sprache 2019. de Gruyter, Berlin/Boston, pp. 373–378.
+ <span class='Z3988' title='url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fzotero.org%3A2&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.atitle=Recherche%20in%20Social-Media-Korpora%20mit%20KorAP&rft.btitle=Deutsch%20in%20Sozialen%20Medien.%20Interaktiv%2C%20multimodal%2C%20vielf%C3%A4ltig&rft.place=Berlin%2FBoston&rft.publisher=de%20Gruyter&rft.series=Jahrbuch%20des%20Instituts%20f%C3%BCr%20Deutsche%20Sprache%202019&rft.aufirst=Marc&rft.aulast=Kupietz&rft.au=Marc%20Kupietz&rft.au=Nils%20Diewald&rft.au=Eliza%20Margaretha&rft.au=Franck%20Bodmer&rft.au=Helge%20Stallkamp&rft.au=Peter%20Harders&rft.date=2020&rft.pages=373-378&rft.spage=373&rft.epage=378'></span>
+ </p>
+
+ <p class="bibentry">Diewald, Nils/Hanl, Michael/Margaretha, Eliza/Bingel, Joachim/Kupietz, Marc/Bański, Piotr/Witt, Andreas (2016): <cite>KorAP architecture - Diving in the Deep Sea of Corpus Data</cite><br />In: Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC 2016). European Language Resources Association (ELRA), May 23th–28th 2016, Portorož, Slovenia, pp. 3586–3591.
+ <span class='Z3988' title='url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fzotero.org%3A2&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.atitle=KorAP%20architecture%20-%20Diving%20in%20the%20Deep%20Sea%20of%20Corpus%20Data&rft.btitle=Proceedings%20of%20the%20Tenth%20International%20Conference%20on%20Language%20Resources%20and%20Evaluation%20(LREC%202016)&rft.place=Portoro%C5%BE%2C%20Slovenia&rft.aufirst=Nils&rft.aulast=Diewald&rft.au=Nils%20Diewald&rft.au=Michael%20Hanl&rft.au=Eliza%20Margaretha&rft.au=Joachim%20Bingel&rft.au=Marc%20Kupietz&rft.au=Piotr%20Ba%C5%84ski&rft.au=Andreas%20Witt&rft.date=2016&rft.pages=3586-3591&rft.spage=3586&rft.epage=3591'></span>
+ </p>
+</section>
diff --git a/t/page.t b/t/page.t
index 029cb33..55f6518 100644
--- a/t/page.t
+++ b/t/page.t
@@ -1,6 +1,7 @@
use Mojo::Base -strict;
use Test::More;
use Test::Mojo;
+use Mojo::File qw/path/;
# Test the documentation
@@ -28,6 +29,50 @@
->header_like('Content-Security-Policy', qr!object-src 'self';!)
;
+# Test additions
+$t = Test::Mojo->new('Kalamar' => {
+ 'Localize' => {
+ dict => {
+ en_howToCite => 'Citation Help',
+ de_howToCite => 'Zitierhilfe',
+ en_recentCorpusPub => 'Recent publications to refer to DeReKo as linguistic research data',
+ de_recentCorpusPub => 'Neuere Publikationen zu DeReKo als linguistische Forschungsdatengrundlage',
+ en_recentToolPub => 'Recent publications to refer to KorAP as a tool for research',
+ de_recentToolPub => 'Neuere Publikationen zu KorAP als Forschungswerkzeug',
+ }
+ },
+ 'TagHelpers-ContentBlock' => {
+ footer => [
+ {
+ inline => '<%= link_to loc("howToCite") => url_for(doc => { page => "faq" })->fragment("howToCite") %>',
+ position => 75
+ }
+ ],
+ faq => [
+ {
+ position => 50,
+ inline => <<'HOWTOCITE'
+<section>
+ <h3 id="howToCite"><%= loc 'howToCite' %></h3>
+%= include 'custom/partial/citation'
+</section>
+HOWTOCITE
+ }
+ ]
+ }
+});
+
+push @{$t->app->renderer->paths}, path(path(__FILE__)->dirname);
+
+$t->get_ok('/')
+ ->text_is('footer a:nth-child(1)', 'Citation Help')
+ ->attr_like('footer a:nth-child(1)', 'href', qr'/doc/+faq#howToCite');
+
+$t->get_ok('/doc//faq#howToCite')
+ ->text_is('#howToCite', 'Citation Help')
+ ->text_is('section > section h4', 'Recent publications to refer to DeReKo as linguistic research data')
+ ;
+
done_testing;
1;