@@ -16,12 +16,9 @@ function writePage(page) {
16
16
renderIntro ( page ) ,
17
17
renderSalesCTA ( page ) ,
18
18
renderInstallation ( page ) ,
19
- // renderProperties(page),
20
- // renderEvents(page),
21
- // renderMethods(page),
22
- // renderParts(page),
23
- // renderCustomProps(page),
24
- // renderSlots(page)
19
+ renderSupportedPlatforms ( page ) ,
20
+ renderCapIncompat ( page ) ,
21
+ renderUsage ( page ) ,
25
22
] . join ( "" ) ;
26
23
27
24
const path = `docs/native/plugins/${ page . packageName . replace ( '@ionic-native/' , '' ) } .md` ;
@@ -84,28 +81,66 @@ function renderInstallation({cordovaPlugin, packageName}) {
84
81
<a href="#installation">Installation</a>
85
82
</h2>
86
83
<Tabs defaultValue="Capacitor" values={[
87
- {value: 'Capacitor', label: 'CAPACITOR '},
88
- {value: 'Cordova', label: 'CORDOVA '},
89
- {value: 'Enterprise', label: 'ENTERPRISE '},
84
+ {value: 'Capacitor', label: 'Capacitor '},
85
+ {value: 'Cordova', label: 'Cordova '},
86
+ {value: 'Enterprise', label: 'Enterprise '},
90
87
]}>
91
88
<TabItem value="Capacitor">
92
- <CodeBlock>
93
- npm install ${ cordovaPlugin . name }
94
- npm install ${ packageName }
95
- ionic cap sync
89
+ <CodeBlock className="language-shell" >
90
+ $ npm install ${ cordovaPlugin . name } {"\\n" }
91
+ $ npm install ${ packageName } {"\\n" }
92
+ $ ionic cap sync
96
93
</CodeBlock>
97
94
</TabItem>
98
95
<TabItem value="Cordova">
99
- <CodeBlock>
100
- ionic cordova plugin add ${ cordovaPlugin . name }
101
- npm install ${ packageName }
96
+ <CodeBlock className="language-shell" >
97
+ $ ionic cordova plugin add ${ cordovaPlugin . name } {"\\n" }
98
+ $ npm install ${ packageName } {"\\n" }
102
99
</CodeBlock>
103
100
</TabItem>
104
101
<TabItem value="Enterprise">
105
102
<blockquote>Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team.
106
103
<a class="btn" href="https://ionic.io/docs/premier-plugins">Learn More</a> or if you're interested in an enterprise version of this plugin <a class="btn" href="https://ionicframework.com/sales?product_of_interest=Ionic%20Enterprise%20Engine">Contact Us</a></blockquote>
107
104
</TabItem>
108
105
</Tabs>
109
- `
106
+ `
110
107
}
111
108
109
+ function renderSupportedPlatforms ( { platforms} ) {
110
+ return `
111
+ ## Supported Platforms
112
+
113
+ ${ platforms . map ( platform => `- ${ platform } ` ) . join ( '\n' ) }
114
+ ` ;
115
+ }
116
+
117
+ function renderCapIncompat ( { capacitorIncompatible} ) {
118
+ if ( ! capacitorIncompatible ) {
119
+ return null ;
120
+ }
121
+
122
+ return `
123
+ ## Capacitor
124
+
125
+ Not Compatible
126
+ ` ;
127
+ }
128
+
129
+ function renderUsage ( { usage} ) {
130
+ if ( ! usage ) {
131
+ return null ;
132
+ }
133
+
134
+ return `
135
+ ## Usage
136
+
137
+ ### React
138
+
139
+ [Learn more about using Ionic Native components in React](/docs/native/community#react)
140
+
141
+
142
+ ### Angular
143
+
144
+ ${ usage . replace ( / < / g, '<' ) }
145
+ ` ;
146
+ }
0 commit comments