Skip to content

Commit

Permalink
Merge pull request #177 from victorperin/feat/docs-in-html
Browse files Browse the repository at this point in the history
Feat: docs in html
  • Loading branch information
victorperin authored Jun 12, 2021
2 parents 9fa8ab4 + 6207895 commit 7f3787a
Show file tree
Hide file tree
Showing 6 changed files with 628 additions and 43 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build Docs
on:
workflow_run:
workflows: ['on-release']
branches: [master]
types:
- completed

jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2

- name: Use NodeJS 15.x
uses: actions/setup-node@v1
with:
node-version: 15.x

- name: Use cached node_modules
uses: actions/cache@v2
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm ci

- name: Build JS files
run: npm run build

- name: Build docs
run: npm run build:doc:web

- name: Publish docs
run: npm run publish:docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
bin
coverage
.nyc_output
docs-web
22 changes: 12 additions & 10 deletions docs/interfaces/bitmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

# Interface: Bitmap

## Hierarchy

* **Bitmap**

## Table of contents

### Properties
Expand All @@ -18,22 +14,28 @@

### data

**data**: *Buffer*
**data**: `Buffer`

#### Defined in

Defined in: node_modules/@jimp/core/types/etc.d.ts:75
node_modules/@jimp/core/types/etc.d.ts:75

___

### height

**height**: *number*
**height**: `number`

Defined in: node_modules/@jimp/core/types/etc.d.ts:77
#### Defined in

node_modules/@jimp/core/types/etc.d.ts:77

___

### width

**width**: *number*
**width**: `number`

#### Defined in

Defined in: node_modules/@jimp/core/types/etc.d.ts:76
node_modules/@jimp/core/types/etc.d.ts:76
58 changes: 34 additions & 24 deletions docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@

### Flags

Ƭ **Flags**: { `clear?`: *boolean* ; `clipboard?`: *boolean* ; `open?`: *boolean* }
Ƭ **Flags**: `Object`

#### Type declaration:
#### Type declaration

Name | Type |
------ | ------ |
`clear?` | *boolean* |
`clipboard?` | *boolean* |
`open?` | *boolean* |
| Name | Type |
| :------ | :------ |
| `clear?` | `boolean` |
| `clipboard?` | `boolean` |
| `open?` | `boolean` |

Defined in: [src/cli/flags.ts:13](https://github.com/victorperin/qr-scanner-cli/blob/ca28358/src/cli/flags.ts#L13)
#### Defined in

[src/cli/flags.ts:1](https://github.com/victorperin/qr-scanner-cli/blob/2f818b9/src/cli/flags.ts#L1)

## Functions

### scanFromBitmap

`Const`**scanFromBitmap**(`bitmap`: [*Bitmap*](interfaces/bitmap.md), `flags?`: [*Flags*](modules.md#flags)): *Promise*<*string*\>
`Const` **scanFromBitmap**(`bitmap`, `flags?`): `Promise`<string\>

You can pass a jimp Bitmap, this functions reads it's content and tries to find a QR Code, returning it's result
```javascript
Expand All @@ -47,39 +49,47 @@ const bitmap = Jimp.read('./image.jpg')
const value = await scanFromBitmap(bitmap)
```

#### Parameters:
#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `bitmap` | [Bitmap](interfaces/bitmap.md) | A Bitmap object |
| `flags?` | [Flags](modules.md#flags) | |

Name | Type | Description |
------ | ------ | ------ |
`bitmap` | [*Bitmap*](interfaces/bitmap.md) | A Bitmap object |
`flags?` | [*Flags*](modules.md#flags) | |
#### Returns

**Returns:** *Promise*<*string*\>
`Promise`<string\>

Value read from the QR Code inside the image

Defined in: [src/pipelines/scanFromBitmap.ts:20](https://github.com/victorperin/qr-scanner-cli/blob/ca28358/src/pipelines/scanFromBitmap.ts#L20)
#### Defined in

[src/pipelines/scanFromBitmap.ts:20](https://github.com/victorperin/qr-scanner-cli/blob/2f818b9/src/pipelines/scanFromBitmap.ts#L20)

___

### scanFromFile

`Const`**scanFromFile**(`filePath`: *string*, `flags?`: [*Flags*](modules.md#flags)): *Promise*<*string*\>
`Const` **scanFromFile**(`filePath`, `flags?`): `Promise`<string\>

This function reads a file, get it's bitmap, searches and read a qrcode from it.
```javascript
const value = await scanFromFile('./image.jpg')
```

#### Parameters:
#### Parameters

Name | Type | Description |
------ | ------ | ------ |
`filePath` | *string* | A file path for an image file containing a QR Code |
`flags?` | [*Flags*](modules.md#flags) | |
| Name | Type | Description |
| :------ | :------ | :------ |
| `filePath` | `string` | A file path for an image file containing a QR Code |
| `flags?` | [Flags](modules.md#flags) | |

**Returns:** *Promise*<*string*\>
#### Returns

`Promise`<string\>

Value read from the QR Code inside the image

Defined in: [src/pipelines/scanFromFile.ts:17](https://github.com/victorperin/qr-scanner-cli/blob/ca28358/src/pipelines/scanFromFile.ts#L17)
#### Defined in

[src/pipelines/scanFromFile.ts:17](https://github.com/victorperin/qr-scanner-cli/blob/2f818b9/src/pipelines/scanFromFile.ts#L17)
Loading

0 comments on commit 7f3787a

Please sign in to comment.