Support custom corpus documentation templates
Mount a "custom" directory into the kalamar container, so users can
describe their own corpus in the KorAP user interface: Kalamar serves a
documentation page from there whenever it does not ship one itself, so a
doc/corpus.html.ep becomes the corpus page. Ship examples for that page,
for an optional references page, and for the corpus part of the
references page.
The directory defaults to ./custom and can be relocated with
KALAMAR_TEMPLATES.
Also allow overriding the kalamar image via KALAMAR_IMAGE, which is
needed to try this out on a Kalamar built from an unreleased version.
The references page needs the citation partial of Kalamar 0.66 or later.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Change-Id: I8d964c996c15aa1d4ea85f18be223d737ed6d528
diff --git a/custom/doc/citation.html.ep.example b/custom/doc/citation.html.ep.example
new file mode 100644
index 0000000..1b8b3fb
--- /dev/null
+++ b/custom/doc/citation.html.ep.example
@@ -0,0 +1,15 @@
+%# Adds a references page at /doc/citation. Copy this file to
+%# doc/citation.html.ep (without the .example suffix).
+%#
+%# The page is assembled from three parts: the references for your corpus,
+%# plus the KorAP and annotation-tool references that Kalamar ships and you
+%# normally keep unchanged. Pass your own corpus references as shown below;
+%# see partial/citation/corpus.html.ep.example.
+%#
+%# Kalamar's documentation menu has no entry for this page, so link it from
+%# your corpus page (see doc/corpus.html.ep.example).
+% layout 'main', title => 'KorAP: ' . loc('Nav_citation', 'References');
+
+%= page_title
+
+%= include 'partial/citation', corpus_citation => 'custom/partial/citation/corpus'
diff --git a/custom/doc/corpus.html.ep.example b/custom/doc/corpus.html.ep.example
new file mode 100644
index 0000000..379ccf6
--- /dev/null
+++ b/custom/doc/corpus.html.ep.example
@@ -0,0 +1,18 @@
+%# Describes the corpus this KorAP instance serves. Copy this file to
+%# doc/corpus.html.ep (without the .example suffix) and edit it; it then
+%# replaces Kalamar's placeholder page behind the "Corpus" menu entry.
+%# Lines starting with %# are comments and never appear in the page.
+% layout 'main', title => 'KorAP: ' . loc('Nav_corpus');
+
+%= page_title
+
+<section>
+ <p>
+ This KorAP instance serves the <strong>Example Corpus</strong>, a
+ collection of ... texts with ... million tokens, compiled by ... .
+ </p>
+ <p>
+ The texts are annotated with ... . Please refer to the
+ <a href="citation">references</a> when citing the corpus.
+ </p>
+</section>