This gist can be view on blocks or gist.io
ex: WriteToIPFS
note: this page is compiled with the commande:
pandoc --template=_README.md _README.md | pandoc -o README.md
(the first pandoc evaluates the front matter, the second removes id)
<script>
console.debug('html.innerHTML:',document.getElementsByTagName('html')[0].innerHTML.substr(0,42),'...');
const url='https://gist.githubusercontent.com/DrI-T/21cfa651fe06275f99f092f44f5a596b/raw/_writeToIPFS.html'
var content ='<p>Why, Hello world !</p>'
fetch(url,{ method: 'GET' }).
then( resp => resp.text() ).
then( html => {
html = html.replace('<!DOCTYPE html>','');
console.log('html:',html.substr(0,42).replace(/\n/g,' '),'...');
document.write(html)
/*
let temp = document.getElementById('gist')
var clone = temp.content.cloneNode(true);
clone.outerHTML = html;
document.body.appendChild(clone);
console.dir(clone);
*/
}).
catch(console.warn)
</script>
to execute the code locally :