Skip to content

Commit d5b33de

Browse files
authored
feat(docs): multiple versions of docs (#165)
### Description * Adds versions capability to docs through [versions-select plugin](https://github.com/prescottprue/gitbook-plugin-verions-select) * Simplifies pull request template * Fixes typo causing error while building gitbook (`objectivec` instead of `objc` for prism plugin) ### Check List - [X] All tests passing - [X] Docs updated with any changes or examples - [X] Added tests to ensure feature(s) work properly ### Relevant Issues * #154 * #162
1 parent 42e8f47 commit d5b33de

File tree

8 files changed

+427
-87
lines changed

8 files changed

+427
-87
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
### Description
22

3-
<!-- Write Your Description Here -->
4-
5-
### Questions
6-
<!-- Only include questions that apply to your pull request -->
3+
<!-- Write Your Description Here ^ -->
4+
<!-- Some things that may be of interest to address:
75
- Will a new version need to be released or is this a docs change?
8-
- Which version should this be published as a part of? ("ASAP", "no idea", and specific version number)
9-
6+
- Which version should this be published as a part of? ("ASAP", "no idea", and specific version number)
107
- Does this impact the external API?
11-
- Will it need to be a breaking change?
8+
- Will it need to be a breaking change? -->
129

1310
### Check List
11+
If not relevant to pull request, check off as complete
1412

1513
- [ ] All tests passing
1614
- [ ] Docs updated with any changes or examples
1715
- [ ] Added tests to ensure feature(s) work properly
1816

1917
### Relevant Issues
20-
<!-- List Relevant Issues here like so:
21-
* [#1](https://github.com/prescottprue/react-redux-firebase/issues/#1)
22-
-->
18+
<!-- List Relevant Issues here -->
19+
<!-- * #1 -->

book.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"gitbook": ">=3.2.1",
33
"title": "React Redux Firebase",
4-
"plugins": ["edit-link", "prism", "-highlight", "github", "anchorjs"],
4+
"plugins": ["edit-link", "prism", "-highlight", "github", "anchorjs", "versions-select"],
55
"pluginsConfig": {
66
"edit-link": {
77
"base": "https://github.com/prescottprue/react-redux-firebase/tree/master",
@@ -14,6 +14,19 @@
1414
"styles": {
1515
"website": "build/gitbook.css"
1616
}
17+
},
18+
"versions": {
19+
"gitbookConfigURL": "https://raw.githubusercontent.com/prescottprue/react-redux-firebase/v2.0.0/book.json",
20+
"options": [
21+
{
22+
"value": "http://docs.react-redux-firebase.com/history/v1.4.0/",
23+
"text": "Version 1.4.0"
24+
},
25+
{
26+
"value": "http://docs.react-redux-firebase.com/history/v2.0.0/",
27+
"text": "Version 2.0.0"
28+
}
29+
]
1730
}
1831
}
1932
}

docs/api/compose.md

Lines changed: 381 additions & 18 deletions
Large diffs are not rendered by default.

docs/api/connect.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2-
3-
### Table of Contents
4-
5-
- [firebaseConnect](#firebaseconnect)
6-
7-
## firebaseConnect
1+
# firebaseConnect
82

93
**Extends React.Component**
104

@@ -13,7 +7,6 @@ to provided firebase paths using React's Lifecycle hooks.
137

148
**Parameters**
159

16-
- `dataOrFn` (optional, default `[]`)
1710
- `watchArray` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of objects or strings for paths to sync from Firebase. Can also be a function that returns the array. The function is passed the current props and the firebase object.
1811

1912
**Examples**

docs/api/constants.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2-
3-
### Table of Contents
4-
5-
- [actionsPrefix](#actionsprefix)
6-
- [actionTypes](#actiontypes)
7-
8-
## actionsPrefix
1+
# actionsPrefix
92

103
Prefix for all actions within library
114

12-
Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
13-
145
**Examples**
156

167
```javascript
178
import { constants } from 'react-redux-firebase'
189
constants.actionsPrefix === '@@reactReduxFirebase' // true
1910
```
2011

21-
## actionTypes
12+
# actionTypes
2213

2314
Object containing all action types
2415

@@ -50,7 +41,7 @@ import { actionTypes } from 'react-redux-firebase'
5041
actionTypes.SET === '@@reactReduxFirebase/SET' // true
5142
```
5243

53-
##
44+
# defaultConfig
5445

5546
Default configuration options
5647

docs/api/helpers.md

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2-
3-
### Table of Contents
4-
5-
- [isLoaded](#isloaded)
6-
- [isEmpty](#isempty)
7-
- [toJS](#tojs)
8-
- [pathToJS](#pathtojs)
9-
- [dataToJS](#datatojs)
10-
- [orderedToJS](#orderedtojs)
11-
- [customToJS](#customtojs)
12-
13-
## isLoaded
1+
# isLoaded
142

153
Detect whether items are loaded yet or not
164

@@ -28,14 +16,14 @@ import { firebaseConnect, isLoaded, dataToJS } from 'react-redux-firebase'
2816

2917
Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not item is loaded
3018

31-
## isEmpty
19+
# isEmpty
3220

3321
Detect whether items are empty or not
3422

3523
**Parameters**
3624

37-
- `data`
3825
- `item` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Item to check loaded status of. A comma seperated list is also acceptable.
26+
- `data`
3927

4028
**Examples**
4129

@@ -47,7 +35,7 @@ import { firebaseConnect, isEmpty, dataToJS } from 'react-redux-firebase'
4735

4836
Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether or not item is empty
4937

50-
## toJS
38+
# toJS
5139

5240
Convert Immutable Map to a Javascript object
5341

@@ -59,16 +47,16 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
5947

6048
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map
6149

62-
## pathToJS
50+
# pathToJS
6351

6452
Convert parameter from Immutable Map to a Javascript object
6553

6654
**Parameters**
6755

56+
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
6857
- `data`
6958
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path from state.firebase to convert to JS object
7059
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to use if data is not available
71-
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
7260

7361
**Examples**
7462

@@ -81,19 +69,19 @@ import { firebaseConnect, pathToJS } from 'react-redux-firebase'
8169

8270
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map
8371

84-
## dataToJS
72+
# dataToJS
8573

8674
Convert parameter under "data" path of Immutable Map to a Javascript object.
8775
**NOTE:** Setting a default value will cause `isLoaded` to always return true
8876

8977
**Parameters**
9078

79+
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
9180
- `data`
9281
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
9382
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not
9483
found in redux. This will cause `isLoaded` to always return true (since
9584
value is set from the start).
96-
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
9785

9886
**Examples**
9987

@@ -118,17 +106,17 @@ const defaultValue = {
118106

119107
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map
120108

121-
## orderedToJS
109+
# orderedToJS
122110

123111
Convert parameter under "ordered" path of Immutable Map to a
124112
Javascript array. This preserves order set by query.
125113

126114
**Parameters**
127115

116+
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
128117
- `data`
129118
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
130119
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not found
131-
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
132120

133121
**Examples**
134122

@@ -141,14 +129,15 @@ import { firebaseConnect, orderedToJS } from 'react-redux-firebase'
141129

142130
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map
143131

144-
##
132+
# populatedDataToJS
145133

146134
Convert parameter under "data" path of Immutable Map to a
147135
Javascript object with parameters populated based on populates array
148136

149137
**Parameters**
150138

151139
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
140+
- `data`
152141
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
153142
- `populates` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array of populate objects
154143
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not found
@@ -177,18 +166,18 @@ export default connect(({ firebase }) => ({
177166

178167
Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Data located at path within Immutable Map
179168

180-
## customToJS
169+
# customToJS
181170

182171
Load custom object from within store
183172

184173
**Parameters**
185174

186-
- `data`
175+
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
187176
- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Path of parameter to load
177+
- `customPath` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Part of store from which to load
178+
- `data`
188179
- `custom`
189180
- `notSetValue` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))** Value to return if value is not found
190-
- `firebase` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Immutable Map to be converted to JS object (state.firebase)
191-
- `customPath` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Part of store from which to load
192181

193182
**Examples**
194183

docs/api/reducer.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2-
3-
### Table of Contents
4-
5-
- [firebaseStateReducer](#firebasestatereducer)
6-
7-
## firebaseStateReducer
1+
# firebaseStateReducer
82

93
Reducer for react redux firebase. This function is called
104
automatically by redux every time an action is fired. Based on which action
@@ -13,8 +7,8 @@ changes.
137

148
**Parameters**
159

16-
- `state` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Current Redux State (optional, default `initialState`)
17-
- `action` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Action which will modify state (optional, default `{}`)
10+
- `state` **[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)** Current Redux State
11+
- `action` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Action which will modify state
1812
- `action.type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of Action being called
1913
- `action.data` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of Action which will modify state
2014

docs/recipes/react-native.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ We are going to use the project name Devshare for example here. For your project
236236

237237
1. Make sure you import `RNGoogleSignin.h` in your `AppDelegate.m` like so:
238238

239-
```objc
239+
```objectivec
240240
// add this line before @implementation AppDelegate
241241
#import <RNGoogleSignin/RNGoogleSignin.h>
242242

@@ -259,7 +259,7 @@ Only one `openURL` method can be defined, so if you have multiple listeners whic
259259
260260
**AppDelegate.m:**
261261
262-
```objc
262+
```objectivec
263263
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
264264
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
265265

0 commit comments

Comments
 (0)