From bac73fffca095cf256aa6e05ca20abca04313b07 Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Tue, 21 Jun 2016 17:17:55 -0700 Subject: [PATCH 1/3] Remove Polyfills section from sidebar Some of these will be in basics, guides and apis instead. One less layer of confusion. Note: APIs are not totally alphabetical any longer -- but neither were Polyfills. We can fix that in `extractDocs.js` maybe. But not worth doing in this pull request, imho. --- docs/Accessibility.md | 2 +- docs/Basics-Component-ListView.md | 2 +- docs/Colors.md | 3 ++- docs/Images.md | 2 +- docs/Network.md | 8 ++++---- docs/Timers.md | 4 ++-- website/server/extractDocs.js | 21 +++++++-------------- 7 files changed, 18 insertions(+), 24 deletions(-) diff --git a/docs/Accessibility.md b/docs/Accessibility.md index 0c5f110689b357..a1807b10842af7 100644 --- a/docs/Accessibility.md +++ b/docs/Accessibility.md @@ -4,7 +4,7 @@ title: Accessibility layout: docs category: Guides permalink: docs/accessibility.html -next: direct-manipulation +next: timers --- ## Native App Accessibility (iOS and Android) diff --git a/docs/Basics-Component-ListView.md b/docs/Basics-Component-ListView.md index 15c556a4ef60e1..f3eb1f08b4d828 100644 --- a/docs/Basics-Component-ListView.md +++ b/docs/Basics-Component-ListView.md @@ -4,7 +4,7 @@ title: ListView layout: docs category: Basics permalink: docs/basics-component-listview.html -next: basics-integration-with-existing-apps +next: basics-network --- On mobile devices, lists are a core element in many applications. The [`ListView`](/react-native/docs/listview.html#content) component is a special type of [`View`](/react-native/docs/basics-component-view.html) that displays a *vertically* scrolling list of changing, but similarly structured, data. diff --git a/docs/Colors.md b/docs/Colors.md index aba269085a2b22..0aa18a825475da 100644 --- a/docs/Colors.md +++ b/docs/Colors.md @@ -2,8 +2,9 @@ id: colors title: Colors layout: docs -category: Polyfills +category: Guides permalink: docs/colors.html +next: gesture-responder-system --- The following formats are supported: diff --git a/docs/Images.md b/docs/Images.md index f00363c1695b36..48250afb343138 100644 --- a/docs/Images.md +++ b/docs/Images.md @@ -4,7 +4,7 @@ title: Images layout: docs category: Guides permalink: docs/images.html -next: gesture-responder-system +next: colors --- ## Static Image Resources diff --git a/docs/Network.md b/docs/Network.md index 1d1d99f8a34f66..17668045f46b11 100644 --- a/docs/Network.md +++ b/docs/Network.md @@ -1,10 +1,10 @@ --- -id: network +id: basics-network title: Network layout: docs -category: Polyfills +category: Basics permalink: docs/network.html -next: timers +next: basics-integration-with-existing-apps --- One of React Native's goals is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change anything, we tried to be as faithful as possible to the browser APIs. The networking stack is a great example. @@ -122,7 +122,7 @@ request.open('GET', 'https://mywebsite.com/endpoint.php'); request.send(); ``` -You can also use - +You can also use - ```js var request = new XMLHttpRequest(); diff --git a/docs/Timers.md b/docs/Timers.md index 282946814e0503..ad0fe0e06090d5 100644 --- a/docs/Timers.md +++ b/docs/Timers.md @@ -2,9 +2,9 @@ id: timers title: Timers layout: docs -category: Polyfills +category: Guides permalink: docs/timers.html -next: colors +next: direct-manipulation --- Timers are an important part of an application and React Native implements the [browser timers](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Timers). diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index e9cdc20559898c..b28acfb54668f9 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -151,6 +151,7 @@ function shouldDisplayInSidebar(componentName) { } function getNextComponent(idx) { + console.log(all[idx]); if (all[idx + 1]) { const nextComponentName = getNameFromPath(all[idx + 1]); @@ -159,9 +160,8 @@ function getNextComponent(idx) { } else { return getNextComponent(idx + 1); } - } else { - return 'network'; } + return null; } function componentsToMarkdown(type, json, filepath, idx, styles) { @@ -185,8 +185,8 @@ function componentsToMarkdown(type, json, filepath, idx, styles) { json.methods = json.methods.filter(filterMethods); } - // Put Flexbox into the Polyfills category - const category = (type === 'style' ? 'Polyfills' : type + 's'); + // Put styles (e.g. Flexbox) into the API category + const category = (type === 'style' ? 'apis' : type + 's'); const next = getNextComponent(idx); const res = [ @@ -499,6 +499,7 @@ const apis = [ '../Libraries/Components/Clipboard/Clipboard.js', '../Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js', '../Libraries/Utilities/Dimensions.js', + '../Libraries/Geolocation/Geolocation.js', '../Libraries/Components/Intent/IntentAndroid.android.js', '../Libraries/Interaction/InteractionManager.js', '../Libraries/LayoutAnimation/LayoutAnimation.js', @@ -529,14 +530,9 @@ const stylesForEmbed = [ '../Libraries/Image/ImageStylePropTypes.js', ]; -const polyfills = [ - '../Libraries/Geolocation/Geolocation.js', -]; - const all = components .concat(apis) - .concat(stylesWithPermalink) - .concat(polyfills); + .concat(stylesWithPermalink); const styleDocs = stylesForEmbed.reduce(function(docs, filepath) { docs[path.basename(filepath).replace(path.extname(filepath), '')] = @@ -560,9 +556,6 @@ module.exports = function() { apis.map((filepath) => { return renderAPI(filepath, 'api'); }), - stylesWithPermalink.map(renderStyle), - polyfills.map((filepath) => { - return renderAPI(filepath, 'Polyfill'); - }) + stylesWithPermalink.map(renderStyle) ); }; From ff7bf564bd2660cfd813916e9c85025afa8a771e Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Tue, 21 Jun 2016 17:56:44 -0700 Subject: [PATCH 2/3] Rename Network.md to Basics-Network.md --- docs/{Network.md => Basics-Network.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{Network.md => Basics-Network.md} (100%) diff --git a/docs/Network.md b/docs/Basics-Network.md similarity index 100% rename from docs/Network.md rename to docs/Basics-Network.md From 060015b6aa75769b7bfefc887bb0882a71f3f9c2 Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Wed, 22 Jun 2016 08:15:36 -0700 Subject: [PATCH 3/3] Remove debugging line and change guide ordering a bit --- docs/Colors.md | 2 +- docs/Images.md | 2 +- docs/Style.md | 2 +- website/server/extractDocs.js | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/Colors.md b/docs/Colors.md index 0aa18a825475da..9d863adfaac170 100644 --- a/docs/Colors.md +++ b/docs/Colors.md @@ -4,7 +4,7 @@ title: Colors layout: docs category: Guides permalink: docs/colors.html -next: gesture-responder-system +next: images --- The following formats are supported: diff --git a/docs/Images.md b/docs/Images.md index 48250afb343138..f00363c1695b36 100644 --- a/docs/Images.md +++ b/docs/Images.md @@ -4,7 +4,7 @@ title: Images layout: docs category: Guides permalink: docs/images.html -next: colors +next: gesture-responder-system --- ## Static Image Resources diff --git a/docs/Style.md b/docs/Style.md index fb6cb7a6dc077a..53fcb6eeae5119 100644 --- a/docs/Style.md +++ b/docs/Style.md @@ -4,7 +4,7 @@ title: Style layout: docs category: Guides permalink: docs/style.html -next: images +next: colors --- React Native doesn't implement CSS but instead relies on JavaScript to let you style your application. This has been a controversial decision and you can read through those slides for the rationale behind it. diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index b28acfb54668f9..b199ef4cadc7d0 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -151,7 +151,6 @@ function shouldDisplayInSidebar(componentName) { } function getNextComponent(idx) { - console.log(all[idx]); if (all[idx + 1]) { const nextComponentName = getNameFromPath(all[idx + 1]);