Skip to content

Commit 3b76e1b

Browse files
committed
update output example
1 parent 77c40e7 commit 3b76e1b

File tree

4 files changed

+23
-56
lines changed

4 files changed

+23
-56
lines changed

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npm i @capacitor/docgen --save-dev
1919
# My Capacitor Plugin 🔌
2020
2121
The readme file can be formatted however you'd like. Just insert
22-
the HTML placeholder comments where the Index of the API
22+
the HTML placeholder comments where the index of the API
2323
methods, and the API docs should go.
2424
2525
Below is an index of all the methods available.
@@ -38,11 +38,14 @@ HTML placeholder comments with the updated generated docs.
3838
3939
## Commit Your Readme 🚀
4040
41-
The benefit is that this readme file also acts as the landing page
42-
for Github and NPM, and the anchors within the docs can also be
43-
linked to and shared.
41+
The benefit of this readme file is that is also acts as the landing
42+
page for the Github repo and NPM package, and the anchors within the
43+
docs can also be linked to and shared.
4444
```
4545

46+
- [Example Readme Output](https://github.com/ionic-team/capacitor-docgen/blob/master/src/test/README.md)
47+
- [Example JSON Output](https://github.com/ionic-team/capacitor-docgen/blob/master/src/test/docs.json)
48+
4649

4750
## CLI
4851

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"release": "npm run build && np --no-2fa",
2222
"test": "jest",
2323
"test.watch": "jest --watchAll",
24-
"test.output": "node bin/docgen --project src/test/fixtures/tsconfig.json --api HapticsPlugin --output-readme src/test/fixtures/README.md --output-json src/test/fixtures/docs.json"
24+
"test.output": "node bin/docgen --project src/test/fixtures/tsconfig.json --api HapticsPlugin --output-readme src/test/README.md --output-json src/test/docs.json"
2525
},
2626
"license": "MIT",
2727
"files": [

src/test/fixtures/README.md src/test/README.md

+15-51
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
# My Capacitor Plugin 🔌
12

2-
# Haptics
3+
The readme file can be formatted however you'd like. Just insert
4+
the HTML placeholder comments where the index of the API
5+
methods, and the API docs should go.
36

4-
The Haptics API provides physical feedback to the user through touch or vibration.
7+
Below is an index of all the methods available.
58

69
<!--DOCGEN_INDEX_START-->
710
* [impact()](#impact)
@@ -12,56 +15,11 @@ The Haptics API provides physical feedback to the user through touch or vibratio
1215
* [Enums](#enums)
1316
<!--DOCGEN_INDEX_END-->
1417

15-
## Android Notes
18+
## Custom Content
1619

17-
To use vibration, you must add this permission to your `AndroidManifest.xml` file:
18-
19-
```xml
20-
<uses-permission android:name="android.permission.VIBRATE" />
21-
```
22-
23-
## Example
24-
25-
```typescript
26-
import {
27-
Plugins,
28-
HapticsImpactStyle
29-
} from '@capacitor/core';
30-
31-
const { Haptics } = Plugins;
32-
33-
export class HapticsExample {
34-
hapticsImpact(style = HapticsImpactStyle.Heavy) {
35-
Haptics.impact({
36-
style: style
37-
});
38-
}
39-
40-
hapticsImpactMedium(style) {
41-
this.hapticsImpact(HapticsImpactStyle.Medium);
42-
}
43-
44-
hapticsImpactLight(style) {
45-
this.hapticsImpact(HapticsImpactStyle.Light);
46-
}
47-
48-
hapticsVibrate() {
49-
Haptics.vibrate();
50-
}
51-
52-
hapticsSelectionStart() {
53-
Haptics.selectionStart();
54-
}
55-
56-
hapticsSelectionChanged() {
57-
Haptics.selectionChanged();
58-
}
59-
60-
hapticsSelectionEnd() {
61-
Haptics.selectionEnd();
62-
}
63-
}
64-
```
20+
Manage your readme content however you'd like, and on every docgen
21+
rebuild it will leave your original content as is, but update the
22+
HTML placeholder comments with the updated generated docs.
6523

6624
<!--DOCGEN_API_START-->
6725
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
@@ -198,3 +156,9 @@ Trigger a selection started haptic hint
198156

199157

200158
<!--DOCGEN_API_END-->
159+
160+
## Commit Your Readme 🚀
161+
162+
The benefit of this readme file is that is also acts as the landing
163+
page for the Github repo and NPM package, and the anchors within the
164+
docs can also be linked to and shared.
File renamed without changes.

0 commit comments

Comments
 (0)