Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jenly1314 committed Aug 18, 2024
1 parent 7b87512 commit 9a49743
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 27 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
ij_continuation_indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{kt, kts}]
ij_kotlin_imports_layout = *
56 changes: 56 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: docs

on:
push:
branches:
- master

env:
JAVA_VERSION: 17
PYTHON_VERSION: 3.x
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

permissions:
contents: write
id-token: write
pages: write

jobs:
docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install MkDocs Material
run: pip install mkdocs-material

- name: Generate Docs
run: ./build_docs.sh

- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
8 changes: 4 additions & 4 deletions change_log.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 版本记录
## 版本日志

#### v2.2.1:2024-8-8
* 优化细节
Expand All @@ -18,8 +18,8 @@
* 更新ViewfinderView至v1.1.0

#### v2.0.0:2023-8-13
* 移除相机核心库(**mlkit-camera-core**),改为依赖[CameraScan](https://github.com/jenly1314/CameraScan)
* 移除**mlkit-barcode-scanning** 中的 **ViewfinderView**,改为依赖[ViewfinderView](https://github.com/jenly1314/ViewfinderView)
* 移除相机核心库(mlkit-camera-core),改为依赖[CameraScan](https://github.com/jenly1314/CameraScan)
* 移除mlkit-barcode-scanning中的 **ViewfinderView** ,改为依赖[ViewfinderView](https://github.com/jenly1314/ViewfinderView)
* 优化扫描分析过程的性能体验
* 更新MLKit相关依赖库版本

Expand Down Expand Up @@ -62,4 +62,4 @@
* 优化细节

#### v1.0.0:2021-4-7
* MLKit初始版本
* MLKit初始版本
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,39 +103,39 @@ Camera:为各个子库提供相机预览分析的核心库
2. 在Module的 **build.gradle** 里面添加引入依赖项

```gradle
//公共库 (*必须)
//公共库 (*必须)
implementation 'com.github.jenly1314.MLKit:mlkit-common:2.2.1'
//--------------------------
//条码识别 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-barcode-scanning:2.2.1'
//人脸检测 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-face-detection:2.2.1'
//人脸网格检测 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-face-mesh-detection:2.2.1'
//图像标签 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-image-labeling:2.2.1'
//对象检测 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-object-detection:2.2.1'
//姿势检测 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-pose-detection:2.2.1'
//姿势检测精确版 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-pose-detection-accurate:2.2.1'
//自拍分割 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-segmentation-selfie:2.2.1'
//文字识别 (可选)
implementation 'com.github.jenly1314.MLKit:mlkit-text-recognition:2.2.1'
```

### 温馨提示
Expand All @@ -146,7 +146,7 @@ Camera:为各个子库提供相机预览分析的核心库
> 使用 **v2.0.x** 以上版本时,要求 **compileSdkVersion >= 33**
> 如果 **compileSdkVersion < 33** 请使用 [**v1.x版本**](https://github.com/jenly1314/MLKit/tree/1.x/)
> 如果 **compileSdkVersion < 33** 请使用 [**v1.x版本**](https://github.com/jenly1314/MLKit/tree/1.x/)
## 使用

Expand Down Expand Up @@ -196,7 +196,7 @@ Camera:为各个子库提供相机预览分析的核心库
* 2D格式:Aztec, Data Matrix, PDF417, QR Code

```kotlin
BarcodeDecoder.process(bitmap).addOnSuccessListener(this) {
BarcodeDecoder.process(bitmap).addOnSuccessListener(this) {
if (it.isNotEmpty()) {
// TODO 成功;此处可获取识别的结果
} else {
Expand Down Expand Up @@ -288,7 +288,7 @@ BarcodeDecoder.process(bitmap).addOnSuccessListener(this) {
android:value="barcode,face,ocr" />
```

更多使用详情,请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jitpack.io/com/github/jenly1314/MLKit/latest/javadoc/)
更多使用详情,请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jenly1314.github.io/MLKit/api/)

### 其他

Expand All @@ -298,9 +298,9 @@ BarcodeDecoder.process(bitmap).addOnSuccessListener(this) {

```gradle
defaultConfig {
//...
ndk {
//设置支持的 SO 库架构(开发者可以根据需要,选择一个或多个平台的 so)
abiFilters 'armeabi-v7a' // , 'arm64-v8a', 'x86', 'x86_64'
Expand All @@ -326,7 +326,9 @@ compileOptions {
#### [CameraScan](https://github.com/jenly1314/CameraScan) 一个简化扫描识别流程的通用基础库。
#### [ViewfinderView](https://github.com/jenly1314/ViewfinderView) ViewfinderView一个取景视图:主要用于渲染扫描相关的动画效果。

## 版本记录
<!-- end -->

## 版本日志

#### v2.2.1:2024-8-8
* 优化细节
Expand All @@ -346,8 +348,8 @@ compileOptions {
* 更新ViewfinderView至v1.1.0

#### v2.0.0:2023-8-13
* 移除相机核心库(**mlkit-camera-core**),改为依赖[CameraScan](https://github.com/jenly1314/CameraScan)
* 移除**mlkit-barcode-scanning** 中的 **ViewfinderView**,改为依赖[ViewfinderView](https://github.com/jenly1314/ViewfinderView)
* 移除相机核心库(mlkit-camera-core),改为依赖[CameraScan](https://github.com/jenly1314/CameraScan)
* 移除mlkit-barcode-scanning中的 **ViewfinderView** ,改为依赖[ViewfinderView](https://github.com/jenly1314/ViewfinderView)
* 优化扫描分析过程的性能体验
* 更新MLKit相关依赖库版本

Expand All @@ -357,7 +359,7 @@ compileOptions {
* 更新MLKit相关依赖库版本
* 更新CameraX至v1.2.2

#### [查看更多版本记录](change_log.md)
#### [查看更多版本日志](CHANGELOG.md)

## 赞赏

Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ plugins {
id 'com.android.application' version '8.1.2' apply false
id 'com.android.library' version '8.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'org.jetbrains.dokka' version '1.9.20'
id 'com.vanniktech.maven.publish' version '0.25.3' apply false
}
}


24 changes: 24 additions & 0 deletions build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -ex

# Generate the API docs
./gradlew dokkaHtmlMultiModule

mkdir -p docs/api
mv build/dokka/htmlMultiModule/* docs/api

# Copy in special files that GitHub wants in the project root.
GITHUB_URL=https://github.com/jenly1314/MLKit/
echo $GITHUB_URL
sed "/<!-- end -->/q" README.md > docs/index.md
sed -i "s|app/src/main/ic_launcher-web.png|ic_logo.png|g" docs/index.md
sed -i "s|](app|](${GITHUB_URL}blob/master/app|g" docs/index.md
sed -i "s|](mlkit|](${GITHUB_URL}blob/master/mlkit|g" docs/index.md
cat CHANGELOG.md | grep -v '## 版本日志' > docs/changelog.md

cp GIF.gif docs/GIF.gif
cp app/src/main/ic_launcher-web.png docs/ic_logo.png

# Build the site locally
mkdocs build
86 changes: 86 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Project information
site_name: MLKit
site_url: https://jenly1314.github.io/MLKit/
site_description: "MLKit for Android"
site_author: Jenly
remote_branch: gh-pages
edit_uri: ""

# Repository
repo_name: MLKit
repo_url: https://github.com/jenly1314/MLKit

# Copyright
copyright: 'Copyright &copy; 2016 - 2024 Jenly'

# Configuration
theme:
name: 'material'
favicon: https://jenly1314.github.io/favicon.png
logo: https://jenly1314.github.io/medias/logo.png
icon:
repo: fontawesome/brands/github
language: zh
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: teal
accent: blue
toggle:
icon: octicons/sun-24
name: "切换到深色模式"
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: teal
accent: blue
toggle:
icon: octicons/moon-24
name: "切换到浅色模式"
features:
- navigation.instant
- navigation.instant.progress
- navigation.tabs
- content.code.copy

extra:
social:
- icon: material/home-circle
link: https://jenly1314.github.io/
- icon: simple/github
link: https://github.com/jenly1314/
- icon: simple/gitee
link: https://gitee.com/jenly1314/
- icon: fontawesome/solid/paper-plane
link: mailto:[email protected]

markdown_extensions:
- smarty
- footnotes
- meta
- toc:
permalink: true
- attr_list
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tilde
- pymdownx.tabbed:
alternate_style: true
- tables

# Plugins
plugins:
- search

nav:
- '概览': index.md
- 'API文档': api/index.html
- '版本日志': changelog.md

2 changes: 2 additions & 0 deletions mlkit-barcode-scanning/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
2 changes: 2 additions & 0 deletions mlkit-common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
2 changes: 2 additions & 0 deletions mlkit-face-detection/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
2 changes: 2 additions & 0 deletions mlkit-face-mesh-detection/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
2 changes: 2 additions & 0 deletions mlkit-image-labeling/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
2 changes: 2 additions & 0 deletions mlkit-object-detection/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
2 changes: 2 additions & 0 deletions mlkit-pose-detection-accurate/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
Loading

0 comments on commit 9a49743

Please sign in to comment.