1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-28 01:59:06 -05:00
denoland-deno/website/manual.html
2019-02-12 23:54:08 -05:00

41 lines
1.3 KiB
HTML

<!-- Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -->
<!DOCTYPE html>
<html>
<head>
<title>Deno Manual</title>
<link rel="stylesheet" href="style.css" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
</head>
<body>
<main>
<a href="/"><img src="deno_logo_2.gif"></a>
<div id="manual"></div>
<script src="https://unpkg.com/showdown@1.9.0/dist/showdown.js"></script>
<script src="showdown_toc.js"></script>
<script>
const url = "manual.md";
async function main() {
const response = await fetch(url);
const content = await response.text();
let converter = new showdown.Converter({ extensions: ["toc"] });
let html = converter.makeHtml(content);
const manual = document.getElementById("manual");
manual.innerHTML = html;
// To make anchor links work properly, we have to manually scroll
// since the markdown is rendered dynamically.
if (window.location.hash) {
let el = document.getElementById(window.location.hash.slice(1));
window.scrollTo({ top: el.offsetTop });
}
}
main();
</script>
</main>
</body>
</html>