Skip to content

Commit

Permalink
docs: Use docgen to generate plugin docs from type definitions (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Apr 22, 2024
1 parent 4fd9491 commit 405b9e7
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 2 deletions.
77 changes: 76 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@ No configuration required for this plugin
| openEditorChoicePage ||||
| search ||||

## Usage
<docgen-index>

- [`openStoreListing(...)`](#openstorelisting)
- [`openDevPage(...)`](#opendevpage)
- [`openCollection(...)`](#opencollection)
- [`openEditorChoicePage(...)`](#openeditorchoicepage)
- [`search(...)`](#search)

</docgen-index>

## Example

```typescript
import { NativeMarket } from "@capacitor-community/native-market";
Expand Down Expand Up @@ -114,3 +124,68 @@ NativeMarket.search({
terms: "capacitor",
});
```

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### openStoreListing(...)

```typescript
openStoreListing(options: { appId: string; }) => Promise<void>
```

| Param | Type |
| ------------- | ------------------------------- |
| **`options`** | <code>{ appId: string; }</code> |

---

### openDevPage(...)

```typescript
openDevPage(options: { devId: string; }) => Promise<void>
```

| Param | Type |
| ------------- | ------------------------------- |
| **`options`** | <code>{ devId: string; }</code> |

---

### openCollection(...)

```typescript
openCollection(options: { name: string; }) => Promise<void>
```

| Param | Type |
| ------------- | ------------------------------ |
| **`options`** | <code>{ name: string; }</code> |

---

### openEditorChoicePage(...)

```typescript
openEditorChoicePage(options: { editorChoice: string; }) => Promise<void>
```

| Param | Type |
| ------------- | -------------------------------------- |
| **`options`** | <code>{ editorChoice: string; }</code> |

---

### search(...)

```typescript
search(options: { terms: string; }) => Promise<void>
```

| Param | Type |
| ------------- | ------------------------------- |
| **`options`** | <code>{ terms: string; }</code> |

---

</docgen-api>
51 changes: 51 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
"verify:android": "cd android && ./gradlew clean build test && cd ..",
"verify:web": "npm run build",
"build": "npm run clean && tsc",
"build": "npm run clean && npm run docgen && tsc",
"clean": "rimraf ./dist",
"docgen": "docgen --api NativeMarketPlugin --output-readme README.md",
"watch": "tsc --watch",
"prepublishOnly": "npm run build",
"npm-publish": "np --no-tests"
Expand All @@ -21,6 +22,7 @@
"devDependencies": {
"@capacitor/android": "^6.0.0",
"@capacitor/cli": "^6.0.0",
"@capacitor/docgen": "^0.2.2",
"@capacitor/ios": "^6.0.0",
"@types/node": "^15.14.9",
"husky": "^4.2.5",
Expand Down

0 comments on commit 405b9e7

Please sign in to comment.