i:0m to support local file

This commit is contained in:
James Feng Cao 2022-11-08 11:06:46 +08:00
parent ec4d107f65
commit 8e7b56a157
9 changed files with 112 additions and 24 deletions

View file

@ -5,7 +5,17 @@
<link>/en/_posts/</link> <link>/en/_posts/</link>
<description>Recent content in _posts on uweb browser</description> <description>Recent content in _posts on uweb browser</description>
<generator>Hugo -- gohugo.io</generator> <generator>Hugo -- gohugo.io</generator>
<lastBuildDate>Thu, 20 Oct 2022 00:00:00 +0000</lastBuildDate><atom:link href="/en/_posts/index.xml" rel="self" type="application/rss+xml" /> <lastBuildDate>Sun, 30 Oct 2022 00:00:00 +0000</lastBuildDate><atom:link href="/en/_posts/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Make any url as website</title>
<link>/en/url2site/</link>
<pubDate>Sun, 30 Oct 2022 00:00:00 +0000</pubDate>
<guid>/en/url2site/</guid>
<description>The uweb internal link &amp;quot;i:0m&amp;quot; make any url such as download or indirect link visitable as a website. The test mirrors in the uweb manual are examples using the following tricks:
&amp;quot;i:0m04:[url]&amp;quot;: to treat the [url] content as html with bookmarklet. &amp;quot;i:0mi:5h:[url]&amp;quot;: to treat the [url] content as html (for download or no-script links etc.) &amp;quot;i:0mi:5h?[postfix]::[url]&amp;quot;: auto append query postfix to url to retrieve content. &amp;quot;i:0mi:5h/[regex]/[replacement]::[url]&amp;quot;: use the result of regular expression replacement to retrieve the content.</description>
</item>
<item> <item>
<title>Offline resources</title> <title>Offline resources</title>
<link>/en/offlinecache/</link> <link>/en/offlinecache/</link>

View file

@ -49,7 +49,7 @@
<p><a href="https://releases.pagure.org/uweb/">pagure</a></p> <p><a href="https://releases.pagure.org/uweb/">pagure</a></p>
<p><a href="https://sourceforge.net/projects/uwebbrowser/files/v1/">sourceforge</a></p> <p><a href="https://sourceforge.net/projects/uwebbrowser/files/v1/">sourceforge</a></p>
<h4 id="change-logs">Change logs</h4> <h4 id="change-logs">Change logs</h4>
<p>940: url pre-processing with local html (<a href="../links/index.html">&quot;i:0m/..../xxx.html:url&quot;</a>)</p> <p>940: <a href="../url2site/index.html">Any url as website</a> with local html processing (<a href="../links/index.html">&quot;i:0m/..../xxx.html:url&quot;</a>)</p>
<p>935:</p> <p>935:</p>
<ul> <ul>
<li>Pipe support: command line output to uweb tabs.</li> <li>Pipe support: command line output to uweb tabs.</li>

View file

@ -84,6 +84,12 @@
<li class="post">
<a href="url2site/index.html">
<span>Make any url as website</span>
</a>
</li>
<li class="post"> <li class="post">
<a href="offlinecache/index.html"> <a href="offlinecache/index.html">
<span>Offline resources</span> <span>Offline resources</span>

View file

@ -5,7 +5,17 @@
<link>/en/</link> <link>/en/</link>
<description>Recent content on uweb browser</description> <description>Recent content on uweb browser</description>
<generator>Hugo -- gohugo.io</generator> <generator>Hugo -- gohugo.io</generator>
<lastBuildDate>Thu, 20 Oct 2022 00:00:00 +0000</lastBuildDate><atom:link href="/en/index.xml" rel="self" type="application/rss+xml" /> <lastBuildDate>Sun, 30 Oct 2022 00:00:00 +0000</lastBuildDate><atom:link href="/en/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Make any url as website</title>
<link>/en/url2site/</link>
<pubDate>Sun, 30 Oct 2022 00:00:00 +0000</pubDate>
<guid>/en/url2site/</guid>
<description>The uweb internal link &amp;quot;i:0m&amp;quot; make any url such as download or indirect link visitable as a website. The test mirrors in the uweb manual are examples using the following tricks:
&amp;quot;i:0m04:[url]&amp;quot;: to treat the [url] content as html with bookmarklet. &amp;quot;i:0mi:5h:[url]&amp;quot;: to treat the [url] content as html (for download or no-script links etc.) &amp;quot;i:0mi:5h?[postfix]::[url]&amp;quot;: auto append query postfix to url to retrieve content. &amp;quot;i:0mi:5h/[regex]/[replacement]::[url]&amp;quot;: use the result of regular expression replacement to retrieve the content.</description>
</item>
<item> <item>
<title>Offline resources</title> <title>Offline resources</title>
<link>/en/offlinecache/</link> <link>/en/offlinecache/</link>
@ -49,11 +59,11 @@ uweb, termux &amp;amp; history versions
github github
pagure pagure
sourceforge sourceforge
Change logs 940: url pre-processing with local html (&amp;quot;i:0m/..../xxx.html:url&amp;quot;) Change logs 940: Any url as website with local html processing (&amp;quot;i:0m/..../xxx.html:url&amp;quot;)
935: 935:
Pipe support: command line output to uweb tabs. 934: Pipe support: command line output to uweb tabs. 934:
Serverless local sites: PWA-kind web extension (chrome .crx &amp;amp; firefox .xpi) support. PWAs and web extensions to be used as search engines, ex. kiwix zim as search engines. 925: Serverless local sites: PWA-kind web extension (chrome .crx &amp;amp; firefox .xpi) support. PWAs and web extensions to be used as search engines, ex. kiwix zim as search engines. 925:
remote js: wait for remote js to be fully loaded. html5 apps are as powerful as native ones now and still secure.</description> remote js: wait for remote js to be fully loaded.</description>
</item> </item>
<item> <item>

View file

@ -103,7 +103,7 @@ Socks proxy</p>
Extract remote content (tar/tgz/zip) under the folder [path]. If [path] ends with &quot;/&quot;, then put unzipped file under the folder &quot;[path]/[file name stem]&quot; (for zipped files only, not for tar/tgz).</p> Extract remote content (tar/tgz/zip) under the folder [path]. If [path] ends with &quot;/&quot;, then put unzipped file under the folder &quot;[path]/[file name stem]&quot; (for zipped files only, not for tar/tgz).</p>
</li> </li>
<li> <li>
<p>i:0m[bookmarklet index|prefix|?postfix|/...localhtml|c[cssFlag]]:[url]<br> <p>i:0m[bookmarklet index|prefix|?postfix|/.../localfile|c[cssFlag]]:[url]<br>
Visiting url and execute the uweb browser internal bookmarklet that keeps valid for all urls under the path of [url].</p> Visiting url and execute the uweb browser internal bookmarklet that keeps valid for all urls under the path of [url].</p>
</li> </li>
<li></li> <li></li>
@ -117,7 +117,7 @@ Visiting url and execute the uweb browser internal bookmarklet that keeps valid
<p>[?postfix]: the real visited url is &quot;[url]+[?postfix]&quot;.</p> <p>[?postfix]: the real visited url is &quot;[url]+[?postfix]&quot;.</p>
</li> </li>
<li> <li>
<p>[/...localhtml]: load the local html file that processes [url]. The first character of the local html file must be &quot;&lt;&quot;.</p> <p>[/.../localfile]: load the local html/js file that processes [url]. The first character of the local html file must be &quot;&lt;&quot;.</p>
</li> </li>
<li> <li>
<p>All other cases will be treated as [prefix], the real visited url is &quot;[prefix]+[url]&quot;.</p> <p>All other cases will be treated as [prefix], the real visited url is &quot;[prefix]+[url]&quot;.</p>

View file

@ -3,7 +3,7 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml"> xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url> <url>
<loc>/en/_posts/</loc> <loc>/en/_posts/</loc>
<lastmod>2022-10-20T00:00:00+00:00</lastmod> <lastmod>2022-10-30T00:00:00+00:00</lastmod>
<xhtml:link <xhtml:link
rel="alternate" rel="alternate"
hreflang="zh" hreflang="zh"
@ -14,6 +14,22 @@
hreflang="en" hreflang="en"
href="/en/_posts/" href="/en/_posts/"
/> />
</url><url>
<loc>/en/url2site/</loc>
<lastmod>2022-10-30T00:00:00+00:00</lastmod>
</url><url>
<loc>/en/</loc>
<lastmod>2022-10-30T00:00:00+00:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"
href="/zh/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
href="/en/"
/>
</url><url> </url><url>
<loc>/en/offlinecache/</loc> <loc>/en/offlinecache/</loc>
<lastmod>2022-10-20T00:00:00+00:00</lastmod> <lastmod>2022-10-20T00:00:00+00:00</lastmod>
@ -27,19 +43,6 @@
hreflang="en" hreflang="en"
href="/en/offlinecache/" href="/en/offlinecache/"
/> />
</url><url>
<loc>/en/</loc>
<lastmod>2022-10-20T00:00:00+00:00</lastmod>
<xhtml:link
rel="alternate"
hreflang="zh"
href="/zh/"
/>
<xhtml:link
rel="alternate"
hreflang="en"
href="/en/"
/>
</url><url> </url><url>
<loc>/en/html5/</loc> <loc>/en/html5/</loc>
<lastmod>2022-10-02T00:00:00+00:00</lastmod> <lastmod>2022-10-02T00:00:00+00:00</lastmod>

View file

@ -17,11 +17,11 @@ uweb, termux &amp;amp; history versions
github github
pagure pagure
sourceforge sourceforge
Change logs 940: url pre-processing with local html (&amp;quot;i:0m/..../xxx.html:url&amp;quot;) Change logs 940: Any url as website with local html processing (&amp;quot;i:0m/..../xxx.html:url&amp;quot;)
935: 935:
Pipe support: command line output to uweb tabs. 934: Pipe support: command line output to uweb tabs. 934:
Serverless local sites: PWA-kind web extension (chrome .crx &amp;amp; firefox .xpi) support. PWAs and web extensions to be used as search engines, ex. kiwix zim as search engines. 925: Serverless local sites: PWA-kind web extension (chrome .crx &amp;amp; firefox .xpi) support. PWAs and web extensions to be used as search engines, ex. kiwix zim as search engines. 925:
remote js: wait for remote js to be fully loaded. html5 apps are as powerful as native ones now and still secure.</description> remote js: wait for remote js to be fully loaded.</description>
</item> </item>
<item> <item>

59
en/url2site/index.html Normal file
View file

@ -0,0 +1,59 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="../style.css" type="text/css" />
<title>Make any url as website</title>
<script type="text/javascript">
function findLang(){
let href = location.href;
for(let i=href.length-1;i>0;i--){
if('/'==href.charAt(i) && '/'==href.charAt(i-3))
return i;
}
return 0;
}
function nav2(page){
let i = findLang();
location.href = location.href.substring(0,i+1)+page;
}
function nav2Lang(lang){
let i = findLang();
let href = location.href;
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
}
</script>
</head>
<body>
<header class='header'>
<a class="logo" href="javascript:void(0)" onclick="return nav2('index.html')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html')">Tags</a>
<nav>
</nav>
</header>
<br />
<div class="container">
<h1 class="title">Make any url as website
<br>
<span class="subtitle"></span>
</h1>
<ul class="tags">
</ul>
<p>The <a href="../index.html">uweb</a> internal link &quot;<a href="../links/index.html">i:0m</a>&quot; make any url such as download or indirect link visitable as a website. The test mirrors in the uweb manual are examples using the following tricks:</p>
<ul>
<li>&quot;i:0m04:[url]&quot;: to treat the [url] content as html with bookmarklet.</li>
<li>&quot;i:0mi:5h:[url]&quot;: to treat the [url] content as html (for download or no-script links etc.)</li>
<li>&quot;i:0mi:5h?[postfix]::[url]&quot;: auto append query postfix to url to retrieve content.</li>
<li>&quot;i:0mi:5h/[regex]/[replacement]::[url]&quot;: use the result of regular expression replacement to retrieve the content.</li>
</ul>
<p>For more complicated links such as cloud storage shared links, which needs user gestures to reach temporary generated content link, use<br>
&quot;i:0m/.../[local.html]:[url]&quot;, where the local file &quot;/.../[local.html]&quot; processes &quot;[url]&quot; as needed.</p>
</div>
</body>
</html>

View file

@ -4,7 +4,7 @@
<sitemap> <sitemap>
<loc>en/sitemap.xml</loc> <loc>en/sitemap.xml</loc>
<lastmod>2022-10-20T00:00:00+00:00</lastmod> <lastmod>2022-10-30T00:00:00+00:00</lastmod>
</sitemap> </sitemap>