To avoid getting sued because of this whole GDPR compliance mess it’s recommended to not load any assets (js/css/images/fonts) from third party servers or CDNs.
For HighlightJS this means:
highlight.pack.js
to js
directory of sitecss/highlight-js/
directory of siteIf some code doesn’t get highlighted correctly the reason is probably because the language isn’t included. Reconfigure and redownload.
Originally you would have done:
<!-- In <head> (this is the non-themed version of the styles) -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/styles/default.min.css">
<!-- Just before </body> (this only contains the default languages, so for example not Swift) -->
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/highlight.min.js"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad();</script>
Now you do:
<!-- In <head> (this is a themed version of the styles) -->
<link rel="stylesheet" href="css/highlight-js/tomorrow-night.css" type="text/css">
<!-- Just before </body> (your selection of languages) -->
<script src="js/highlight.min.js"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad();</script>
Schemes can be previewed at the HighlightJS demo page. This site uses the tomorrow-night theme.
Fira Code woff2
web font from https://github.com/tonsky/FiraCode.
def fizzbuzz(n):
if n % 3 == 0 and n % 5 == 0:
return 'FizzBuzz'
elif n % 3 == 0:
return 'Fizz'
elif n % 5 == 0:
return 'Buzz'
else:
return str(n)
print "\n".join(fizzbuzz(n) for n in xrange(1, 21))
var multiple: Bool
for number in 1...100 {
multiple = false
if number % 3 == 0 {
print("Fizz")
multiple = true
}
if number % 5 == 0 {
print("Buzz")
multiple = true
}
if !multiple {
print(number)
}
print("\n")
}
function FizzBuzz(aTarget) {
for (var i = 1; i <= aTarget; i++) {
var result = "";
if (i%3 === 0) result += "Fizz";
if (i%5 === 0) result += "Buzz";
if (result.length ===0) result = i;
console.log(result);
}
}
def fizzbuzz(last_number)
1.upto(last_number).each do |x|
if (x % 3 == 0) && (x % 5 == 0)
puts " Fizzbuzz"
elsif x % 3 == 0
puts " Fizz"
elsif x % 5 == 0
puts " Buzz"
else
puts x
end
end
end
program Name und Kurzbeschreibung
LiesDatenStruktur()
LiesDatenInhalt()
...
if DatenUnvollständig then
FehlerMelden
exit
end if
HauptstatistikBerechnen
ZusammenstellungBerechnen
Resultate in HTML-Datei schreiben
end program Name