CSS
* {
margin: 0;
padding: 0;
font: inherit;
color: inherit;
box-sizing: border-box;
}
html {
background: #fff;
font: normal normal 16px/1.4 sans-serif;
color: #000;
}
body {
padding: 2em;
}
#main {
max-width: 600px;
margin: 0 auto;
}
HTML
<main id="main">
<p>Loading…</p>
</main>
JavaScript
let controller = new AbortController;
fetch('https://example.com/api/list.json', {
signal: controller.signal
}).then(response => response.json()).then(json => {
let out = "";
for (let v of json) {
out += '<article>';
out += '<h2>' + v.title + '</h2>';
out += '<p>' + v.description + '</p>';
out += '</article>';
}
document.querySelector('#main').innerHTML = out;
});
Twig (Preloaded)
{% if posts|length %}
{% for article in articles %}
<div>
{{ article.title|upper() }}
{# outputs 'WELCOME' #}
</div>
{% endfor %}
{% endif %}
{% set user = json_encode(user) %}
{{ random(['apple', 'orange', 'citrus']) }}
{{ include(template_from_string("Hello {{ name }}")) }}
{#
Comments may be long and multiline.
Markup is <em>not</em> highlighted within comments.
#}
Fortran (Preloaded)
subroutine test_sub(k)
implicit none
!===============================
! This is a test subroutine
!===============================
integer, intent(in) :: k
double precision, allocatable :: a(:)
integer, parameter :: nmax=10
integer :: i
allocate (a(nmax))
do i=1,nmax
a(i) = dble(i)*5.d0
enddo
print *, 'Hello world'
write (*,*) a(:)