Skip to content

Commit 15248ce

Browse files
committed
docs: Adapt mkdocs
1 parent 6b3f618 commit 15248ce

37 files changed

+402
-244
lines changed

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,11 @@ kotlin-js-store/yarn.lock
3939
webpack.config.d/
4040

4141
.kotlin/
42-
.run/iosSample.run.xml
42+
.run/iosSample.run.xml
43+
44+
# docs
45+
site/
46+
docs/index.md
47+
docs/index.zh.md
48+
docs/CHANGELOG.md
49+
docs/CHANGELOG.zh.md

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log
22

3-
Translations: [简体中文](CHANGELOG_zh.md)
3+
Translations: [简体中文](CHANGELOG.zh.md)
44

55
## 1.1.2
66

CHANGELOG_zh.md CHANGELOG.zh.md

File renamed without changes.

README.md

+16-20
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![License][license_image]][license_link]
77
[![version_icon]][version_link]
88

9-
Translations: [简体中文](README_zh.md)
9+
Translations: [简体中文](README.zh.md)
1010

1111
ZoomImage is an gesture zoom viewing of images library specially designed for Compose Multiplatform
1212
and Android View. It has the following features and functions:
@@ -48,13 +48,9 @@ https://github.com/panpf/zoomimage/assets/3250512/f067bed9-24e4-4ab8-a839-0731e1
4848

4949
## Sample App
5050

51-
* Android: Please go to the [Releases](https://github.com/panpf/zoomimage/releases) page to download
52-
the latest version of the installation package
53-
* Web: https://panpf.github.io/zoomimage/app
54-
* Desktop: Use [kdoctor] to check the running environment, and follow the prompts to install the
55-
required software, and then execute the `./package_desktop.sh` command in the project root
56-
directory to package. The installation package location is included in the output.
57-
* iOS: Please refer to the [Run Sample App](#Run-Sample-app) section to compile and run it yourself
51+
* For Android, iOS, desktop version, and web deployable packages, please go to
52+
the [Releases](https://github.com/panpf/zoomimage/releases) page to download.
53+
* Web example:https://panpf.github.io/zoomimage/app
5854

5955
## Download
6056

@@ -213,17 +209,17 @@ picassoZoomImageView.loadImage("https://sample.com/sample.jpeg")
213209

214210
## Document
215211

216-
* [Get Started](docs/wiki/getstarted.md)
217-
* [Scale: Scale the image to see clearer details](docs/wiki/scale.md)
218-
* [Offset: Move the image to see content outside the container](docs/wiki/offset.md)
219-
* [Rotate: Rotate the image to view content from different angles](docs/wiki/rotate.md)
220-
* [Locate: Locate anywhere in the image](docs/wiki/locate.md)
221-
* [Read Mode: Long images initially fill the screen for easy reading](docs/wiki/readmode.md)
222-
* [Click: Receive click events](docs/wiki/click.md)
223-
* [Subsampling: Display large images through subsampling to avoid OOM](docs/wiki/subsampling.md)
224-
* [Scroll Bar: Displays horizontal and vertical scroll bars](docs/wiki/scrollbar.md)
225-
* [Log: Modify log level and output pipeline](docs/wiki/log.md)
226-
* [Modifier.zoom()](docs/wiki/modifier_zoom.md)
212+
* [Get Started](docs/getting_started.md)
213+
* [Scale: Scale the image to see clearer details](docs/scale.md)
214+
* [Offset: Move the image to see content outside the container](docs/offset.md)
215+
* [Rotate: Rotate the image to view content from different angles](docs/rotate.md)
216+
* [Locate: Locate anywhere in the image](docs/locate.md)
217+
* [Read Mode: Long images initially fill the screen for easy reading](docs/readmode.md)
218+
* [Click: Receive click events](docs/click.md)
219+
* [Subsampling: Display large images through subsampling to avoid OOM](docs/subsampling.md)
220+
* [Scroll Bar: Displays horizontal and vertical scroll bars](docs/scrollbar.md)
221+
* [Log: Modify log level and output pipeline](docs/log.md)
222+
* [Modifier.zoom()](docs/modifier_zoom.md)
227223

228224
## Samples
229225

@@ -283,7 +279,7 @@ The following are my other open source projects. If you are interested, you can
283279

284280
Apache 2.0. See the [LICENSE](LICENSE.txt) file for details.
285281

286-
[logo_image]: docs/res/logo_mini.png
282+
[logo_image]: docs/images/logo_mini.png
287283

288284
[platform_image]: https://img.shields.io/badge/Platform-Android-brightgreen.svg
289285

README_zh.md README.zh.md

+16-18
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ https://github.com/panpf/zoomimage/assets/3250512/f067bed9-24e4-4ab8-a839-0731e1
3838

3939
## 示例 App
4040

41-
* Android:请到 [Releases](https://github.com/panpf/zoomimage/releases) 页面下载最新版本的安装包
42-
* Web:https://panpf.github.io/zoomimage/app
43-
* 桌面:使用 [kdoctor] 检查运行环境,并按照提示安装需要的软件,然后在项目根目录执行
44-
`./package_desktop.sh` 命令打包,安装包位置包含在输出中
45-
* iOS:请参考 [运行示例 App](#运行示例-app) 部分自行编译运行
41+
* Android、iOS、桌面版、Web 可部署包请到 [Releases](https://github.com/panpf/zoomimage/releases)
42+
页面下载最新版本
43+
* Web 示例:https://panpf.github.io/zoomimage/app
4644

4745
## 下载
4846

@@ -199,17 +197,17 @@ picassoZoomImageView.loadImage("https://sample.com/sample.jpeg")
199197

200198
## 文档
201199

202-
* [开始使用](docs/wiki/getstarted_zh.md)
203-
* [Scale: 缩放图片以查看更清晰的细节](docs/wiki/scale_zh.md)
204-
* [Offset: 移动图片以查看容器之外的内容](docs/wiki/offset_zh.md)
205-
* [Rotate: 旋转图片以不同角度查看内容](docs/wiki/rotate_zh.md)
206-
* [Locate: 定位到图片的任意位置](docs/wiki/locate_zh.md)
207-
* [Read Mode: 长图初始时充满屏幕方便阅读](docs/wiki/readmode_zh.md)
208-
* [Click: 接收点击事件](docs/wiki/click_zh.md)
209-
* [Subsampling: 通过子采样的方式显示大图避免 OOM](docs/wiki/subsampling_zh.md)
210-
* [Scroll Bar: 显示水平和垂直滚动条](docs/wiki/scrollbar_zh.md)
211-
* [Log: 修改日志等级以及输出管道](docs/wiki/log_zh.md)
212-
* [Modifier.zoom()](docs/wiki/modifier_zoom_zh.md)
200+
* [开始使用](docs/getting_started.zh.md)
201+
* [Scale: 缩放图片以查看更清晰的细节](docs/scale.zh.md)
202+
* [Offset: 移动图片以查看容器之外的内容](docs/offset.zh.md)
203+
* [Rotate: 旋转图片以不同角度查看内容](docs/rotate.zh.md)
204+
* [Locate: 定位到图片的任意位置](docs/locate.zh.md)
205+
* [Read Mode: 长图初始时充满屏幕方便阅读](docs/readmode.zh.md)
206+
* [Click: 接收点击事件](docs/click.zh.md)
207+
* [Subsampling: 通过子采样的方式显示大图避免 OOM](docs/subsampling.zh.md)
208+
* [Scroll Bar: 显示水平和垂直滚动条](docs/scrollbar.zh.md)
209+
* [Log: 修改日志等级以及输出管道](docs/log.zh.md)
210+
* [Modifier.zoom()](docs/modifier_zoom.zh.md)
213211

214212
## 示例
215213

@@ -218,7 +216,7 @@ picassoZoomImageView.loadImage("https://sample.com/sample.jpeg")
218216

219217
## 更新日志
220218

221-
请查看 [CHANGELOG](CHANGELOG_zh.md) 文件
219+
请查看 [CHANGELOG](CHANGELOG.zh) 文件
222220

223221
## 测试平台
224222

@@ -260,7 +258,7 @@ picassoZoomImageView.loadImage("https://sample.com/sample.jpeg")
260258

261259
Apache 2.0. 有关详细信息,请参阅 [LICENSE](LICENSE.txt) 文件.
262260

263-
[logo_image]: docs/res/logo_mini.png
261+
[logo_image]: docs/images/logo_mini.png
264262

265263
[platform_image]: https://img.shields.io/badge/Platform-Android-brightgreen.svg
266264

build_docs.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# Exit immediately if a command exits with a non-zero status.
4+
set -e
5+
6+
cp README.md docs/index.md
7+
cp README.zh.md docs/index.zh.md
8+
cp CHANGELOG.md docs/CHANGELOG.md
9+
cp CHANGELOG.zh.md docs/CHANGELOG.zh.md
10+
11+
perl -pi -e 's|\(README.zh.md\)|\(index.zh.md\)|g' docs/index.md
12+
perl -pi -e 's|\(LICENSE.txt\)|\(../LICENSE.txt\)|g' docs/index.md
13+
perl -pi -e 's|\(docs/|\(|g' docs/index.md
14+
perl -pi -e 's|]: docs/|]: |g' docs/index.md
15+
perl -pi -e 's|]: zoomimage-|]: ../zoomimage-|g' docs/index.md
16+
17+
perl -pi -e 's|\(README.md\)|\(index.md\)|g' docs/index.zh.md
18+
perl -pi -e 's|\(LICENSE.txt\)|\(../LICENSE.txt\)|g' docs/index.zh.md
19+
perl -pi -e 's|\(docs/|\(|g' docs/index.zh.md
20+
perl -pi -e 's|]: docs/|]: |g' docs/index.zh.md
21+
perl -pi -e 's|]: zoomimage-|]: ../zoomimage-|g' docs/index.zh.md
22+
23+
perl -pi -e 's|\(docs/|\(|g' docs/CHANGELOG.md
24+
perl -pi -e 's|\(docs/|\(|g' docs/CHANGELOG.zh.md
25+
26+
find docs -type f -name "*.md" -exec perl -pi -e 's|]: ../|]: https://github.com/panpf/zoomimage/blob/main/|g' {} +
27+
find docs -type f -name "*.md" -exec perl -pi -e 's|\(../|\(https://github.com/panpf/zoomimage/blob/main/|g' {} +
28+
29+
mkdocs build
30+
31+
git checkout -- docs
32+
git clean -f -d docs

docs/wiki/click.md docs/click.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Click Events
22

3-
Translations: [简体中文](click_zh.md)
3+
Translations: [简体中文](click.zh.md)
44

55
> [!TIP]
66
> * The following example takes precedence over the Compose version component for demonstration
@@ -45,8 +45,8 @@ sketchZoomImageView.onViewLongPressListener = { view: android.view.View, x: Floa
4545
}
4646
```
4747

48-
[ZoomImageView]: ../../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
48+
[ZoomImageView]: ../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
4949

50-
[ZoomImage]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
50+
[ZoomImage]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
5151

52-
[ZoomState]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/ZoomState.kt
52+
[ZoomState]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/ZoomState.kt

docs/wiki/click_zh.md docs/click.zh.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ sketchZoomImageView.onViewLongPressListener = { view: android.view.View, x: Floa
4444
}
4545
```
4646

47-
[ZoomImageView]: ../../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
47+
[ZoomImageView]: ../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
4848

49-
[ZoomImage]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
49+
[ZoomImage]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
5050

51-
[ZoomState]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/ZoomState.kt
51+
[ZoomState]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/ZoomState.kt

docs/wiki/getstarted.md docs/getting_started.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Get Started
22

3-
Translations: [简体中文](getstarted_zh.md)
3+
Translations: [简体中文](getting_started.zh.md)
44

55
## Components
66

@@ -44,7 +44,7 @@ Android view:
4444

4545
> [!TIP]
4646
> * Different components need to import different dependencies, please refer
47-
to [README](../../README.md#download) to import the corresponding dependencies*
47+
to [README](../README.md#download) to import the corresponding dependencies*
4848
> * Components with integrated image loaders can support image and subsampling from any source
4949
without any additional work
5050
> * Components that do not integrate an image loader can only display local images and require an
@@ -61,7 +61,7 @@ val zoomState: ZoomState by rememberZoomState()
6161
LaunchedEffect(zoomState.subsampling) {
6262
val resUri = Res.getUri("files/huge_world.jpeg")
6363
val imageSource = ImageSource.fromComposeResource(resUri)
64-
zoomState.setSubsamplingImage(imageSource)
64+
zoomState.setSubsamplingImage(imageSource)
6565
}
6666
ZoomImage(
6767
painter = painterResource(Res.drawable.huge_world_thumbnail),
@@ -229,41 +229,41 @@ val subsampling: SubsamplingEngine = sketchZoomImageView.subsampling
229229
* [Log: Modify log level and output pipeline](log.md)
230230
* [Modifier.zoom()](modifier_zoom.md)
231231

232-
[ZoomImage]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
232+
[ZoomImage]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
233233

234-
[CoilZoomAsyncImage]: ../../zoomimage-compose-coil3/src/commonMain/kotlin/com/github/panpf/zoomimage/SingletonCoilZoomAsyncImage.kt
234+
[CoilZoomAsyncImage]: ../zoomimage-compose-coil3/src/commonMain/kotlin/com/github/panpf/zoomimage/SingletonCoilZoomAsyncImage.kt
235235

236-
[GlideZoomAsyncImage]: ../../zoomimage-compose-glide/src/main/kotlin/com/github/panpf/zoomimage/GlideZoomAsyncImage.kt
236+
[GlideZoomAsyncImage]: ../zoomimage-compose-glide/src/main/kotlin/com/github/panpf/zoomimage/GlideZoomAsyncImage.kt
237237

238-
[SketchZoomAsyncImage]: ../../zoomimage-compose-sketch4/src/commonMain/kotlin/com/github/panpf/zoomimage/SingletonSketchZoomAsyncImage.kt
238+
[SketchZoomAsyncImage]: ../zoomimage-compose-sketch4/src/commonMain/kotlin/com/github/panpf/zoomimage/SingletonSketchZoomAsyncImage.kt
239239

240-
[ZoomImageSample]: ../../sample/src/commonMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/BasicZoomImageSample.kt
240+
[ZoomImageSample]: ../sample/src/commonMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/BasicZoomImageSample.kt
241241

242-
[CoilZoomAsyncImageSample]: ../../sample/src/commonMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/CoilZoomAsyncImageSample.common.kt
242+
[CoilZoomAsyncImageSample]: ../sample/src/commonMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/CoilZoomAsyncImageSample.common.kt
243243

244-
[GlideZoomAsyncImageSample]: ../../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/GlideZoomAsyncImageSample.kt
244+
[GlideZoomAsyncImageSample]: ../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/GlideZoomAsyncImageSample.kt
245245

246-
[SketchZoomAsyncImageSample]: ../../sample/src/commonMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/SketchZoomAsyncImageSample.kt
246+
[SketchZoomAsyncImageSample]: ../sample/src/commonMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/SketchZoomAsyncImageSample.kt
247247

248-
[ZoomImageView]: ../../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
248+
[ZoomImageView]: ../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
249249

250-
[CoilZoomImageView]: ../../zoomimage-view-coil3-core/src/main/kotlin/com/github/panpf/zoomimage/CoilZoomImageView.kt
250+
[CoilZoomImageView]: ../zoomimage-view-coil3-core/src/main/kotlin/com/github/panpf/zoomimage/CoilZoomImageView.kt
251251

252-
[GlideZoomImageView]: ../../zoomimage-view-glide/src/main/kotlin/com/github/panpf/zoomimage/GlideZoomImageView.kt
252+
[GlideZoomImageView]: ../zoomimage-view-glide/src/main/kotlin/com/github/panpf/zoomimage/GlideZoomImageView.kt
253253

254-
[PicassoZoomImageView]: ../../zoomimage-view-picasso/src/main/kotlin/com/github/panpf/zoomimage/PicassoZoomImageView.kt
254+
[PicassoZoomImageView]: ../zoomimage-view-picasso/src/main/kotlin/com/github/panpf/zoomimage/PicassoZoomImageView.kt
255255

256-
[SketchZoomImageView]: ../../zoomimage-view-sketch4-core/src/main/kotlin/com/github/panpf/zoomimage/SketchZoomImageView.kt
256+
[SketchZoomImageView]: ../zoomimage-view-sketch4-core/src/main/kotlin/com/github/panpf/zoomimage/SketchZoomImageView.kt
257257

258-
[ZoomImageViewFragment]: ../../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/BasicZoomImageViewFragment.kt
258+
[ZoomImageViewFragment]: ../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/BasicZoomImageViewFragment.kt
259259

260-
[CoilZoomImageViewFragment]: ../../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/CoilZoomImageViewFragment.kt
260+
[CoilZoomImageViewFragment]: ../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/CoilZoomImageViewFragment.kt
261261

262-
[GlideZoomImageViewFragment]: ../../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/GlideZoomImageViewFragment.kt
262+
[GlideZoomImageViewFragment]: ../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/GlideZoomImageViewFragment.kt
263263

264-
[PicassoZoomImageViewFragment]: ../../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/PicassoZoomImageViewFragment.kt
264+
[PicassoZoomImageViewFragment]: ../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/PicassoZoomImageViewFragment.kt
265265

266-
[SketchZoomImageViewFragment]: ../../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/SketchZoomImageViewFragment.kt
266+
[SketchZoomImageViewFragment]: ../sample/src/androidMain/kotlin/com/github/panpf/zoomimage/sample/ui/examples/SketchZoomImageViewFragment.kt
267267

268268
[Sketch]: https://github.com/panpf/sketch
269269

@@ -279,16 +279,16 @@ val subsampling: SubsamplingEngine = sketchZoomImageView.subsampling
279279

280280
[Picasso]: https://github.com/square/picasso
281281

282-
[ZoomableState]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/zoom/ZoomableState.kt
282+
[ZoomableState]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/zoom/ZoomableState.kt
283283

284-
[SubsamplingState]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/subsampling/SubsamplingState.kt
284+
[SubsamplingState]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/subsampling/SubsamplingState.kt
285285

286-
[ZoomableEngine]: ../../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/view/zoom/ZoomableEngine.kt
286+
[ZoomableEngine]: ../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/view/zoom/ZoomableEngine.kt
287287

288-
[SubsamplingEngine]: ../../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/view/subsampling/SubsamplingEngine.kt
288+
[SubsamplingEngine]: ../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/view/subsampling/SubsamplingEngine.kt
289289

290-
[ZoomImageView]: ../../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
290+
[ZoomImageView]: ../zoomimage-view/src/main/kotlin/com/github/panpf/zoomimage/ZoomImageView.kt
291291

292-
[ZoomImage]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
292+
[ZoomImage]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/ZoomImage.kt
293293

294-
[ZoomState]: ../../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/ZoomState.kt
294+
[ZoomState]: ../zoomimage-compose/src/commonMain/kotlin/com/github/panpf/zoomimage/compose/ZoomState.kt

0 commit comments

Comments
 (0)