Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: generate dokka documentation #238

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .idea/appInsightsSettings.xml

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

20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,38 @@
* Software description: Android library of reusable graphical components
*/

import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.firebase.appdistribution) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.google.services) apply false
id(libs.plugins.dokka.gradle.plugin.get().pluginId) // https://github.com/gradle/gradle/issues/20084#issuecomment-1060822638
id("github")
id("release")
id("netlify")
id("check-notice")
}

dependencies {
dokkaPlugin(libs.android.documentation.plugin)
}

checkNotice {
additionalResourcePaths += "$rootDir/docs/images"
}

tasks.dokkaHtmlMultiModule {
outputDirectory.set(projectDir.resolve("docs/dokka"))
includes.from("docs/index.md")
// used as project name in the header
moduleName.set("OUDS Android")
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customAssets = listOf(file("docs/assets/logo-icon.svg"))
customStyleSheets = listOf(file("docs/assets/orange-style.css"))
footerMessage = "Copyright © Orange 2024"
}
}
2 changes: 2 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ kotlin {

dependencies {
implementation(libs.android.gradle.plugin)
implementation(libs.dokka.base)
implementation(libs.dokka.gradle.plugin)
implementation(libs.git.changelog.gradle.plugin)
implementation(libs.git.changelog.lib)
implementation(libs.google.auth.library.oauth2.http)
Expand Down
32 changes: 32 additions & 0 deletions buildSrc/src/main/kotlin/dokka.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Software Name: OUDS Android
* SPDX-FileCopyrightText: Copyright (c) Orange SA
* SPDX-License-Identifier: MIT
*
* This software is distributed under the MIT license,
* the text of which is available at https://opensource.org/license/MIT/
* or see the "LICENSE" file for more details.
*
* Software description: Android library of reusable graphical components
*/

import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaTaskPartial

plugins {
id("org.jetbrains.dokka")
}

tasks.withType<DokkaTaskPartial>().configureEach {
failOnWarning.set(true)

dokkaSourceSets {
configureEach {
includes.from("Module.md")
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customStyleSheets = listOf(file("docs/assets/orange-style.css"))
}
}
}
}
7 changes: 7 additions & 0 deletions core/Module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Module core

This is an example of how you can write module documentation with Dokka.

# Package demo

This package contains a few examples of Dokka usage.
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plugins {
id("library")
alias(libs.plugins.compose.compiler)
alias(libs.plugins.paparazzi)
id("dokka")
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.orange.ouds.core.theme.value
import com.orange.ouds.theme.tokens.OudsColorKeyToken

/**
* @suppress
* Configures the Compose OUDS preview environment in Android Studio.
*
* @param darkThemeEnabled Indicates whether the dark theme is enabled or not.
Expand All @@ -32,3 +33,7 @@ fun OudsPreview(darkThemeEnabled: Boolean = isSystemInDarkTheme(), content: @Com
Surface(color = OudsColorKeyToken.Background.Primary.value, content = content) // Add a surface to be able to see components
}
}

fun test() {

}
1 change: 0 additions & 1 deletion docs/.gitignore

This file was deleted.

File renamed without changes
24 changes: 24 additions & 0 deletions docs/assets/orange-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* --- root styles --- */
:root {
--footer-font-color: black;
--footer-go-to-top-color: white;

--active-section-color: #ff7900;
--active-tab-border-color: #ff7900;
--sidemenu-section-active-color: #ff7900;

--default-font-family: Helvetica Neue, Roboto, Arial, sans-serif;
}

.library-name--link {
font-size: 28px;
font-weight: 700;
}

.sideMenuPart[data-active] > .overview > a {
font-weight: 700;
}

.sidebar--inner {
font-size: 13px;
}
6 changes: 0 additions & 6 deletions docs/c.list

This file was deleted.

25 changes: 0 additions & 25 deletions docs/cfg/buildprofiles.xml

This file was deleted.

61 changes: 0 additions & 61 deletions docs/cfg/tarteaucitron.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!doctype html>
<html class="no-js">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>OudsButton</title>
<link href="../../images/logo-icon.svg" rel="icon" type="image/svg"> <script>var pathToRoot = "../../";</script>
<script>document.documentElement.classList.replace("no-js","js");</script>
<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>
<script type="text/javascript" src="https://unpkg.com/kotlin-playground@1/dist/playground.min.js" async></script>
<script type="text/javascript" src="../../scripts/sourceset_dependencies.js" async></script>
<link href="../../styles/style.css" rel="Stylesheet">
<link href="../../styles/main.css" rel="Stylesheet">
<link href="../../styles/prism.css" rel="Stylesheet">
<link href="../../styles/logo-styles.css" rel="Stylesheet">
<link href="../../styles/font-jb-sans-auto.css" rel="Stylesheet">
<script type="text/javascript" src="../../scripts/clipboard.js" async></script>
<script type="text/javascript" src="../../scripts/navigation-loader.js" async></script>
<script type="text/javascript" src="../../scripts/platform-content-handler.js" async></script>
<script type="text/javascript" src="../../scripts/main.js" defer></script>
<script type="text/javascript" src="../../scripts/prism.js" async></script>
<script type="text/javascript" src="../../scripts/symbol-parameters-wrapper_deferred.js" defer></script>
<link href="../../styles/orange-style.css" rel="Stylesheet"></head>
<body>
<div class="root">
<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">
<a class="library-name--link" href="../../index.html">
OUDS Android
</a> </div>
<div class="library-version">0.1.0
</div>
</div>
<div class="filter-section" id="filter-section">
<button class="platform-tag platform-selector jvm-like" data-active="" data-filter=":core:dokkaHtmlPartial/release">androidJvm</button>
</div>
</div>
<div class="navigation-controls">
<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>
<div id="container">
<div class="sidebar" id="leftColumn">
<div class="sidebar--inner" id="sideMenu"></div>
</div>
<div id="main">
<div class="main-content" data-page-type="member" id="content" pageids="core::com.orange.ouds.core.component.button//OudsButton/#kotlin.String#kotlin.Function0[kotlin.Unit]#androidx.compose.ui.Modifier#kotlin.Boolean/PointingToDeclaration//-27209644">
<div class="breadcrumbs"><a href="../index.html">core</a><span class="delimiter">/</span><a href="index.html">com.orange.ouds.core.component.button</a><span class="delimiter">/</span><span class="current">OudsButton</span></div>
<div class="cover ">
<h1 class="cover"><span>Ouds</span><wbr><span><span>Button</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":core:dokkaHtmlPartial/release"><div class="symbol monospace"><div class="block"><div class="block"><span class="token annotation builtin">@</span><a href="https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable.html"><span class="token annotation builtin">Composable</span></a></div></div><span class="token keyword">fun </span><a href="-ouds-button.html"><span class="token function">OudsButton</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">text<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">onClick<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token punctuation">, </span></span><span class="parameter ">modifier<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.html">Modifier</a><span class="token operator"> = </span>Modifier<span class="token punctuation">, </span></span><span class="parameter ">enabled<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a><span class="token operator"> = </span><span class="token boolean">true</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>© 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>
</div>
</div>
</div>
</body>
</html>

Loading
Loading