add docs toc

master
Guillermo 8 years ago
parent debcb1cd7a
commit 905427fe95
  1. 45
      README.md

@ -44,12 +44,23 @@ Tesseract.recognize('#my-image')
## npm
### TODO
<!-- ```shell
> npm install tesseract-js ?
```-->
# Docs
walp
# Docs
* [Tesseract Remote File Options](#tesseract-remote-file-options)
+ [Tesseract.coreUrl](#tesseractcoreurl)
+ [Tesseract.workerUrl](#tesseractworkerurl)
+ [Tesseract.langUrl](#tesseractlangurl)
* [Tesseract.recognize(image: ImageLike[, options]) -> [TesseractJob](#tesseractjob)](#tesseractrecognizeimage-imagelike-options---tesseractjob)
+ [Simple Example:](#simple-example)
+ [More Complicated Example:](#more-complicated-example)
* [Tesseract.detect(image: ImageLike) -> [TesseractJob](#tesseractjob)](#tesseractdetectimage-imagelike---tesseractjob)
* [ImageLike](#imagelike)
* [TesseractJob](#tesseractjob)
+ [TesseractJob.progress(callback: function) -> TesseractJob](#tesseractjobprogresscallback-function---tesseractjob)
+ [TesseractJob.then(callback: function) -> TesseractJob](#tesseractjobthencallback-function---tesseractjob)
+ [TesseractJob.error(callback: function) -> TesseractJob](#tesseractjoberrorcallback-function---tesseractjob)
## Tesseract Remote File Options
### Tesseract.coreUrl
@ -81,14 +92,8 @@ Tesseract.recognize('#my-im', {
})
```
## ImageLike
The main Tesseract.js functions take an `image` parameter, which should be something that is 'image-like'.
That means `image` should be
- an `img` element or querySelector that matches an `img` element
- a `video` element or querySelector that matches a `video` element
- a `canvas` element or querySelector that matches a `canvas` element
- a CanvasRenderingContext2D (returned by `canvas.getContext('2d')`)
- the absolute `url` of an image from the same website that is running your script. Browser security policies don't allow access to the content of images from other websites :(
## Tesseract.recognize(image: [ImageLike](#imagelike)[, options]) -> [TesseractJob](#tesseractjob)
Figures out what words are in `image`, where the words are in `image`, etc.
@ -137,6 +142,15 @@ Tesseract.detect('#my-image')
```
## ImageLike
The main Tesseract.js functions take an `image` parameter, which should be something that is 'image-like'.
That means `image` should be
- an `img` element or querySelector that matches an `img` element
- a `video` element or querySelector that matches a `video` element
- a `canvas` element or querySelector that matches a `canvas` element
- a CanvasRenderingContext2D (returned by `canvas.getContext('2d')`)
- the absolute `url` of an image from the same website that is running your script. Browser security policies don't allow access to the content of images from other websites :(
## TesseractJob
A TesseractJob is an an object returned by a call to recognize or detect.
@ -248,4 +262,5 @@ After you've cloned the repo and run `npm install` as described in the [Developm
> npm run build
```
## Send us a Pull Request!
## Send us a Pull Request!
Thanks :)
Loading…
Cancel
Save