all repos — h3 @ 61fc63cbc66277c0915e86a643848331d4795408

A tiny, extremely minimalist JavaScript microframework.

Improvements.
h3rald h3rald@h3rald.com
Mon, 20 Apr 2020 11:47:23 +0200
commit

61fc63cbc66277c0915e86a643848331d4795408

parent

78daa2dabbe4a03d637e3d667829a15abb89eaba

M docs/H3_DeveloperGuide.htmdocs/H3_DeveloperGuide.htm

@@ -7311,13 +7311,12 @@

<a name="Overview"></a> <h2>Overview<a href="#document-top" title="Go to top"></a></h2> -<p><strong>H3</strong> is a microframework to build client-side web applications in modern JavaScript.</p> +<p><strong>H3</strong> is a microframework to build client-side single-page applications (SPAs) in modern JavaScript.</p> <p>H3 is also:</p> <ul> <li><strong>tiny</strong>, under <a href="https://github.com/h3rald/h3/blob/master/h3.js">700 sloc</a>.</li> -<li><strong>bare-bones</strong>, it contains just the bare minimum to create a fully-functional single-page application.</li> <li><strong>modern</strong>, in the sense that it runs only in modern browsers (latest versions of Chrome, Firefox, Edge &amp; similar).</li> <li><strong>easy</strong> to learn, its API is comprised of only seven methods and two properties.</li> </ul>

@@ -7587,13 +7586,19 @@ const id = h3.route.path.slice(1);

const ids = Object.keys(labels); const md = ids.includes(id) ? `md/${id}.md` : `md/overview.md`; fetchPage(pages, id, md); - const menu = ids.map((p) =&gt; h3("a", { href: `#/${p}` }, labels[p])); + const menu = ids.map((p) =&gt; + h3(`a${p === id ? ".active" : ""}`, { href: `#/${p}` }, labels[p]) + ); let content = pages[id] ? h3("div.content", { $html: pages[id] }) : h3("div.spinner-container", h3("span.spinner")); return h3("div.page", [ h3("header.row.sticky", [ - h3("a.logo.col-sm", { href: "#/" }, "H3"), + h3( + "a.logo.col-sm", + { href: "#/" }, + h3("img", { alt: "H3", src: "images/h3.svg" }) + ), h3("label.drawer-toggle.button.col-sm-last", { for: "drawer-control" }), ]), h3("div.row", [

@@ -7940,7 +7945,7 @@

<a name="Credits"></a> <h3>Credits<a href="#document-top" title="Go to top"></a></h3> -<p>This site is built with H3 itself, in under <a href="https://github.com/h3rald/h3/blob/master/docs/js/app.js">70 lines</a> of code, plus the following third-party libraries:</p> +<p>This site is <a href="https://github.com/h3rald/h3/blob/master/docs/js/app.js">built with H3 itself</a>, plus the following third-party libraries:</p> <ul> <li><a href="https://marked.js.org/#/README.md#README.md">marked.js</a></li>
M docs/css/style.cssdocs/css/style.css

@@ -55,4 +55,10 @@ }

h2, h3, h4, h5, h6 { margin-left: -30px; +} + +.logo img { + width: 3em; + height: 3em; + margin-top: -5px; }
A docs/images/h3.svg

@@ -0,0 +1,75 @@

+<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="25.0837mm" + height="19.276138mm" + viewBox="0 0 25.0837 19.276138" + version="1.1" + id="svg8" + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)" + sodipodi:docname="h3.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.979899" + inkscape:cx="107.31982" + inkscape:cy="-62.248448" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1822" + inkscape:window-height="1051" + inkscape:window-x="-9" + inkscape:window-y="-9" + inkscape:window-maximized="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-59.814729,-28.778643)"> + <g + aria-label="H" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:22.57777786px;line-height:1.25;font-family:Cardo;-inkscape-font-specification:Cardo;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" + id="text12"> + <path + d="m 75.215684,42.327515 q 0,1.488281 2.061545,1.554427 0.08819,0 0.08819,0.08819 v 0.264584 q 0,0.08819 -0.08819,0.08819 h -7.011458 q -0.08819,0 -0.08819,-0.08819 v -0.264584 q 0,-0.08819 0.551216,-0.08819 0.551215,0 1.25677,-0.242535 1.080382,-0.352778 1.080382,-1.190625 v -5.258594 q 0,-0.110243 -0.03307,-0.143316 -0.03307,-0.03307 -0.143316,-0.03307 h -8.687152 q -0.110243,0 -0.143316,0.03307 -0.03307,0.03307 -0.03307,0.143316 v 5.368837 q 0,1.322917 1.951302,1.322917 0.08819,0 0.08819,0.08819 v 0.264584 q 0,0.08819 -0.07717,0.08819 h -6.085416 q -0.08819,0 -0.08819,-0.08819 v -0.264584 q 0,-0.08819 0.220486,-0.08819 1.841059,0 1.841059,-1.576476 V 30.542532 q 0,-1.289844 -1.532378,-1.367014 -0.231511,-0.01102 -0.231511,-0.09922 v -0.209461 q 0,-0.0882 0.07717,-0.0882 h 5.534202 q 0.08819,0 0.08819,0.0882 v 0.209461 q 0,0.06615 -0.209462,0.06615 -1.576475,0 -1.576475,1.554427 v 5.09323 q 0,0.110243 0.03307,0.143316 0.03307,0.03307 0.143316,0.03307 h 8.687152 q 0.110244,0 0.143316,-0.03307 0.03307,-0.03307 0.03307,-0.143316 v -5.269618 q -0.02205,-0.09922 -0.03307,-0.176389 0,-0.08819 -0.03307,-0.264584 -0.07717,-0.374826 -0.782726,-0.606337 -0.705556,-0.242534 -1.598524,-0.30868 -0.08819,0 -0.08819,-0.0882 v -0.209461 q 0,-0.0882 0.07717,-0.0882 h 6.361025 q 0.08819,0 0.08819,0.0882 v 0.209461 q 0,0.06615 -0.209462,0.06615 -1.631597,0 -1.631597,1.554427 z" + style="stroke-width:0.26458332" + id="path19" /> + </g> + <g + aria-label="3" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:26.56819153px;line-height:1.25;font-family:Cardo;-inkscape-font-specification:Cardo;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.31134599" + id="text16"> + <path + d="m 80.409858,36.924162 q 0.155673,-0.02595 0.467019,-0.02595 1.504839,0 2.763196,1.258357 1.258356,1.258356 1.258356,3.217241 0,1.945913 -1.03782,3.437779 -1.024847,1.491866 -2.568604,2.374013 -1.530784,0.869175 -2.97076,0.869175 -3.152378,0 -4.29398,-1.27133 -0.298373,-0.324319 -0.428101,-0.778365 0,-0.869174 1.076739,-0.869174 0.272427,0 1.089711,0.648637 0.830256,0.635665 1.55673,1.050793 0.726474,0.415128 1.634566,0.389183 1.69943,-0.05189 2.763196,-1.634567 1.076738,-1.595648 1.076738,-3.476697 0,-1.894021 -0.934038,-2.854005 -0.934038,-0.959983 -2.21834,-0.959983 -0.687556,0 -1.141602,0.259455 -0.454046,0.246482 -0.531883,0.350264 -0.07784,0.103782 -0.1427,0.103782 -0.05189,0 -0.1427,-0.103782 -0.09081,-0.103782 -0.09081,-0.181618 0,-0.07784 0.07784,-0.155673 0.09081,-0.09081 0.207564,-0.181619 0.116755,-0.103782 0.233509,-0.194591 3.230215,-2.516714 3.230215,-4.410735 0,-1.089711 -0.817283,-1.816185 -0.817283,-0.726474 -1.738349,-0.726474 -2.386986,0 -3.852906,2.685359 -0.01297,0.01297 -0.103782,0.01297 -0.07784,0 -0.246483,-0.07784 -0.168645,-0.07784 -0.168645,-0.116754 0,-0.03892 0.02594,-0.116755 0.03892,-0.07784 0.207564,-0.505937 0.168646,-0.428101 0.700529,-1.089711 0.544855,-0.674583 1.193493,-1.167548 1.388084,-1.050793 2.50374,-1.050793 2.049695,0 3.11346,0.817284 1.063766,0.817283 1.063766,2.283204 0,1.452948 -1.582676,3.035623 -0.272427,0.207564 -0.778365,0.557828 -0.492964,0.337292 -0.492964,0.402156 v 0.01297 z" + style="stroke-width:0.31134599" + id="path22" /> + </g> + </g> +</svg>
M docs/js/app.jsdocs/js/app.js

@@ -27,13 +27,19 @@ const id = h3.route.path.slice(1);

const ids = Object.keys(labels); const md = ids.includes(id) ? `md/${id}.md` : `md/overview.md`; fetchPage(pages, id, md); - const menu = ids.map((p) => h3(`a${p === id ? '.active' : ''}`, { href: `#/${p}` }, labels[p])); + const menu = ids.map((p) => + h3(`a${p === id ? ".active" : ""}`, { href: `#/${p}` }, labels[p]) + ); let content = pages[id] ? h3("div.content", { $html: pages[id] }) : h3("div.spinner-container", h3("span.spinner")); return h3("div.page", [ h3("header.row.sticky", [ - h3("a.logo.col-sm", { href: "#/" }, "H3"), + h3( + "a.logo.col-sm", + { href: "#/" }, + h3("img", { alt: "H3", src: "images/h3.svg" }) + ), h3("label.drawer-toggle.button.col-sm-last", { for: "drawer-control" }), ]), h3("div.row", [
M docs/md/about.mddocs/md/about.md

@@ -24,7 +24,7 @@ A few months after that interview, I decided to take a look at that code, tidy it up, add a few bits and bobs, package it up and release it as a *proper* microframwork. Well, kind of.

### Credits -This site is built with H3 itself, in under [70 lines](https://github.com/h3rald/h3/blob/master/docs/js/app.js) of code, plus the following third-party libraries: +This site is [built with H3 itself](https://github.com/h3rald/h3/blob/master/docs/js/app.js), plus the following third-party libraries: * [marked.js](https://marked.js.org/#/README.md#README.md) * [Prism.js](https://prismjs.com/)
M docs/md/overview.mddocs/md/overview.md

@@ -1,11 +1,10 @@

## Overview -**H3** is a microframework to build client-side web applications in modern JavaScript. +**H3** is a microframework to build client-side single-page applications (SPAs) in modern JavaScript. H3 is also: * **tiny**, under [700 sloc](https://github.com/h3rald/h3/blob/master/h3.js). -* **bare-bones**, it contains just the bare minimum to create a fully-functional single-page application. * **modern**, in the sense that it runs only in modern browsers (latest versions of Chrome, Firefox, Edge & similar). * **easy** to learn, its API is comprised of only seven methods and two properties.
M docs/md/usage.mddocs/md/usage.md

@@ -95,13 +95,19 @@ const id = h3.route.path.slice(1);

const ids = Object.keys(labels); const md = ids.includes(id) ? `md/${id}.md` : `md/overview.md`; fetchPage(pages, id, md); - const menu = ids.map((p) => h3("a", { href: `#/${p}` }, labels[p])); + const menu = ids.map((p) => + h3(`a${p === id ? ".active" : ""}`, { href: `#/${p}` }, labels[p]) + ); let content = pages[id] ? h3("div.content", { $html: pages[id] }) : h3("div.spinner-container", h3("span.spinner")); return h3("div.page", [ h3("header.row.sticky", [ - h3("a.logo.col-sm", { href: "#/" }, "H3"), + h3( + "a.logo.col-sm", + { href: "#/" }, + h3("img", { alt: "H3", src: "images/h3.svg" }) + ), h3("label.drawer-toggle.button.col-sm-last", { for: "drawer-control" }), ]), h3("div.row", [