Skip to content

Commit

Permalink
Publish examples
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed Mar 4, 2024
1 parent 88485ec commit 61b3127
Show file tree
Hide file tree
Showing 106 changed files with 651 additions and 427 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div class="cover ">
<h1 class="cover"><span><span>greet</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="greet.html"><span class="token function">greet</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span></div><p class="paragraph">Prints the greeting to the standard output.</p></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="greet.html"><span class="token function">greet</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span></div><p class="paragraph">Prints the greeting to the standard output.</p></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>(c) Custom Format Dokka example</span><span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h2 class="">Properties</h2>
</span></span></div>
<div>
<div class="title">
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">val </span><a href="name.html">name</a><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></div><div class="brief "><p class="paragraph">The name of the person to be greeted.</p></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">val </span><a href="name.html">name</a><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></div><div class="brief "><p class="paragraph">The name of the person to be greeted.</p></div></div></div>
</div>
</div>
</div>
Expand All @@ -122,7 +122,7 @@ <h2 class="">Functions</h2>
</span></span></div>
<div>
<div class="title">
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="greet.html"><span class="token function">greet</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Prints the greeting to the standard output.</p></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="greet.html"><span class="token function">greet</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span></div><div class="brief "><p class="paragraph">Prints the greeting to the standard output.</p></div></div></div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div class="cover ">
<h1 class="cover"><span><span>name</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">val </span><a href="name.html">name</a><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">val </span><a href="name.html">name</a><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></div></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>(c) Custom Format Dokka example</span><span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h2 class="">Functions</h2>
</span></span></div>
<div>
<div class="title">
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="main.html"><span class="token function">main</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">args<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">&gt;</span></span></span><span class="token punctuation">)</span></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="main.html"><span class="token function">main</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">args<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a><span class="token operator">&lt;</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">&gt;</span></span></span><span class="token punctuation">)</span></div></div></div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div class="cover ">
<h1 class="cover"><span><span>main</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="main.html"><span class="token function">main</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">args<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">&gt;</span></span></span><span class="token punctuation">)</span></div></div></div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">fun </span><a href="main.html"><span class="token function">main</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">args<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a><span class="token operator">&lt;</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">&gt;</span></span></span><span class="token punctuation">)</span></div></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>(c) Custom Format Dokka example</span><span
Expand Down
3 changes: 3 additions & 0 deletions examples/dokka-customFormat-example/html/images/homepage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const samplesLightThemeName = 'idea'
window.addEventListener('load', () => {
document.querySelectorAll("div[data-platform-hinted]")
.forEach(elem => elem.addEventListener('click', (event) => togglePlatformDependent(event, elem)))
document.querySelectorAll("div[tabs-section]")
.forEach(elem => elem.addEventListener('click', (event) => toggleSectionsEventHandler(event)))
const filterSection = document.getElementById('filter-section')
if (filterSection) {
filterSection.addEventListener('click', (event) => filterButtonHandler(event))
Expand Down Expand Up @@ -177,19 +175,30 @@ function handleAnchor() {
}

function initTabs() {
document.querySelectorAll("div[tabs-section]")
.forEach(element => {
showCorrespondingTabBody(element)
element.addEventListener('click', (event) => toggleSectionsEventHandler(event))
})
let cached = localStorage.getItem("active-tab")
if (cached) {
let parsed = JSON.parse(cached)
let tab = document.querySelector('div[tabs-section] > button[data-togglable="' + parsed + '"]')
if (tab) {
toggleSections(tab)
}
}
// we could have only a single type of data - classlike or package
const mainContent = document.querySelector('.main-content');
const type = mainContent ? mainContent.getAttribute("data-page-type") : null;
const localStorageKey = "active-tab-" + type;
document.querySelectorAll('div[tabs-section]').forEach(element => {
showCorrespondingTabBody(element);
element.addEventListener('click', ({target}) => {
const togglable = target ? target.getAttribute("data-togglable") : null;
if (!togglable) return;

localStorage.setItem(localStorageKey, JSON.stringify(togglable));
toggleSections(target);
});
});

const cached = localStorage.getItem(localStorageKey);
if (!cached) return;

const tab = document.querySelector(
'div[tabs-section] > button[data-togglable="' + JSON.parse(cached) + '"]'
);
if (!tab) return;

toggleSections(tab);
}

function showCorrespondingTabBody(element) {
Expand Down Expand Up @@ -293,12 +302,6 @@ function toggleSections(target) {
activateTabsBody("tabs-section-body")
}

function toggleSectionsEventHandler(evt) {
if (!evt.target.getAttribute("data-togglable")) return
localStorage.setItem('active-tab', JSON.stringify(evt.target.getAttribute("data-togglable")))
toggleSections(evt.target)
}

function togglePlatformDependent(e, container) {
let target = e.target
if (target.tagName != 'BUTTON') return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

/*
Expand Down
2 changes: 1 addition & 1 deletion examples/dokka-customFormat-example/html/styles/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 46 additions & 20 deletions examples/dokka-customFormat-example/html/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ td:first-child {
/* --- Navigation controls --- */
.navigation-controls {
display: flex;
margin-left: 4px;
}

@media (min-width: 760px) {
Expand All @@ -354,45 +355,50 @@ td:first-child {
display: none;
}

/* --- Navigation THEME --- */
.navigation-controls--search {
.navigation-controls--btn {
display: inline-flex;
font-size: 0;
line-height: 0;
}

.navigation-controls--theme {
display: block;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 50%;
background-color: inherit;
margin-left: 4px;
background-position: 50% 50%;
padding: 0;
border: none;
cursor: pointer;
font-size: 0;
line-height: 0;
transition: background-color 200ms ease-in-out;
will-change: background-color;
}

.navigation-controls--theme::before {
height: 40px;
width: 40px;
.navigation-controls--btn:hover {
background-color: var(--white-10);
}

.navigation-controls--theme {
background-image: url("../images/theme-toggle.svg");
background-repeat: no-repeat;
}

.navigation-controls--theme:hover {
background: var(--white-10);
@media (max-width: 759px) {
.navigation-controls--theme {
display: none;
}
}

.navigation-controls--theme::before {
display: block;
content: url("../images/theme-toggle.svg");
.navigation-controls--homepage {
background-image: url("../images/homepage.svg");
background-repeat: no-repeat;
background-size: 24px 24px;
}

@media (max-width: 759px) {
.navigation-controls--theme {
.navigation-controls--homepage {
display: none;
}
}
/* /--- Navigation THEME --- */

.navigation .platform-selector:not([data-active]) {
color: #fff;
Expand Down Expand Up @@ -656,6 +662,26 @@ code.paragraph {
text-decoration: line-through;
}

/* Workaround for Firefox https://github.com/Kotlin/dokka/issues/3156 */
@-moz-document url-prefix() {
.strikethrough {
position: relative;
text-decoration: none;
}

/* complex selectors here are required to handle multiline cases */
.strikethrough::after, .strikethrough span:after {
content: '';
position: absolute;
top: 7px;
left: 0;
right: 0;
height: 1px;
background-color: currentColor;
z-index: 1;
}
}

.symbol:empty {
padding: 0;
}
Expand Down Expand Up @@ -684,7 +710,7 @@ code {

code:not(.block) {
display: inline-block;
vertical-align: middle;
vertical-align: bottom;
}

.symbol > a {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h1 class="cover"><span><span>Greeter</span></span></h1>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword">constructor</span><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">name<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></span></span><span class="token punctuation">)</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-gradle-example/src/main/kotlin/demo/HelloWorld.kt#L8">source</a>)</span></span></div></div></div>
</div>
<div class="footer">
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2023 Copyright</span><span
<span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2024 Copyright</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>
Expand Down
Loading

0 comments on commit 61b3127

Please sign in to comment.