Added 'realm' parameter to 'embedded_link_to' helper

Change-Id: I02a2a52e350176361c8420a05cfaa254b8fe2795
diff --git a/templates/doc/ql/annis.html.ep b/templates/doc/ql/annis.html.ep
index 24a2145..b1b17dc 100644
--- a/templates/doc/ql/annis.html.ep
+++ b/templates/doc/ql/annis.html.ep
@@ -9,7 +9,7 @@
   pairs, relations). The concept of AQL is similar to searching node elements and edges
   between them, where a node element can be a token or an attribute-value pair.</p>
 
-<p>KorAP supports the following keywords by using the <%= embedded_link_to 'default foundries', 'data', 'annotation' %>: </p>
+<p>KorAP supports the following keywords by using the <%= embedded_link_to 'doc', 'default foundries', 'data', 'annotation' %>: </p>
 <dl>
   <dt><code>node</code></dt>
   <dd>a node element</dd>
diff --git a/templates/doc/ql/cosmas-2.html.ep b/templates/doc/ql/cosmas-2.html.ep
index d320eb3..f0be87f 100644
--- a/templates/doc/ql/cosmas-2.html.ep
+++ b/templates/doc/ql/cosmas-2.html.ep
@@ -30,7 +30,7 @@
 
   <h4>Lemma Operator</h4>
   
-  <p>Instead of searching for the surface form of a word, a lemma (as annotated by the <%= embedded_link_to 'default foundry', 'data', 'annotation' %>) can be requested by prepending the term with the <code>&amp;</code> operator. The form of the lemma is dependent on the annotation.</p>
+  <p>Instead of searching for the surface form of a word, a lemma (as annotated by the <%= embedded_link_to 'doc', 'default foundry', 'data', 'annotation' %>) can be requested by prepending the term with the <code>&amp;</code> operator. The form of the lemma is dependent on the annotation.</p>
   <%= doc_query cosmas2 => '&laufen' %>
 
   <h4>Case Insensitivity Operator</h4>
@@ -40,11 +40,11 @@
 
   <h4>Regular Expression Operator</h4>
 
-  <p>By using the <code>#REG(...)</code> operator, query terms can be formulated using <%= embedded_link_to 'regular expressions', 'ql', 'regexp' %>.</p>
+  <p>By using the <code>#REG(...)</code> operator, query terms can be formulated using <%= embedded_link_to 'doc', 'regular expressions', 'ql', 'regexp' %>.</p>
   
 
   <blockquote class="bug">
-    <p>Regular expressions in COSMAS II are not yet properly implemented in KorAP. If you want to use regular expressions, please refer to <%= embedded_link_to 'Poliqarp', 'ql', 'poliqarp-plus#regexp' %>.</p>
+    <p>Regular expressions in COSMAS II are not yet properly implemented in KorAP. If you want to use regular expressions, please refer to <%= embedded_link_to 'doc', 'Poliqarp', 'ql', 'poliqarp-plus#regexp' %>.</p>
   </blockquote>
 
 </section>
@@ -84,7 +84,7 @@
 %#    <p>Currently, intervals are interpreted as MIN:MAX only, while COSMAS 2 defines intervals as being MAX:MIN, while taking the smaller number as being the minimum value of the interval and the greater number as being the maximum value of the interval. <%= ext_link_to 'KorAP will adopt the behaviour of COSMAS II in the near future', "https://github.com/KorAP/Koral/issues/67" %>.</p>
 %#  </blockquote>
   
-  <p>Distance operators rely on the <%= embedded_link_to 'default foundry', 'data', 'annotation' %> annotation for document structures.</p>
+  <p>Distance operators rely on the <%= embedded_link_to 'doc', 'default foundry', 'data', 'annotation' %> annotation for document structures.</p>
 
   <h4>Word Distance Operator</h4>
 
@@ -105,7 +105,7 @@
   <h4>Sentence Distance Operator</h4>
 
   <p>The sentence distance operator <code>s</code> defines how many sentences are allowed or are not allowed in-between two search operands.</p>
-  <p>The sentence distance relies on the <%= embedded_link_to 'default foundry', 'data', 'annotation' %> annotation for document structures.</p>
+  <p>The sentence distance relies on the <%= embedded_link_to 'doc', 'default foundry', 'data', 'annotation' %> annotation for document structures.</p>
 
   <p>Search for two operands occuring in the same or a following sentence in arbitrary order:</p>
   %= doc_query cosmas2 => 'offen /s1 Geschäft'
@@ -119,7 +119,7 @@
   <h4>Paragraph Distance Operator</h4>
 
   <p>The paragraph distance operator <code>p</code> defines how many paragraphs are allowed or are not allowed in-between two search operands.</p>
-  <p>The paragraph distance relies on the <%= embedded_link_to 'default foundry', 'data', 'annotation' %> annotation for document structures.</p>
+  <p>The paragraph distance relies on the <%= embedded_link_to 'doc', 'default foundry', 'data', 'annotation' %> annotation for document structures.</p>
 
   <p>Search for two operands occuring in the same or a following paragraph in arbitrary order:</p>
   %= doc_query cosmas2 => 'offen /p1 Geschäft'
diff --git a/templates/doc/ql/fcsql.html.ep b/templates/doc/ql/fcsql.html.ep
index 843438e..735ce8b 100644
--- a/templates/doc/ql/fcsql.html.ep
+++ b/templates/doc/ql/fcsql.html.ep
@@ -6,7 +6,7 @@
   <%= ext_link_to 'Clarin Federated Content Search (FCS)', "https://www.clarin.eu/content/federated-content-search-clarin-fcs" %>,
   that allows searching through annotated data.
 Accordingly, FCS-QL is primarily intended to represent queries involving annotation layers
-such as part-of-speech and lemma. FCS-QL grammar is fairly similar to <%= embedded_link_to 'Poliqarp', 'ql', 'poliqarp-plus' %> since it was
+such as part-of-speech and lemma. FCS-QL grammar is fairly similar to <%= embedded_link_to 'doc', 'Poliqarp', 'ql', 'poliqarp-plus' %> since it was
 built heavily based on Poliqarp/CQP.</p>
 
 <p>In FCS-QL, foundries are called qualifiers. A combination of a foundry and a layer is
@@ -43,7 +43,7 @@
   %= doc_query fcsql => '[text = "Semmel"]', cutoff => 1
   %= doc_query fcsql => '[text = "essen"/c]', cutoff => 1
 	
-	<p>Querying adverbs from the <%= embedded_link_to 'default foundry', 'data', 'annotation' %>.</p>
+	<p>Querying adverbs from the <%= embedded_link_to 'doc', 'default foundry', 'data', 'annotation' %>.</p>
   %= doc_query fcsql => '[pos="ADV"]', cutoff => 1
 	
 
@@ -72,7 +72,7 @@
 	
 
   <h4>Empty token</h4>
-	<p>Like in <%= embedded_link_to 'Poliqarp', 'ql', 'poliqarp-plus' %>, an empty token is signified by <code>[]</code>
+	<p>Like in <%= embedded_link_to 'doc', 'Poliqarp', 'ql', 'poliqarp-plus' %>, an empty token is signified by <code>[]</code>
     which means any token. Due to the
 	excessive number of results, empty token is not allowed to be used independently, but in
 	combination with other tokens, for instance in a sequence query.</p>
diff --git a/templates/doc/ql/poliqarp-plus.html.ep b/templates/doc/ql/poliqarp-plus.html.ep
index 6dabcbc..e97fbdd 100644
--- a/templates/doc/ql/poliqarp-plus.html.ep
+++ b/templates/doc/ql/poliqarp-plus.html.ep
@@ -24,7 +24,7 @@
 
   <h4 id="regexp">Regular Expressions</h4>
 
-  <p>Segments can also be queried using <%= embedded_link_to 'regular expressions', 'ql', 'regexp' %> - by surrounding the segment with double quotes.</p>
+  <p>Segments can also be queried using <%= embedded_link_to 'doc', 'regular expressions', 'ql', 'regexp' %> - by surrounding the segment with double quotes.</p>
 
   %= doc_query poliqarp => loc('Q_poliqarp_re', '** "r(u|a)n"'), cutoff => 1
 
@@ -70,12 +70,12 @@
 
   %= doc_query poliqarp => loc('Q_poliqarp_complexre', '** [orth="r(u|a)n"/xi]'), cutoff => 1
 
-  <p>Another special key is <code>base</code>, refering to the lemma annotation of the <%= embedded_link_to 'default foundry', 'data', 'annotation' %>.
+  <p>Another special key is <code>base</code>, refering to the lemma annotation of the <%= embedded_link_to 'doc', 'default foundry', 'data', 'annotation' %>.
     The following query finds all occurrences of segments annotated as a specified lemma by the default foundry.</p>
 
   %= doc_query poliqarp => loc('Q_poliqarp_complexlemma', '** [base=Tree]'), cutoff => 1
 
-  <p>The third special key is <code>pos</code>, refering to the part-of-speech annotation of the <%= embedded_link_to 'default foundry', 'data', 'annotation' %>.
+  <p>The third special key is <code>pos</code>, refering to the part-of-speech annotation of the <%= embedded_link_to 'doc', 'default foundry', 'data', 'annotation' %>.
     The following query finds all attributive adjectives:</p>
 
   %= doc_query poliqarp => loc('Q_poliqarp_complexpos', '** [pos=ADJA]'), cutoff => 1
@@ -97,7 +97,7 @@
 
   <blockquote class="warning">
     <p>Beware: Negated complex segments can't be searched as a single statement.
-      However, they work in case they are part of a <%= embedded_link_to 'sequence', 'ql', 'poliqarp-plus#syntagmatic-operators-sequence' %>.</p>
+      However, they work in case they are part of a <%= embedded_link_to 'doc', 'sequence', 'ql', 'poliqarp-plus#syntagmatic-operators-sequence' %>.</p>
   </blockquote>
 
   <h4 id="empty-segments">Empty Segments</h4>
@@ -106,11 +106,11 @@
 
   %= doc_query poliqarp => '[]', cutoff => 1
 
-  <p>Empty segments are useful to express distances of words by using <%= embedded_link_to 'repetitions', 'ql', 'poliqarp-plus#syntagmatic-operators-repetitions' %>.</p>
+  <p>Empty segments are useful to express distances of words by using <%= embedded_link_to 'doc', 'repetitions', 'ql', 'poliqarp-plus#syntagmatic-operators-repetitions' %>.</p>
 
   <blockquote class="warning">
     <p>Beware: Empty segments can't be searched as a single statement.
-      However, they work in case they are part of a <%= embedded_link_to 'sequence', 'ql', 'poliqarp-plus#syntagmatic-operators-sequence' %>.</p>
+      However, they work in case they are part of a <%= embedded_link_to 'doc', 'sequence', 'ql', 'poliqarp-plus#syntagmatic-operators-sequence' %>.</p>
   </blockquote>
 </section>
 
@@ -191,7 +191,7 @@
 
   <h4 id="syntagmatic-operators-repetitions">Repetition</h4>
 
-  <p>Repetitions in Poliqarp are realized as in <%= embedded_link_to 'regular expressions', 'ql', 'regexp' %>, by giving quantifieres in curly brackets.</p>
+  <p>Repetitions in Poliqarp are realized as in <%= embedded_link_to 'doc', 'regular expressions', 'ql', 'regexp' %>, by giving quantifieres in curly brackets.</p>
   <p>To search for a sequence of three occurrences of a defined string, you can formulate your query in any of the following ways - they will have the same results:</p>
 
   %= doc_query poliqarp => loc('Q_poliqarp_repmanual', '** the the the'), cutoff => 1
@@ -231,7 +231,7 @@
     <p>Keep in mind that optionality may be somehow <i>inherited</i>, for example an entire query becomes optional as soon as one segment of an alternation is optional.</p>
   </blockquote>
 
-  <p>Repetition can also be used to express distances between segments by using <%= embedded_link_to 'empty segments', 'ql', 'poliqarp-plus#empty-segments' %>.</p>
+  <p>Repetition can also be used to express distances between segments by using <%= embedded_link_to 'doc', 'empty segments', 'ql', 'poliqarp-plus#empty-segments' %>.</p>
 
   %= doc_query poliqarp => loc('Q_poliqarp_seqdistance1', '** [base=the][][base=Tree]'), cutoff => 1
   %= doc_query poliqarp => loc('Q_poliqarp_seqdistance2', '** [base=the][]{2}[base=Tree]'), cutoff => 1
@@ -246,7 +246,7 @@
     
   <h4>Position</h4>
 
-  <p>Sequences as shown above can all be nested in further complex queries and treated as subqueries (see <%= embedded_link_to 'class operators', 'ql', 'poliqarp-plus#class-operators' %> on how to later access these subqueries directly).</p>
+  <p>Sequences as shown above can all be nested in further complex queries and treated as subqueries (see <%= embedded_link_to 'doc', 'class operators', 'ql', 'poliqarp-plus#class-operators' %> on how to later access these subqueries directly).</p>
   <p>Positional operators compare two matches of subqueries and will match, in case a certain condition regarding the position of both is true.</p>
   <p>The <code>contains()</code> operation will match, when a second subquery matches inside the span of a first subquery.</p>