Skip to content

Commit d5abb6a

Browse files
committed
Revise
1 parent 5d3dbec commit d5abb6a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sitegen/x.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default (doc: HTMLDocument) => {
2020
p("You can also import individual utility functions you're going to use:"),
2121
Js(`import { <functions you want to use> } from "vanjs-ext"`),
2222
H3("Via a Script Tag"),
23-
p("Alternatively, you can import ", VanX(), " from CDN via a ", InlineJs(`<script type="text/javascript">`), " tag:"),
23+
p("Alternatively, you can import ", VanX(), " from CDN via a ", InlineJs(`<script type="text/javascript">`), " tag:"),
2424
Html(`<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vanjs-ext@${version}/dist/van-x.nomodule.min.js"></script>`),
2525
p(Symbol(`https://cdn.jsdelivr.net/npm/vanjs-ext@${version}/dist/van-x.nomodule.js`)," can be used for the non-minified version."),
2626
p("Note that: ", VanJS(), " needs to be ", Link("imported", "/start"), " via a ", InlineJs(`<script type="text/javascript">`), " tag for ", VanX, " to work properly."),

x.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h1 class="w3-padding-16 w3-xxxlarge">
5050
<!-- !PAGE CONTENT! -->
5151
<div class="w3-main" style="margin-left:300px;">
5252
<div id="page">
53-
<div id="content"><h1 class="w3-xxlarge"><strong>VanX: The 1.0 kB Official VanJS Extension</strong></h1><p><b>VanX</b> is the official extension of <b>VanJS</b>, which provides handy utility functions. <b>VanX</b> makes <b>VanJS</b> more ergonomic for certain use cases and its developer experience closer to other popular UI frameworks. Like <b>VanJS</b>, <b>VanX</b> is also ultra-lightweight, with just 1.0kB in the gzipped minified bundle.</p><h2 class="w3-xxlarge w3-text-red" id="installation"><a class="self-link" href="#installation">Installation</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><h3 class="w3-large w3-text-red" id="via-npm"><a class="self-link" href="#via-npm">Via NPM</a></h3><p><b>VanX</b> is published as NPM package <a href="https://www.npmjs.com/package/vanjs-ext" class="w3-hover-opacity">vanjs-ext</a>. Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-ext</code></pre><p>Add this line to your script to import the package:</p><pre><code class="language-js">import * as vanX from "vanjs-ext"</code></pre><p>You can also import individual utility functions you're going to use:</p><pre><code class="language-js">import { &lt;functions you want to use&gt; } from "vanjs-ext"</code></pre><h3 class="w3-large w3-text-red" id="via-a-script-tag"><a class="self-link" href="#via-a-script-tag">Via a Script Tag</a></h3><p>Alternatively, you can import <b>VanX</b> from CDN via a <code class="language-js">&lt;script type="text/javascript"&gt;</code>&nbsp;tag:</p><pre><code class="language-html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.min.js"&gt;&lt;/script&gt;</code></pre><p><code class="symbol">https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.js</code> can be used for the non-minified version.</p><p>Note that: <b>VanJS</b> needs to be <a href="/start" class="w3-hover-opacity">imported</a> via a <code class="language-js">&lt;script type="text/javascript"&gt;</code> tag for <b>VanX</b> to work properly.</p><h3 class="w3-large w3-text-red" id="typescript-support-for-script-tag-integration"><a class="self-link" href="#typescript-support-for-script-tag-integration">TypeScript Support for Script Tag Integration</a></h3><p>To get TypeScript support for <code class="language-html">&lt;script&gt;</code> tag integration, download <code class="symbol"><a href="/code/van-x-0.2.5.d.ts" download="van-x-0.2.5.d.ts" style="white-space: nowrap;" title="Download van-x-0.2.5.d.ts">van-x-0.2.5.d.ts</a></code> and add the following code at the top of your <code class="symbol">.ts</code> file:</p><pre><code class="language-ts">import type * as vanXType from "./van-x-0.2.5.d.ts"
53+
<div id="content"><h1 class="w3-xxlarge"><strong>VanX: The 1.0 kB Official VanJS Extension</strong></h1><p><b>VanX</b> is the official extension of <b>VanJS</b>, which provides handy utility functions. <b>VanX</b> makes <b>VanJS</b> more ergonomic for certain use cases and its developer experience closer to other popular UI frameworks. Like <b>VanJS</b>, <b>VanX</b> is also ultra-lightweight, with just 1.0kB in the gzipped minified bundle.</p><h2 class="w3-xxlarge w3-text-red" id="installation"><a class="self-link" href="#installation">Installation</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><h3 class="w3-large w3-text-red" id="via-npm"><a class="self-link" href="#via-npm">Via NPM</a></h3><p><b>VanX</b> is published as NPM package <a href="https://www.npmjs.com/package/vanjs-ext" class="w3-hover-opacity">vanjs-ext</a>. Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-ext</code></pre><p>Add this line to your script to import the package:</p><pre><code class="language-js">import * as vanX from "vanjs-ext"</code></pre><p>You can also import individual utility functions you're going to use:</p><pre><code class="language-js">import { &lt;functions you want to use&gt; } from "vanjs-ext"</code></pre><h3 class="w3-large w3-text-red" id="via-a-script-tag"><a class="self-link" href="#via-a-script-tag">Via a Script Tag</a></h3><p>Alternatively, you can import <b>VanX</b> from CDN via a <code class="language-js">&lt;script type="text/javascript"&gt;</code> tag:</p><pre><code class="language-html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.min.js"&gt;&lt;/script&gt;</code></pre><p><code class="symbol">https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.js</code> can be used for the non-minified version.</p><p>Note that: <b>VanJS</b> needs to be <a href="/start" class="w3-hover-opacity">imported</a> via a <code class="language-js">&lt;script type="text/javascript"&gt;</code> tag for <b>VanX</b> to work properly.</p><h3 class="w3-large w3-text-red" id="typescript-support-for-script-tag-integration"><a class="self-link" href="#typescript-support-for-script-tag-integration">TypeScript Support for Script Tag Integration</a></h3><p>To get TypeScript support for <code class="language-html">&lt;script&gt;</code> tag integration, download <code class="symbol"><a href="/code/van-x-0.2.5.d.ts" download="van-x-0.2.5.d.ts" style="white-space: nowrap;" title="Download van-x-0.2.5.d.ts">van-x-0.2.5.d.ts</a></code> and add the following code at the top of your <code class="symbol">.ts</code> file:</p><pre><code class="language-ts">import type * as vanXType from "./van-x-0.2.5.d.ts"
5454

5555
declare const vanX: typeof vanXType
5656
</code></pre><h2 class="w3-xxlarge w3-text-red" id="reactive-object"><a class="self-link" href="#reactive-object"><code class="symbol">vanX.reactive</code>: Reactive Object to Hold Many Individual States</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><p><code class="symbol">vanX.reactive</code> provides an ergonomic way to define a single reactive object where each of its individual fields corresponds to an underlying <code class="symbol">State</code> object. For instance:</p><pre><code class="language-js">const obj = vanX.reactive({a: 1, b: 2})</code></pre><p>defines a reactive object with the following underlying state fields:</p><pre><code class="language-js">{a: van.state(1), b: van.state(2)}</code></pre><p>The reactive objects defined by <code class="symbol">vanX.reactive</code> can be deeply nested. For instance:</p><pre><code class="language-js">const obj = vanX.reactive({

x/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h1 class="w3-padding-16 w3-xxxlarge">
5050
<!-- !PAGE CONTENT! -->
5151
<div class="w3-main" style="margin-left:300px;">
5252
<div id="page">
53-
<div id="content"><h1 class="w3-xxlarge"><strong>VanX: The 1.0 kB Official VanJS Extension</strong></h1><p><b>VanX</b> is the official extension of <b>VanJS</b>, which provides handy utility functions. <b>VanX</b> makes <b>VanJS</b> more ergonomic for certain use cases and its developer experience closer to other popular UI frameworks. Like <b>VanJS</b>, <b>VanX</b> is also ultra-lightweight, with just 1.0kB in the gzipped minified bundle.</p><h2 class="w3-xxlarge w3-text-red" id="installation"><a class="self-link" href="#installation">Installation</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><h3 class="w3-large w3-text-red" id="via-npm"><a class="self-link" href="#via-npm">Via NPM</a></h3><p><b>VanX</b> is published as NPM package <a href="https://www.npmjs.com/package/vanjs-ext" class="w3-hover-opacity">vanjs-ext</a>. Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-ext</code></pre><p>Add this line to your script to import the package:</p><pre><code class="language-js">import * as vanX from "vanjs-ext"</code></pre><p>You can also import individual utility functions you're going to use:</p><pre><code class="language-js">import { &lt;functions you want to use&gt; } from "vanjs-ext"</code></pre><h3 class="w3-large w3-text-red" id="via-a-script-tag"><a class="self-link" href="#via-a-script-tag">Via a Script Tag</a></h3><p>Alternatively, you can import <b>VanX</b> from CDN via a <code class="language-js">&lt;script type="text/javascript"&gt;</code>&nbsp;tag:</p><pre><code class="language-html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.min.js"&gt;&lt;/script&gt;</code></pre><p><code class="symbol">https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.js</code> can be used for the non-minified version.</p><p>Note that: <b>VanJS</b> needs to be <a href="/start" class="w3-hover-opacity">imported</a> via a <code class="language-js">&lt;script type="text/javascript"&gt;</code> tag for <b>VanX</b> to work properly.</p><h3 class="w3-large w3-text-red" id="typescript-support-for-script-tag-integration"><a class="self-link" href="#typescript-support-for-script-tag-integration">TypeScript Support for Script Tag Integration</a></h3><p>To get TypeScript support for <code class="language-html">&lt;script&gt;</code> tag integration, download <code class="symbol"><a href="/code/van-x-0.2.5.d.ts" download="van-x-0.2.5.d.ts" style="white-space: nowrap;" title="Download van-x-0.2.5.d.ts">van-x-0.2.5.d.ts</a></code> and add the following code at the top of your <code class="symbol">.ts</code> file:</p><pre><code class="language-ts">import type * as vanXType from "./van-x-0.2.5.d.ts"
53+
<div id="content"><h1 class="w3-xxlarge"><strong>VanX: The 1.0 kB Official VanJS Extension</strong></h1><p><b>VanX</b> is the official extension of <b>VanJS</b>, which provides handy utility functions. <b>VanX</b> makes <b>VanJS</b> more ergonomic for certain use cases and its developer experience closer to other popular UI frameworks. Like <b>VanJS</b>, <b>VanX</b> is also ultra-lightweight, with just 1.0kB in the gzipped minified bundle.</p><h2 class="w3-xxlarge w3-text-red" id="installation"><a class="self-link" href="#installation">Installation</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><h3 class="w3-large w3-text-red" id="via-npm"><a class="self-link" href="#via-npm">Via NPM</a></h3><p><b>VanX</b> is published as NPM package <a href="https://www.npmjs.com/package/vanjs-ext" class="w3-hover-opacity">vanjs-ext</a>. Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-ext</code></pre><p>Add this line to your script to import the package:</p><pre><code class="language-js">import * as vanX from "vanjs-ext"</code></pre><p>You can also import individual utility functions you're going to use:</p><pre><code class="language-js">import { &lt;functions you want to use&gt; } from "vanjs-ext"</code></pre><h3 class="w3-large w3-text-red" id="via-a-script-tag"><a class="self-link" href="#via-a-script-tag">Via a Script Tag</a></h3><p>Alternatively, you can import <b>VanX</b> from CDN via a <code class="language-js">&lt;script type="text/javascript"&gt;</code> tag:</p><pre><code class="language-html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.min.js"&gt;&lt;/script&gt;</code></pre><p><code class="symbol">https://cdn.jsdelivr.net/npm/[email protected]/dist/van-x.nomodule.js</code> can be used for the non-minified version.</p><p>Note that: <b>VanJS</b> needs to be <a href="/start" class="w3-hover-opacity">imported</a> via a <code class="language-js">&lt;script type="text/javascript"&gt;</code> tag for <b>VanX</b> to work properly.</p><h3 class="w3-large w3-text-red" id="typescript-support-for-script-tag-integration"><a class="self-link" href="#typescript-support-for-script-tag-integration">TypeScript Support for Script Tag Integration</a></h3><p>To get TypeScript support for <code class="language-html">&lt;script&gt;</code> tag integration, download <code class="symbol"><a href="/code/van-x-0.2.5.d.ts" download="van-x-0.2.5.d.ts" style="white-space: nowrap;" title="Download van-x-0.2.5.d.ts">van-x-0.2.5.d.ts</a></code> and add the following code at the top of your <code class="symbol">.ts</code> file:</p><pre><code class="language-ts">import type * as vanXType from "./van-x-0.2.5.d.ts"
5454

5555
declare const vanX: typeof vanXType
5656
</code></pre><h2 class="w3-xxlarge w3-text-red" id="reactive-object"><a class="self-link" href="#reactive-object"><code class="symbol">vanX.reactive</code>: Reactive Object to Hold Many Individual States</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><p><code class="symbol">vanX.reactive</code> provides an ergonomic way to define a single reactive object where each of its individual fields corresponds to an underlying <code class="symbol">State</code> object. For instance:</p><pre><code class="language-js">const obj = vanX.reactive({a: 1, b: 2})</code></pre><p>defines a reactive object with the following underlying state fields:</p><pre><code class="language-js">{a: van.state(1), b: van.state(2)}</code></pre><p>The reactive objects defined by <code class="symbol">vanX.reactive</code> can be deeply nested. For instance:</p><pre><code class="language-js">const obj = vanX.reactive({

0 commit comments

Comments
 (0)