preprocessing before rendering with siteextra

This commit is contained in:
James Feng Cao 2023-01-28 09:41:12 +08:00
parent 349e7e629d
commit 612af3a880
20 changed files with 162 additions and 144 deletions

View file

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="../style.css" type="text/css" />
<title>Javascript and CSS for domains</title>
<title>JS/CSS/HTML/preprocessing for domains</title>
<script type="text/javascript">
function findLang(){
let href = location.href;
@ -40,7 +40,7 @@
<br />
<div class="container">
<h1 class="title">Javascript and CSS for domains
<h1 class="title">JS/CSS/HTML/preprocessing for domains
<br>
<span class="subtitle"></span>
</h1>
@ -65,14 +65,14 @@
<li>&quot;[domain root].js&quot; is loaded at the earlieat time.</li>
<li>Long press the button &quot;settings&quot;, check the option &quot;Apply user styles&quot;.</li>
</ul>
<p>If file &quot;default.css&quot; exists, the style will be applied to all sites without matching [domain root].css.</p>
<h3 id="extra-html">Extra html</h3>
<p>If file &quot;default.css&quot; exists, the style will be applied to all sites not matching [domain root].css.</p>
<h3 id="extra-html-and-preprocessing">Extra html and preprocessing</h3>
<ul>
<li>Need to be named as &quot;[domain].html&quot;. Notice: the file name here is &quot;[full domain]&quot; not &quot;[domain root]&quot;.</li>
<li>Need to be named as &quot;[domain].html&quot;. Notice: the file name stem here is &quot;[full domain]&quot; not &quot;[domain root]&quot;.</li>
<li>Under folder &quot;siteextra&quot;.</li>
<li>Long press the button &quot;settings&quot;, check the option &quot;Apply user extra&quot;.</li>
</ul>
<p>The extra html could be placed before the site source html (uweb uses an algorithm to merge the extra html with the site source html automatically). Ex. when the extra html ends with &quot;&lt;textarea&gt;&quot;, the site source html appears as the value of the textarea element, thus the extra html can further process the the site source html before rendering. For sites with textarea elements, &quot;&lt;div&gt;&lt;textarea&gt;&quot; could be used.</p>
<p>The extra html could be placed before the site source html (uweb merges the extra html with the site source html intelligently). Ex. when the extra html ends with &quot;&lt;textarea&gt;&quot;, the site source html appears as the value of the textarea element, thus the extra html can further process the the site source html before rendering. For sites with textarea elements, &quot;&lt;div&gt;&lt;textarea&gt;&quot; could be used.</p>
<p>&quot;sitejs/.js&quot;, &quot;sitecss/.css&quot;, &quot;sitecss/.js&quot; and &quot;siteextra/.html&quot; are applied to all non-http urls (file urls etc.).</p>
</div>