aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvmishenev <vad-mishenev@yandex.ru>2021-09-16 20:26:47 +0300
committervmishenev <vad-mishenev@yandex.ru>2021-09-20 16:39:29 +0300
commit8efe04e127e3bf0aef395b31f3f3d9f49a0afe26 (patch)
tree4a910f37ce7bc6f8bcbff27a2e743cf97f1f8325
parente6dd88c0cce8d61aeed19b4f49c7cca3d95b72b1 (diff)
downloaddokka-8efe04e127e3bf0aef395b31f3f3d9f49a0afe26.tar.gz
dokka-8efe04e127e3bf0aef395b31f3f3d9f49a0afe26.tar.bz2
dokka-8efe04e127e3bf0aef395b31f3f3d9f49a0afe26.zip
Bring back logo
-rw-r--r--docs/src/doc/docs/user_guide/base-specific/frontend.md23
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt3
-rw-r--r--plugins/base/src/main/resources/dokka/styles/logo-styles.css15
3 files changed, 40 insertions, 1 deletions
diff --git a/docs/src/doc/docs/user_guide/base-specific/frontend.md b/docs/src/doc/docs/user_guide/base-specific/frontend.md
index 63146013..6687990a 100644
--- a/docs/src/doc/docs/user_guide/base-specific/frontend.md
+++ b/docs/src/doc/docs/user_guide/base-specific/frontend.md
@@ -24,6 +24,7 @@ Dokka uses 3 stylesheets:
* `style.css` - main css file responsible for styling the page
* `jetbrains-mono.css` - fonts used across dokka
+* `logo-styles.css` - logo styling
User can choose to add or override those files.
Resources will be overridden when in `pluginConfiguration` block there is a resource with the same name.
@@ -38,5 +39,27 @@ Keep in mind that this value will be passed exactly to the output html, so it ha
By setting a boolean property `separateInheritedMembers` dokka will split inherited members (like functions, properties etc.)
from ones declared in viewed class. Separated members will have it's own tabs on the page.
+### Examples
+In order to override a logo and style it accordingly a css file named `logo-styles.css` is needed:
+```css
+.library-name a {
+ position: relative;
+ --logo-width: 100px;
+ margin-left: calc(var(--logo-width) + 5px);
+}
+
+.library-name a::before {
+ content: '';
+ background: url("https://upload.wikimedia.org/wikipedia/commons/9/9d/Ubuntu_logo.svg") center no-repeat;
+ background-size: contain;
+ position: absolute;
+ width: var(--logo-width);
+ height: 50px;
+ top: -18px;
+ left: calc(-1 * var(--logo-width) - 5px);
+ /* other styles required to make your page pretty */
+}
+```
+
For build system specific instructions please visit dedicated pages: [gradle](../gradle/usage.md#Applying plugins), [maven](../maven/usage.md#Applying plugins) and [cli](../cli/usage.md#Configuration options) \ No newline at end of file
diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
index 347e16bf..665ae730 100644
--- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
@@ -106,7 +106,8 @@ class StylesInstaller(private val dokkaContext: DokkaContext) : PageTransformer
"styles/style.css",
"styles/jetbrains-mono.css",
"styles/main.css",
- "styles/prism.css"
+ "styles/prism.css",
+ "styles/logo-styles.css"
)
override fun invoke(input: RootPageNode): RootPageNode =
diff --git a/plugins/base/src/main/resources/dokka/styles/logo-styles.css b/plugins/base/src/main/resources/dokka/styles/logo-styles.css
new file mode 100644
index 00000000..25de3f61
--- /dev/null
+++ b/plugins/base/src/main/resources/dokka/styles/logo-styles.css
@@ -0,0 +1,15 @@
+.library-name a {
+ position: relative;
+ margin-left: 55px;
+}
+
+.library-name a::before {
+ content: '';
+ background: url("../images/logo-icon.svg") center no-repeat;
+ background-size: contain;
+ position: absolute;
+ width: 50px;
+ height: 50px;
+ top: -18px;
+ left: -55px;
+} \ No newline at end of file