aboutsummaryrefslogtreecommitdiff
path: root/dokka-subprojects/plugin-base/src/main/resources/dokka/templates
diff options
context:
space:
mode:
Diffstat (limited to 'dokka-subprojects/plugin-base/src/main/resources/dokka/templates')
-rw-r--r--dokka-subprojects/plugin-base/src/main/resources/dokka/templates/base.ftl44
-rw-r--r--dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/footer.ftl7
-rw-r--r--dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/header.ftl31
-rw-r--r--dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/page_metadata.ftl6
-rw-r--r--dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/source_set_selector.ftl9
5 files changed, 97 insertions, 0 deletions
diff --git a/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/base.ftl b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/base.ftl
new file mode 100644
index 00000000..0311f9f8
--- /dev/null
+++ b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/base.ftl
@@ -0,0 +1,44 @@
+<#import "includes/page_metadata.ftl" as page_metadata>
+<#import "includes/header.ftl" as header>
+<#import "includes/footer.ftl" as footer>
+<!DOCTYPE html>
+<html class="no-js">
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
+ <@page_metadata.display/>
+ <@template_cmd name="pathToRoot"><script>var pathToRoot = "${pathToRoot}";</script></@template_cmd>
+ <script>document.documentElement.classList.replace("no-js","js");</script>
+ <#-- This script doesn't need to be there but it is nice to have
+ since app in dark mode doesn't 'blink' (class is added before it is rendered) -->
+ <script>const storage = localStorage.getItem("dokka-dark-mode")
+ if (storage == null) {
+ const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
+ if (osDarkSchemePreferred === true) {
+ document.getElementsByTagName("html")[0].classList.add("theme-dark")
+ }
+ } else {
+ const savedDarkMode = JSON.parse(storage)
+ if(savedDarkMode === true) {
+ document.getElementsByTagName("html")[0].classList.add("theme-dark")
+ }
+ }
+ </script>
+ <#-- Resources (scripts, stylesheets) are handled by Dokka.
+ Use customStyleSheets and customAssets to change them. -->
+ <@resources/>
+</head>
+<body>
+ <div class="root">
+ <@header.display/>
+ <div id="container">
+ <div class="sidebar" id="leftColumn">
+ <div class="sidebar--inner" id="sideMenu"></div>
+ </div>
+ <div id="main">
+ <@content/>
+ <@footer.display/>
+ </div>
+ </div>
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/footer.ftl b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/footer.ftl
new file mode 100644
index 00000000..461a8162
--- /dev/null
+++ b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/footer.ftl
@@ -0,0 +1,7 @@
+<#macro display>
+ <div class="footer">
+ <span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>${footerMessage}</span><span
+ class="pull-right"><span>Generated by </span><a
+ href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span>
+ </div>
+</#macro> \ No newline at end of file
diff --git a/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/header.ftl b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/header.ftl
new file mode 100644
index 00000000..d399e633
--- /dev/null
+++ b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/header.ftl
@@ -0,0 +1,31 @@
+<#import "source_set_selector.ftl" as source_set_selector>
+<#macro display>
+<nav class="navigation" id="navigation-wrapper">
+ <div class="navigation--inner">
+ <div class="navigation-title">
+ <button class="menu-toggle" id="menu-toggle" type="button">toggle menu</button>
+ <div class="library-name">
+ <@template_cmd name="pathToRoot">
+ <a class="library-name--link" href="${pathToRoot}index.html">
+ <@template_cmd name="projectName">
+ ${projectName}
+ </@template_cmd>
+ </a>
+ </@template_cmd>
+ </div>
+ <div class="library-version">
+ <#-- This can be handled by the versioning plugin -->
+ <@version/>
+ </div>
+ </div>
+ <@source_set_selector.display/>
+ </div>
+ <div class="navigation-controls">
+ <#if homepageLink?has_content>
+ <div class="navigation-controls--btn navigation-controls--homepage" id="homepage-link" role="button"><a href="${homepageLink}"></a></div>
+ </#if>
+ <button class="navigation-controls--btn navigation-controls--theme" id="theme-toggle-button" type="button">switch theme</button>
+ <div class="navigation-controls--btn navigation-controls--search" id="searchBar" role="button">search in API</div>
+ </div>
+</nav>
+</#macro>
diff --git a/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/page_metadata.ftl b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/page_metadata.ftl
new file mode 100644
index 00000000..7cab4582
--- /dev/null
+++ b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/page_metadata.ftl
@@ -0,0 +1,6 @@
+<#macro display>
+ <title>${pageName}</title>
+ <@template_cmd name="pathToRoot">
+ <link href="${pathToRoot}images/logo-icon.svg" rel="icon" type="image/svg">
+ </@template_cmd>
+</#macro>
diff --git a/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/source_set_selector.ftl b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/source_set_selector.ftl
new file mode 100644
index 00000000..2d848071
--- /dev/null
+++ b/dokka-subprojects/plugin-base/src/main/resources/dokka/templates/includes/source_set_selector.ftl
@@ -0,0 +1,9 @@
+<#macro display>
+ <#if sourceSets?has_content>
+ <div class="filter-section" id="filter-section">
+ <#list sourceSets as ss>
+ <button class="platform-tag platform-selector ${ss.platform}-like" data-active="" data-filter="${ss.filter}">${ss.name}</button>
+ </#list>
+ </div>
+ </#if>
+</#macro>