You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by gi...@apache.org on 2020/09/18 21:43:06 UTC

[sling-site] branch asf-site updated: Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/28/

This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new ecf7eb8  Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/28/
ecf7eb8 is described below

commit ecf7eb8ac9880f9d3b71147ddf1d5ced9419a1d1
Author: jenkins <bu...@apache.org>
AuthorDate: Fri Sep 18 21:43:01 2020 +0000

    Automatic website deployment from https://ci-builds.apache.org/job/Sling/job/modules/job/sling-site/job/master/28/
---
 documentation/bundles/scripting.html | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/documentation/bundles/scripting.html b/documentation/bundles/scripting.html
index 07ce69e..a7d57b7 100644
--- a/documentation/bundles/scripting.html
+++ b/documentation/bundles/scripting.html
@@ -144,6 +144,30 @@
 <li>XProc</li>
 </ul>
 <p>Code for really old modules might be found in the <a href="https://svn.apache.org/repos/asf/sling/attic">svn attic</a>.</p>
+<h3><a href="#mapping-script-extensions-to-engines" id="mapping-script-extensions-to-engines">Mapping script extensions to engines</a></h3>
+<p>Since version <code>2.0.60</code> <a href="https://github.com/apache/sling-org-apache-sling-scripting-core">Scripting Core</a> supports the mapping of extensions to engines in content (<a href="https://issues.apache.org/jira/browse/SLING-4330">SLING-4330</a>).</p>
+<p>This is required when registering more than one script engine for a single script extension (e.g. using HTL for <em>vendor-related</em> scripts in <code>/libs</code> and Thymeleaf for <em>project-related</em> scripts in <code>/apps</code>, both using extension <code>html</code>).</p>
+<p>It works by adding a <code>sling:scripting</code> property to the script resource or a resource in the hierarchy above the script (e.g. project or parent folder).</p>
+<p>The mapping consists of a <em>key</em> which is the <em>script extension</em> and a <em>value</em> which itself could consist of four values separated by colon to identify the script engine:</p>
+<ol>
+<li>language name (required)</li>
+<li>language version (optional)</li>
+<li>engine name (not used yet)</li>
+<li>engine version (not used yet)</li>
+</ol>
+<p>The <code>sling:scripting</code> property supports multiple mappings for different extensions (e.g. <code>html</code> and <code>js</code>).</p>
+<p>In case there is more than one script engine for a script extension registered and no mapping is found the script engine with higher service ranking gets used for rendering.</p>
+<h4><a href="#sample-mappings" id="sample-mappings">Sample mappings</a></h4>
+<p>Mapping <code>html</code> to HTL 1.4:</p>
+<pre><code>&quot;sling:scripting&quot;: [
+  &quot;html=The HTL Templating Language:1.4&quot;
+]
+</code></pre>
+<p>Mapping <code>html</code> to Thymeleaf 3.0:</p>
+<pre><code>&quot;sling:scripting&quot;: [
+  &quot;html=Thymeleaf:3.0&quot;
+]
+</code></pre>
 <h2><a href="#scripting-variables" id="scripting-variables">Scripting variables</a></h2>
 <p>See also <a href="https://cwiki.apache.org/confluence/display/SLING/Scripting+variables">Scripting variables</a> and <a href="https://cwiki.apache.org/confluence/display/SLING/Adding+New+Scripting+Variables">Adding New Scripting Variables</a>.</p>
 </section></div></div>                            
@@ -153,7 +177,7 @@
             </div><footer class="footer">
                 <div class="content has-text-centered is-small">
 <div class="revisionInfo">
-                        Last modified by <span class="author">Bertrand Delacretaz</span> on <span class="comment">Tue Aug 25 12:04:19 2020 +0200</span>
+                        Last modified by <span class="author">Oliver Lietz</span> on <span class="comment">Fri Sep 18 23:21:02 2020 +0200</span>
                     </div>                    <p>
                         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
                     </p><p>