From 48821d50cad76a2ac0560dffcf058a96d936b8b7 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Tue, 23 Mar 2021 15:25:27 +0100 Subject: [PATCH] Move Guides to docs/guides directory (#96) * Move Guides to docs/guides directory * Rename sidebar * Fix api/ links * Update SETUP.mdx --- .github/ISSUE_TEMPLATE/BUG_REPORT.md | 2 +- README.md | 7 +++-- docs/docs/INDEX.mdx | 32 +++++++++++++++++++++ docs/docs/{ => guides}/ANIMATED.mdx | 0 docs/docs/{ => guides}/CAPTURING.mdx | 20 ++++++------- docs/docs/{ => guides}/DEVICES.mdx | 0 docs/docs/{ => guides}/ERRORS.mdx | 0 docs/docs/{ => guides}/FORMATS.mdx | 0 docs/docs/{ => guides}/FRAME_PROCESSORS.mdx | 0 docs/docs/{ => guides}/SETUP.mdx | 8 +++--- docs/docs/{ => guides}/TODO.md | 0 docs/docs/{ => guides}/TROUBLESHOOTING.mdx | 0 docs/docusaurus.config.js | 4 +-- docs/sidebars.js | 4 +-- docs/src/pages/index.js | 2 +- src/Camera.tsx | 6 ++-- src/CameraDevice.ts | 2 +- src/CameraError.ts | 4 +-- 18 files changed, 62 insertions(+), 29 deletions(-) create mode 100644 docs/docs/INDEX.mdx rename docs/docs/{ => guides}/ANIMATED.mdx (100%) rename docs/docs/{ => guides}/CAPTURING.mdx (61%) rename docs/docs/{ => guides}/DEVICES.mdx (100%) rename docs/docs/{ => guides}/ERRORS.mdx (100%) rename docs/docs/{ => guides}/FORMATS.mdx (100%) rename docs/docs/{ => guides}/FRAME_PROCESSORS.mdx (100%) rename docs/docs/{ => guides}/SETUP.mdx (94%) rename docs/docs/{ => guides}/TODO.md (100%) rename docs/docs/{ => guides}/TROUBLESHOOTING.mdx (100%) diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md index e6b04aa..7d5204c 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.md +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md @@ -12,7 +12,7 @@ assignees: '' Remember that you can use this project FOR FREE. Badly written issues are less likely to be picked up than well written ones. BEFORE creating an issue, make sure you tried everything in the TROUBLESHOOTING guide: - https://cuvent.github.io/react-native-vision-camera/docs/troubleshooting + https://cuvent.github.io/react-native-vision-camera/docs/guides/troubleshooting --> diff --git a/README.md b/README.md index be6754a..9580c54 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@

📸 The Camera library that sees the vision.


- + + +
@@ -23,7 +25,6 @@ -
@@ -35,7 +36,7 @@ ### Documentation -* [Guides](https://cuvent.github.io/react-native-vision-camera/docs/) +* [Guides](https://cuvent.github.io/react-native-vision-camera/docs/guides) * [API](https://cuvent.github.io/react-native-vision-camera/docs/api) * [Example](./example/) diff --git a/docs/docs/INDEX.mdx b/docs/docs/INDEX.mdx new file mode 100644 index 0000000..2c7791c --- /dev/null +++ b/docs/docs/INDEX.mdx @@ -0,0 +1,32 @@ +--- +id: index +title: Welcome to the VisionCamera documentation! +sidebar_label: Welcome +slug: / +--- + +import useBaseUrl from '@docusaurus/useBaseUrl'; + +
+ +
+ +**Quick Links** + +* [Guides](./guides/) +* [API](./api/) +* [Example](https://github.com/cuvent/react-native-vision-camera/tree/main/example) + + +
+ + + +
+ + + +
+ + + diff --git a/docs/docs/ANIMATED.mdx b/docs/docs/guides/ANIMATED.mdx similarity index 100% rename from docs/docs/ANIMATED.mdx rename to docs/docs/guides/ANIMATED.mdx diff --git a/docs/docs/CAPTURING.mdx b/docs/docs/guides/CAPTURING.mdx similarity index 61% rename from docs/docs/CAPTURING.mdx rename to docs/docs/guides/CAPTURING.mdx index 23ae6f7..0d0d7f0 100644 --- a/docs/docs/CAPTURING.mdx +++ b/docs/docs/guides/CAPTURING.mdx @@ -40,7 +40,7 @@ The most important actions are: ## Taking Photos -To take a photo, simply use the Camera's [`takePhoto(...)`](api/classes/camera.camera-1#takephoto) function: +To take a photo, simply use the Camera's [`takePhoto(...)`](../api/classes/camera.camera-1#takephoto) function: ```ts const photo = await camera.current.takePhoto({ @@ -48,9 +48,9 @@ const photo = await camera.current.takePhoto({ }) ``` -You can customize capture options such as [automatic red-eye reduction](api/interfaces/photofile.takephotooptions#enableautoredeyereduction), [automatic image stabilization](api/interfaces/photofile.takephotooptions#enableautostabilization), [combining images from constituent physical camera devices](api/interfaces/photofile.takephotooptions#enablevirtualdevicefusion) to create a single high quality fused image, [enable flash](api/interfaces/photofile.takephotooptions#flash), [prioritize speed over quality](api/interfaces/photofile.takephotooptions#qualityprioritization) and more using the `options` parameter. (See [`TakePhotoOptions`](api/interfaces/photofile.takephotooptions)) +You can customize capture options such as [automatic red-eye reduction](../api/interfaces/photofile.takephotooptions#enableautoredeyereduction), [automatic image stabilization](../api/interfaces/photofile.takephotooptions#enableautostabilization), [combining images from constituent physical camera devices](../api/interfaces/photofile.takephotooptions#enablevirtualdevicefusion) to create a single high quality fused image, [enable flash](../api/interfaces/photofile.takephotooptions#flash), [prioritize speed over quality](../api/interfaces/photofile.takephotooptions#qualityprioritization) and more using the `options` parameter. (See [`TakePhotoOptions`](../api/interfaces/photofile.takephotooptions)) -This function returns a [`PhotoFile`](api/interfaces/photofile.photofile-1) which contains a [`path`](api/interfaces/photofile.photofile-1#path) property you can display in your App using an `` or ``. +This function returns a [`PhotoFile`](../api/interfaces/photofile.photofile-1) which contains a [`path`](../api/interfaces/photofile.photofile-1#path) property you can display in your App using an `` or ``. :::note This will change with the upcoming React Native Re-Architecture, so that instead of writing a temporary file which you have to read again, this function will immediately return an Image HostObject on which you can directly interop with the underlying `UIImage`/`Bitmap` for faster image capture. See [issue #69](https://github.com/cuvent/react-native-vision-camera/issues/69) @@ -58,7 +58,7 @@ This will change with the upcoming React Native Re-Architecture, so that instead ### Taking Snapshots -Compared to iOS, Cameras on Android tend to be slower in image capture. If you care about speed, you can use the Camera's [`takeSnapshot(...)`](api/classes/camera.camera-1#takesnapshot) function (Android only) which simply takes a snapshot of the Camera View instead of actually taking a photo through the Camera lens. +Compared to iOS, Cameras on Android tend to be slower in image capture. If you care about speed, you can use the Camera's [`takeSnapshot(...)`](../api/classes/camera.camera-1#takesnapshot) function (Android only) which simply takes a snapshot of the Camera View instead of actually taking a photo through the Camera lens. ```ts const snapshot = await camera.current.takeSnapshot({ @@ -73,7 +73,7 @@ While taking Snapshots is faster than taking Photos, the resulting image has way ## Recording Videos -To start a video recording, use the Camera's [`startRecording(...)`](api/classes/camera.camera-1#startrecording) function: +To start a video recording, use the Camera's [`startRecording(...)`](../api/classes/camera.camera-1#startrecording) function: ```ts camera.current.startRecording({ @@ -83,29 +83,29 @@ camera.current.startRecording({ }) ``` -For any error that occured _while recording the video_, the `onRecordingError` callback will be invoked with a [`CaptureError`](api/classes/cameraerror.cameracaptureerror) and the recording is therefore cancelled. +For any error that occured _while recording the video_, the `onRecordingError` callback will be invoked with a [`CaptureError`](../api/classes/cameraerror.cameracaptureerror) and the recording is therefore cancelled. :::note Due to limitations of the React Native Bridge, this function can not be awaited. This means, any errors thrown while trying to start the recording (e.g. `capture/recording-in-progress`) can only be caught synchronously (`isBlockingSynchronousMethod`). This will change with the upcoming React Native Re-Architecture. ::: -To stop the video recording, you can call [`stopRecording(...)`](api/classes/camera.camera-1#stoprecording): +To stop the video recording, you can call [`stopRecording(...)`](../api/classes/camera.camera-1#stoprecording): ```ts await camera.current.stopRecording() ``` -Once a recording has been stopped, the `onRecordingFinished` callback passed to the `startRecording` function will be invoked with a [`VideoFile`](api/interfaces/videofile.videofile-1) which you can then use to display in a [`