Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update documentation

on:
workflow_dispatch:
push:
branches:
- main

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material mike

- uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'

- name: Get current Readium version
run: echo "READIUM_VERSION=`git describe --tag --match [0-9]* --abbrev=0`" >> $GITHUB_ENV

- name: Run Dokka
run: ./gradlew dokkaGfmMultiModule

- name: Run MkDocs
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
mike deploy ${{ env.READIUM_VERSION }}
mike set-default ${{ env.READIUM_VERSION }}
mike deploy --rebase --push --update-aliases ${{ env.READIUM_VERSION }} latest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ lint/reports/

# Android Profiling
*.hprof

# Docs
docs/readium
26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

buildscript {
ext.kotlin_version = '1.5.31'
ext.dokka_version = '1.5.30'

repositories {
google()
Expand All @@ -18,9 +19,12 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
}
}

apply plugin: 'org.jetbrains.dokka'

allprojects {
repositories {
google()
Expand All @@ -32,6 +36,28 @@ allprojects {
}
}

subprojects { project ->
if (project.name == 'test-app' || project.name == 'readium') return
apply plugin: 'org.jetbrains.dokka'
tasks.named("dokkaGfmPartial") {
dokkaSourceSets {
configureEach {
reportUndocumented.set(false)
skipEmptyPackages.set(false)
skipDeprecated.set(true)
}
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

task cleanDocs(type: Delete) {
delete "${project.rootDir}/docs/readium", "${project.rootDir}/docs/index.md"
}

tasks.dokkaGfmMultiModule.configure {
outputDirectory = new File("${project.rootDir}/docs")
}
6 changes: 6 additions & 0 deletions docs/readium_colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
body {
--md-primary-fg-color: #449d44;
--md-primary-fg-color--light: #73b02c;
--md-primary-fg-color--dark: #255625;
--md-accent-fg-color: #73b02c;
}
59 changes: 59 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
site_name: Readium Kotlin

# Meta tags (placed in header)
site_description: Readium Kotlin is an Android library for rendering books
site_author: Readium Foundation
site_url: https://github.com/readium/kotlin-toolkit

# Repository (add link to repository on each page)
repo_name: kotlin-toolkit
repo_url: https://github.com/readium/kotlin-toolkit

# Copyright (shown at the footer)
copyright: 'Copyright © 2021 Readium Foundation'

# Material theme
theme:
name: 'material'
# favicon: favicon.svg
social:
- type: 'github'
link: 'https://github.com/readium/kotlin-toolkit'

# Extensions
markdown_extensions:
- admonition
- codehilite:
guess_lang: false
- footnotes
- meta
- def_list
- toc:
permalink: true
# - pymdownx.betterem:
# smart_enable: all
# - pymdownx.caret
# - pymdownx.inlinehilite
# - pymdownx.magiclink
# - pymdownx.smartsymbols
# - pymdownx.superfences

# Dev server binding
#dev_addr: 127.0.0.1:3001

nav:
- Home: migration-guide.md
- API Docs:
- Navigator: readium/navigator/index.md
- Shared: readium/shared/index.md
- Streamer: readium/streamer/index.md
- LCP: readium/lcp/index.md
- OPDS: readium/opds/index.md

extra_css:
- readium_colors.css

extra:
version:
provider: mike