2021-12-15 08:24:49 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2021 Henrik Böving. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
Authors: Henrik Böving
|
|
|
|
-/
|
2022-05-19 18:36:35 +00:00
|
|
|
import DocGen4.Output.ToHtmlFormat
|
2021-12-15 08:24:49 +00:00
|
|
|
import DocGen4.Output.Navbar
|
|
|
|
|
|
|
|
namespace DocGen4
|
|
|
|
namespace Output
|
|
|
|
|
|
|
|
open scoped DocGen4.Jsx
|
|
|
|
|
2022-05-19 19:53:03 +00:00
|
|
|
/--
|
|
|
|
The HTML template used for all pages.
|
|
|
|
-/
|
2022-07-20 23:40:04 +00:00
|
|
|
def baseHtmlGenerator (title : String) (site : Array Html) : BaseHtmlM Html := do
|
2022-07-22 14:56:51 +00:00
|
|
|
let moduleConstant :=
|
2023-01-01 18:51:01 +00:00
|
|
|
if let some module := ← getCurrentName then
|
2022-07-22 14:56:51 +00:00
|
|
|
#[<script>{s!"const MODULE_NAME={String.quote module.toString};"}</script>]
|
|
|
|
else
|
|
|
|
#[]
|
2022-02-12 14:09:13 +00:00
|
|
|
pure
|
|
|
|
<html lang="en">
|
2022-07-21 21:01:15 +00:00
|
|
|
<head>
|
2023-01-01 18:51:01 +00:00
|
|
|
[← baseHtmlHeadDeclarations]
|
2022-07-21 21:01:15 +00:00
|
|
|
|
|
|
|
<title>{title}</title>
|
2023-01-01 18:51:01 +00:00
|
|
|
<script defer="true" src={s!"{← getRoot}mathjax-config.js"}></script>
|
2022-07-21 21:01:15 +00:00
|
|
|
<script defer="true" src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
|
|
|
<script defer="true" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
|
|
|
|
2023-01-01 18:51:01 +00:00
|
|
|
<script>{s!"const SITE_ROOT={String.quote (← getRoot)};"}</script>
|
2022-07-22 14:56:51 +00:00
|
|
|
[moduleConstant]
|
2023-01-01 18:51:01 +00:00
|
|
|
<script type="module" src={s!"{← getRoot}search.js"}></script>
|
|
|
|
<script type="module" src={s!"{← getRoot}how-about.js"}></script>
|
|
|
|
<script type="module" src={s!"{← getRoot}instances.js"}></script>
|
|
|
|
<script type="module" src={s!"{← getRoot}importedBy.js"}></script>
|
2022-07-21 21:01:15 +00:00
|
|
|
</head>
|
|
|
|
|
2022-02-12 14:09:13 +00:00
|
|
|
<body>
|
|
|
|
|
2022-02-20 15:42:46 +00:00
|
|
|
<input id="nav_toggle" type="checkbox"/>
|
2022-02-12 14:09:13 +00:00
|
|
|
|
2022-02-20 15:42:46 +00:00
|
|
|
<header>
|
2022-05-19 09:14:47 +00:00
|
|
|
<h1><label for="nav_toggle"></label>Documentation</h1>
|
2023-03-03 11:48:48 +00:00
|
|
|
<p class="header_filename break_within">[breakWithin title]</p>
|
2022-02-20 15:42:46 +00:00
|
|
|
<form action="https://google.com/search" method="get" id="search_form">
|
2022-10-27 21:40:53 +00:00
|
|
|
<input type="hidden" name="sitesearch" value="https://leanprover-community.github.io/mathlib4_docs"/>
|
|
|
|
<input type="text" name="q" autocomplete="off"/> 
|
2023-01-29 13:07:21 +00:00
|
|
|
<button id="search_button" onclick={s!"javascript: form.action='{← getRoot}search.html';"}>Search</button>
|
2022-02-20 15:42:46 +00:00
|
|
|
<button>Google site search</button>
|
|
|
|
</form>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
[site]
|
2022-04-07 10:39:32 +00:00
|
|
|
|
2022-07-21 20:06:26 +00:00
|
|
|
<nav class="nav">
|
2023-01-01 18:51:01 +00:00
|
|
|
<iframe src={s!"{← getRoot}navbar.html"} class="navframe" frameBorder="0"></iframe>
|
2022-07-21 20:06:26 +00:00
|
|
|
</nav>
|
2022-02-12 14:09:13 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
2021-12-15 08:24:49 +00:00
|
|
|
|
2022-05-19 19:53:03 +00:00
|
|
|
/--
|
|
|
|
A comfortability wrapper around `baseHtmlGenerator`.
|
|
|
|
-/
|
2022-07-20 23:40:04 +00:00
|
|
|
def baseHtml (title : String) (site : Html) : BaseHtmlM Html := baseHtmlGenerator title #[site]
|
2022-01-07 16:43:49 +00:00
|
|
|
|
2021-12-15 08:24:49 +00:00
|
|
|
end Output
|
|
|
|
end DocGen4
|