Skip to content

Commit

Permalink
Added two samples
Browse files Browse the repository at this point in the history
  • Loading branch information
mignatovich committed Jul 17, 2019
1 parent 4ffe8cd commit 5406809
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 0 deletions.
33 changes: 33 additions & 0 deletions content/samples/brotli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: "Brotli Sample"
fullTitle: "Brotli"
name: "Mikhail Ignatovich"
date: 2019-07-17
weight: 2
draft: false
---

<b>KolmoLD is a way to get the support of new data formats!</b>

KolmoLD manifests provides a way to distribute new data compression algorithms along the same channel as the compressed data. This means that a new codec that has not been installed as a browser add-on or an application upgrade is accessible client-side. Once the manifest defining the codec has been downloaded, it can be stored and re-used on all files that has been compressed with it.

In this example, Brotli has been defined as a KolmoLD formula, and a manifest has been provided that will decompress a data object with this formula. The data object has already been compressed prior to this example.

The data object in question is a JavaScript file.

<div class="interactive-canvas">
<textarea class="manifest-text" id="sample_1_manifest_text" cols="100" rows="5">{ "doi" :{ "SHA256" : "6F59B23AA0D0F7BEE8AEF463F1527FB025217095707B72D25F25C8AE62EA58F6" } }</textarea>
<br>
<span class="run-button-placeholder"></span>
<span class="render-button-placeholder"></span>
<span class="manifest-data-placeholder" id="sample_1_manifest_data"></span>
</div>

<b>Result data</b>
DOI=6F59B23AA0D0F7BEE8AEF463F1527FB025217095707B72D25F25C8AE62EA58F6

<b>actor.wasm (Webassembly for decompressing Brotli files)</b>
DOI=740F4421EBC579AFE1F4FB0F57C15E698B7BB525EA19E22B96634D49BB2147EE

<b>arg1 (Compressed by Brotli JavaScript file)</b>
DOI=ABCF598718AEAC83B850A6BF0773F3B8C3F8E43F33A05F4A571CFF5355DE58AE
32 changes: 32 additions & 0 deletions content/samples/hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: "Hello World Sample"
fullTitle: "Hello World"
name: "Mikhail Ignatovich"
date: 2019-07-17
weight: 1
draft: false
---

<b>KolmoLD is a way to get data generated from others!</b>

In the KolmoLD framework, content is generated. The *formula* for generating this content is defined in a *manifest*. Data chunks can also be defined and referenced by these formulas. Manifests and formulas are best explained by a "Hello World" example. We will create the "Hello World" string by concatenating two strings together: "Hello " and "World". These two strings are plain text data objects. The formula that will concatenate them together is an executable type of data object. It is identified by its custom MIME type: application/wasm. The final manifest that will generate the complete string defines the relation between the plain text data objects and the concatenation data object. In other words, it concatenates the two strings together and outputs "Hello World."

<div class="interactive-canvas">
<textarea class="manifest-text" id="sample_1_manifest_text" cols="100" rows="5">{ "doi": { "SHA256" : "A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E" } }</textarea>
<br>
<span class="run-button-placeholder"></span>
<span class="render-button-placeholder"></span>
<span class="manifest-data-placeholder" id="sample_1_manifest_data"></span>
</div>

<b>Result data</b>
DOI=A591A6D40BF420404A011733CFB7B190D62C65BF0BCDA32B57B277D9AD9F146E

<b>actor.wasm (Webassembly for concatination data)</b>
DOI=0F23021FFDC8F3BB3302C1763F52D10F55E16A2B74CADD3EE3BD7081D6D7B89C

<b>arg1 (Text file with "Hello ")</b>
DOI=A4CFC596D52C95B51AB28B4DEF04F83DA35CD3A4C6DB1B6001D4D0FA41809221

<b>arg2 (Text file with "World")</b>
DOI=AA1DB5C660D3D1F3F4F9361B9848694300929BE94B74C84452A87420C59E5DF9
4 changes: 4 additions & 0 deletions layouts/partials/nav-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<span></span>
<span></span>
<span></span>
<span></span>
</span>
<div id="nav-menu" class="nav-left nav-menu">
<span class="nav-item">
Expand All @@ -15,6 +16,9 @@
<span class="nav-item">
<a href="/~https://github.com/kolmoblocks">Github</a>
</span>
<span class="nav-item">
<a href="/samples">Live Samples</a>
</span>
</div>
</nav>
<hr>
55 changes: 55 additions & 0 deletions layouts/samples/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{{ partial "header.html" . }}
<body>

<div class="section" id="top">
<div class="container">
{{ partial "nav-single.html" . }}
</div>
<!-- Parent section -->
<div class="container hero">
<!-- Begin Title -->
<h2 class="title is-1">Live Samples</h2>
<!-- Ranges through content/samples/*.md -->
{{ range .Data.Pages }}
<div class="column is-one-third">
<a href="{{.Permalink}}">
<div class="container">
<!-- Begin Title -->
<h1 class="title">{{ if .Params.fullTitle }} {{ .Params.fullTitle }}{{ else }} {{ .Params.Title }} {{ end }}</h1>
<div class="post-data">
{{ .Params.name }} | {{ .Date.Format (.Site.Params.config.dateFormat | default "Jan 02, 2006") }} | {{ if eq 1 .ReadingTime }}{{ .ReadingTime }} minute
read{{ else }}{{ .ReadingTime }} minutes read{{ end }}
</div>
</div>
</a>
</div>
{{ end }}
</div>

<div class="container has-text-centered top-pad">
<hr>
<a href="#top">
<i class="fa fa-arrow-up"></i>
</a>
<hr>
</div>

{{ partial "footer.html" . }}
</div>
<!-- End fade in two -->
</div>
<!-- End parent section -->

<!-- Bitty scrolling links script -->
<script>
$('a[href^="{{ .Permalink }}#"]').click(function (e) {
e.preventDefault();
var target = this.hash;
$('html, body').animate({
scrollTop: $(target).offset().top
}, 500);
return false;
})
</script>

</body>
73 changes: 73 additions & 0 deletions layouts/samples/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{{ partial "header.html" . }}


<body>

<div class="section" id="top">
<div class="container">
{{ partial "nav-single.html" . }}
</div>

<!-- Parent section -->
<div class="container hero {{ if .Site.Params.config.fadeEffect }} fade-in one {{ end }}">
<!-- Begin Title -->
<h1 class="tagline">{{ if .Params.fullTitle }} {{ .Params.fullTitle }}{{ else }} {{ .Params.Title }} {{ end }}</h1>
<div class="post-data">
{{ .Params.name }} | {{ .Date.Format (.Site.Params.config.dateFormat | default "Jan 02, 2006") }} | {{ if eq 1 .ReadingTime }}{{ .ReadingTime }} minute
read{{ else }}{{ .ReadingTime }} minutes read{{ end }}
</div>
</div>
<!-- End Title -->

<div class="sample_container">

<!-- End fade in two -->

<div class="section {{ if .Site.Params.config.fadeEffect }} fade-in two {{ end }}">

<div class="container markdown {{ if .Site.Params.config.fadeEffect }} fade-in two {{ end }} top-pad">
{{ if .Params.image }}
<div class="has-text-centered">
<img src="{{ .Params.image }}" class="img-responsive">
</div>
{{ end }} {{ .Content }}
</div>

<div class="disqus">
{{ template "_internal/disqus.html" . }}
</div>

<div class="container has-text-centered top-pad">
<hr>
<a href="#top">
<i class="fa fa-arrow-up"></i>
</a>
<hr>
</div>

{{ partial "footer.html" . }}
</div>

<div class="section {{ if .Site.Params.config.fadeEffect }} fade-in two {{ end }}">
<div id="root"></div>
</div>
</div>
</div>
<!-- End parent section -->


<!-- Bitty scrolling links script -->
<script>
$('a[href^="{{ .Permalink }}#"]').click(function (e) {
e.preventDefault();
var target = this.hash;
$('html, body').animate({
scrollTop: $(target).offset().top
}, 500);
return false;
})
</script>

<script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/js/2.f0adba9b.chunk.js"></script><script src="/js/main.cf9e52ce.chunk.js"></script>

</body>
4 changes: 4 additions & 0 deletions static/css/light-style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions static/css/main.3859138b.chunk.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/css/main.3859138b.chunk.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions static/js/2.f0adba9b.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/js/2.f0adba9b.chunk.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/js/main.cf9e52ce.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/js/main.cf9e52ce.chunk.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/js/runtime~main.a8a9905a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5406809

Please sign in to comment.