Skip to content

Conversation

@mrhapile
Copy link

@mrhapile mrhapile commented Feb 3, 2026

This PR adds a comprehensive README for the wasmedge_ocr plugin to improve usability, discoverability, and contributor onboarding.

The documentation is based strictly on the current implementation and covers the full lifecycle of using the plugin—from build configuration to runtime usage—without introducing or assuming any new features.

Why this change is needed

  • The wasmedge_ocr plugin previously lacked any dedicated documentation, making it difficult for users and contributors to:
  • Understand the plugin’s OCR capabilities and limitations
  • Build WasmEdge with the plugin enabled
  • Correctly use the stateful OCR API
  • Interpret the TSV output produced by Tesseract
  • Avoid common misuse and runtime errors

Providing a complete README significantly improves developer experience and aligns this plugin with other well-documented WasmEdge plugins (e.g. wasm_bpf).

Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
Copilot AI review requested due to automatic review settings February 3, 2026 02:17
@mrhapile
Copy link
Author

mrhapile commented Feb 3, 2026

@hydai can you check again I have raised the plugin-ocr-docs pr in wasmedge docs repo where you asked

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive documentation for the wasmedge_ocr plug-in, which provides Optical Character Recognition capabilities to WasmEdge applications through integration with Tesseract OCR. The documentation addresses a gap where this plug-in previously lacked any dedicated user-facing documentation.

Changes:

  • Adds a complete README covering installation, build configuration, API reference, usage examples, and troubleshooting
  • Documents the plug-in's stateful OCR API, security considerations, and output format (TSV)
  • Provides detailed quick start guide, Rust code examples, and common pitfalls to help users avoid runtime errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

brew install tesseract leptonica
```

2. **Build Plugin**
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalization in section heading. The word "Plugin" should be "Plug-in" (hyphenated and lowercase 'l') to match the established convention in other plugin documentation files.

References:

  • docs/contribute/source/plugin/ebpf.md:9 ("Build the eBPF Plug-in")
  • docs/contribute/source/plugin/process.md:13 ("Build WasmEdge with WasmEdge-Process Plug-in")

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +67
> [!WARNING]
> **Security Notice**: This plugin accesses files on the **Host Filesystem** using direct paths provided by the Wasm module. This explicitly **bypasses the WASI sandbox** isolation. Only use this plugin with properly reviewed and trusted Wasm modules, as they can probe for files on your host system.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent admonition syntax. This documentation uses Docusaurus, which has a different syntax for admonitions. The GitHub-style alert syntax (> [!WARNING]) should be changed to Docusaurus-style admonition syntax for consistency with other documentation files.

The correct format should be:

:::warning
**Security Notice**: This plug-in accesses files on the **Host Filesystem** using direct paths provided by the Wasm module. This explicitly **bypasses the WASI sandbox** isolation. Only use this plug-in with properly reviewed and trusted Wasm modules, as they can probe for files on your host system.
:::

References:

  • docs/contribute/source/plugin/wasi_logging.md:10-13
  • docs/contribute/source/plugin/process.md:26-28

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,287 @@
# wasmedge_ocr Plugin
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename "README.md" is inconsistent with other plugin documentation files in this directory. All other plugin documentation files follow the pattern of using a descriptive name (e.g., "ebpf.md", "process.md", "rusttls.md", "wasi_logging.md"). This file should be renamed to "wasmedge_ocr.md" to follow the established convention in the codebase.

References:

  • docs/contribute/source/plugin/ebpf.md
  • docs/contribute/source/plugin/process.md
  • docs/contribute/source/plugin/rusttls.md
  • docs/contribute/source/plugin/wasi_logging.md

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,287 @@
# wasmedge_ocr Plugin
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing frontmatter metadata. All other plugin documentation files in this directory include YAML frontmatter with at least a "sidebar_position" field. This file should include the frontmatter at the top of the file (before line 1) to be consistent with the established pattern.

Example from other plugin docs:

---
sidebar_position: X
---

References:

  • docs/contribute/source/plugin/ebpf.md:1-3
  • docs/contribute/source/plugin/process.md:1-3
  • docs/contribute/source/plugin/wasi_logging.md:1-3

Copilot uses AI. Check for mistakes.
### Intended Use Cases
- Extracting text from artifacts (scanned documents, photos).
- Getting bounding box coordinates for text in images (layout analysis).
- processing images where the file resides on the host system.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalization. The word "processing" should be capitalized to match the style and parallel structure of the other items in this list.

Suggested change
- processing images where the file resides on the host system.
- Processing images where the file resides on the host system.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,287 @@
# wasmedge_ocr Plugin
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main title format is inconsistent with other plugin documentation files. Other plugin docs use titles that start with "Build..." (e.g., "Build with eBPF Plug-in", "Build WasmEdge With WasmEdge-Process Plug-in", "Build WasmEdge With WASI-Logging Plug-in"). This title should follow a similar pattern, such as "Build WasmEdge With wasmedge_ocr Plug-in" to maintain consistency.

References:

  • docs/contribute/source/plugin/ebpf.md:5
  • docs/contribute/source/plugin/process.md:5
  • docs/contribute/source/plugin/wasi_logging.md:5

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,287 @@
# wasmedge_ocr Plugin

The `wasmedge_ocr` plugin provides Optical Character Recognition (OCR) capabilities to WasmEdge applications by integrating with the Tesseract OCR engine. It allows WebAssembly modules to extract text and layout information from images located on the host filesystem.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent terminology. The established convention in this codebase is to use "plug-in" (hyphenated) when referring to plugins in descriptive text. The word "plugin" (unhyphenated) should be changed to "plug-in" throughout the document for consistency, except in technical contexts like environment variable names (WASMEDGE_PLUGIN_PATH), file paths, or code identifiers where the unhyphenated form is required.

References:

  • docs/contribute/source/plugin/ebpf.md:7
  • docs/contribute/source/plugin/process.md:7
  • docs/contribute/source/plugin/wasi_logging.md:6

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant