Skip to content

Commit 4471ed2

Browse files
committed
Update the README.md for the converter UI
1 parent fbacfbf commit 4471ed2

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

converter-lib.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h1 class="w3-padding-16 w3-xxxlarge">
4242
<!-- !PAGE CONTENT! -->
4343
<div class="w3-main" style="margin-left:300px;">
4444
<div id="page">
45-
<div id="content"><h1 class="w3-xxlarge">MD and HTML to VanJS Code Converter</h1><p>This is a library that can convert any MD or HTML snippet into valid <strong>VanJS</strong> code. The UI version of the code converter is <a href="https://vanjs.org/convert" class="w3-hover-opacity">here</a>.</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"><p>The library is published as NPM package <a href="https://www.npmjs.com/package/vanjs-converter" class="w3-hover-opacity">vanjs-converter</a>.</p><p>Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-converter
45+
<div id="content"><h1 class="w3-xxlarge">HTML and MD to VanJS Code Converter</h1><p>This is a library that can convert any MD or HTML snippet into valid <strong>VanJS</strong> code. The UI version of the code converter is <a href="https://vanjs.org/convert" class="w3-hover-opacity">here</a>.</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"><p>The library is published as NPM package <a href="https://www.npmjs.com/package/vanjs-converter" class="w3-hover-opacity">vanjs-converter</a>.</p><p>Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-converter
4646
</code></pre><p>To use the NPM package, add this line to your script:</p><pre><code class="language-js">import { htmlToVanCode, mdToVanCode } from "vanjs-converter"
4747
</code></pre><h2 class="w3-xxlarge w3-text-red" id="htmltovancode-convert-html-snippet-to-vanjs-code"><a class="self-link" href="#htmltovancode-convert-html-snippet-to-vanjs-code"><code class="symbol">htmlToVanCode</code>: Convert HTML snippet to VanJS Code</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><h3 class="w3-large w3-text-red" id="signature"><a class="self-link" href="#signature">Signature</a></h3><pre><code class="language-js">htmlToVanCode(&lt;HTML string&gt;, &lt;options&gt;) =&gt; {code: &lt;code&gt;, tags: &lt;tags&gt;, components: &lt;components&gt;}
4848
</code></pre><h3 class="w3-large w3-text-red" id="example"><a class="self-link" href="#example">Example</a></h3><pre><code class="language-js">htmlToVanCode('&lt;div&gt;&lt;p&gt;👋Hello&lt;/p&gt;&lt;ul&gt;&lt;li&gt;🗺️World&lt;/li&gt;&lt;li&gt;&lt;a href="https://vanjs.org/"&gt;🍦VanJS&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;', {indent: 4})

converter-lib/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h1 class="w3-padding-16 w3-xxxlarge">
4242
<!-- !PAGE CONTENT! -->
4343
<div class="w3-main" style="margin-left:300px;">
4444
<div id="page">
45-
<div id="content"><h1 class="w3-xxlarge">MD and HTML to VanJS Code Converter</h1><p>This is a library that can convert any MD or HTML snippet into valid <strong>VanJS</strong> code. The UI version of the code converter is <a href="https://vanjs.org/convert" class="w3-hover-opacity">here</a>.</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"><p>The library is published as NPM package <a href="https://www.npmjs.com/package/vanjs-converter" class="w3-hover-opacity">vanjs-converter</a>.</p><p>Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-converter
45+
<div id="content"><h1 class="w3-xxlarge">HTML and MD to VanJS Code Converter</h1><p>This is a library that can convert any MD or HTML snippet into valid <strong>VanJS</strong> code. The UI version of the code converter is <a href="https://vanjs.org/convert" class="w3-hover-opacity">here</a>.</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"><p>The library is published as NPM package <a href="https://www.npmjs.com/package/vanjs-converter" class="w3-hover-opacity">vanjs-converter</a>.</p><p>Run the following command to install the package:</p><pre><code class="language-shell">npm install vanjs-converter
4646
</code></pre><p>To use the NPM package, add this line to your script:</p><pre><code class="language-js">import { htmlToVanCode, mdToVanCode } from "vanjs-converter"
4747
</code></pre><h2 class="w3-xxlarge w3-text-red" id="htmltovancode-convert-html-snippet-to-vanjs-code"><a class="self-link" href="#htmltovancode-convert-html-snippet-to-vanjs-code"><code class="symbol">htmlToVanCode</code>: Convert HTML snippet to VanJS Code</a></h2><hr style="width:50px;border:5px solid red" class="w3-round"><h3 class="w3-large w3-text-red" id="signature"><a class="self-link" href="#signature">Signature</a></h3><pre><code class="language-js">htmlToVanCode(&lt;HTML string&gt;, &lt;options&gt;) =&gt; {code: &lt;code&gt;, tags: &lt;tags&gt;, components: &lt;components&gt;}
4848
</code></pre><h3 class="w3-large w3-text-red" id="example"><a class="self-link" href="#example">Example</a></h3><pre><code class="language-js">htmlToVanCode('&lt;div&gt;&lt;p&gt;👋Hello&lt;/p&gt;&lt;ul&gt;&lt;li&gt;🗺️World&lt;/li&gt;&lt;li&gt;&lt;a href="https://vanjs.org/"&gt;🍦VanJS&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;', {indent: 4})

converter-ui/README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# converter-ui
22

3-
To install dependencies:
3+
To build the 🍦VanJS code converter for development (`.js` file not minified):
44

5-
```bash
6-
bun install
5+
```shell
6+
bun dev
77
```
88

9-
To run:
9+
To build the 🍦VanJS code converter for production (`.js` file minified):
1010

11-
```bash
12-
bun run convert.ts
11+
```shell
12+
bun run build
1313
```
14-
15-
This project was created using `bun init` in bun v1.0.0. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

sitegen/convert-lib.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default (doc: HTMLDocument) => {
1010
const {H1, H2, H3, Link, Symbol} = common(doc)
1111
return div({id: "content"},
1212
H1(
13-
"MD and HTML to VanJS Code Converter",
13+
"HTML and MD to VanJS Code Converter",
1414
),
1515
p(
1616
"This is a library that can convert any MD or HTML snippet into valid ",

0 commit comments

Comments
 (0)