Summary:
Fixed#12327
- Run the website locally
- Navigate to: http://localhost:8079/react-native/docs/statusbar.html
- Click the StatusBarAnimation and the StatusBarStyle in the Method section
- The links will now go to the correct in page anchor tags instead of the getting started page
The `website/layout/*.js` files could use some serious love. I would really like the opportunity to do that with the react team I run. Let me know :)
Closes https://github.com/facebook/react-native/pull/14028
Differential Revision: D5478418
Pulled By: hramos
fbshipit-source-id: b565847da3c280466ed088fd820b5bfe0474bba0
Summary:
These examples used to be part of the UIExplorer app, which will be renamed to RNTester in #13606. These bits of code have not been treated as examples for a long time, and are actually part of our testing infra. Let's remove them altogether from the API/Components docs.
Closes https://github.com/facebook/react-native/pull/13664
Differential Revision: D4960725
Pulled By: hramos
fbshipit-source-id: a4ec19b81d992aff89c0c93e35a1b80fbbd5e454
Summary:
These examples work sporadically, and are all based on a years-old build of UIExplorer that was once uploaded to Appetize. As a result, newer APIs such as FlatList are not supported and attempting to run their associated examples will result in an error.
<img width="526" alt="screen shot 2017-04-24 at 12 21 31 pm" src="https://cloud.githubusercontent.com/assets/165856/25348155/57016f4a-28eb-11e7-92b0-a918ef1a0e5c.png">
This PR removes the prompts to run the examples.
See #13644 for exploration into using `<SnackPlayer>` for these.
Fixes#12300
Closes https://github.com/facebook/react-native/pull/13644
Differential Revision: D4939653
Pulled By: hramos
fbshipit-source-id: 11cf564d2ceb1981d3ce700aaae40dc873b183ad
Summary:
Some of the operations, like `oneOf` and `arrayOf`, were doing joins on arrays of potential
tags, like `<span>` or `<a>`, which would stringify them to `[object Object]`.
This introduces a new `spanJoinMapper` which suppresses the trailing separator like `join` but wraps
elements in `<span>` rather than `concat`ing into a string.
Latest master is pretty broken:
{F66059444}
Nested `color` and some other props were broken even before https://github.com/facebook/react-native/commit/a7a3922b89d821b9a34d26bdcc7676e747a2716
{F66059446}
All fixed in this diff:
{F66059445}
Reviewed By: mkonicek
Differential Revision: D4670441
fbshipit-source-id: ddc10f13b3bdc6a1e799fa06a4e206f8dbd08769
Summary:
The RunningOnDeviceAndroid doc had some Linux-specific instructions that are not relevant to macOS/Windows users.
Closes https://github.com/facebook/react-native/pull/10726
Differential Revision: D4139089
Pulled By: JoelMarcey
fbshipit-source-id: cc57c1d7e3c9dec94e123c3597ac78b3efb15dd0
Summary:
This reverts a change in #10660 that swapped the locations of the prev/next links across the entire site. It made sense in the blog, but not so much in the docs.
Closes https://github.com/facebook/react-native/pull/10753
Differential Revision: D4133501
Pulled By: lacker
fbshipit-source-id: 92ee35b1bd5575401e548f8290db3fb7cf0f56a1
Summary:
The goal of this PR is to place greater emphasis on the blog as a destination.
The dark Hero from the landing page is now present in the blog as well, and the content is front and center.
The sidebar has been removed. It is not necessary to show a list of recent blog posts in the sidebar when the blog landing page shows the same number of posts along with short excerpts.
The prev/next links have swapped positions, and will now display "Older posts" and "Newer posts".
The excerpts have been stripped of formatting and they are now consistent across the blog landing page and the OpenGraph metatags. Fixes#10597.
A signup form for the new React Native newsletter has been added to the footer.
Newsletter signup form in footer:
![screencapture-localhost-8079-react-native-1477944030909](https://cloud.githubusercontent.com/assets/165856/19869614/4bb035aa-9f6a-11e6-9b8e-e0333417f423.png)
Blog landing page:
![screencapture-localhost-8079-r
Closes https://github.com/facebook/react-native/pull/10660
Differential Revision: D4117034
Pulled By: bestander
fbshipit-source-id: 215f966008fdf5c8870ed28d92384034a0d23c39
Summary:
We have gathered enough data to determine whether our docs direction
was the right approach.
Closes https://github.com/facebook/react-native/pull/10071
Differential Revision: D3914445
Pulled By: hramos
fbshipit-source-id: 64bd507d3ac6dda5dd1b5c1be611c7a71a278ffd
Summary:
Duplicate of #9552 which failed to land internally.
Closes https://github.com/facebook/react-native/pull/9796
Differential Revision: D3896927
Pulled By: hramos
fbshipit-source-id: 98d60827b72a272331d4d4287be4726cca0c4422
Summary:
This fixes an issue that would have arised once our number of blog posts passed 10, as the prev/next links in the footer were using the wrong path ("jest/", instead of "react-native/").
I also capped the number of recent blog posts to 10 in the sidebar.
Closes https://github.com/facebook/react-native/pull/9670
Differential Revision: D3819973
Pulled By: mkonicek
fbshipit-source-id: 321fe99654e10a4ad3e0815540518c8e9202385f
Summary:
Several blog and sharing improvements are included in this update.
* A larger default preview image is used when a blog post or doc is shared on social media as recommended by [best practices](https://developers.facebook.com/docs/sharing/best-practices#images).
* Follow other Facebook Sharing best practices such as associating the site with a Facebook Page (React) and a Page Admin (121800083 is my fbid, and I am an admin for the React page).
* If the shared blog post contains a hero image, use it as a share preview image.
* Use actual doc content instead of generic site description when sharing docs.
* Update existing hero images to use the larger recommended size.
* Add titles to each author's byline.
* Add author's avatar to their byline.
* Add Twitter Card support.
* Link to individual blog posts from the title and hero image in the blog index.
Old metadata tags (blog post):
```
<meta property="og:title" content="Toward Better Documentation – React Native | A framework for building native
Closes https://github.com/facebook/react-native/pull/9648
Differential Revision: D3790332
Pulled By: hramos
fbshipit-source-id: 4f284c6440482df8a42a2b8467ccf56b1fd725d1
Summary:
Linkify the blog post title when the excerpt is displayed in the blog index.
Update Facebook OpenGraph meta tags for individual blog posts to fix sharing previews.
Closes https://github.com/facebook/react-native/pull/9590
Differential Revision: D3771630
Pulled By: bestander
fbshipit-source-id: dc428ecc2d7939c143f000b8af9d4df9b512d0fc
Summary:
Updated the blog's styling to make it more readable.
* BlogPageLayout (blog index) - Only excerpts from each article are now shown, as opposed to the entire article.
* BlogPost - Broken up into headers, footers. Reorder header so that the blog post title is closer to the content. Adds support for hero images (visible from the blog index). Adds Facebook, Twitter social share buttons. List items are properly spaced now.
Blog index:
![screencapture-localhost-8079-react-native-blog-1471905976431](https://cloud.githubusercontent.com/assets/165856/17874405/4ee4fc22-6880-11e6-8344-2ed823f6000e.png)
Single blog post:
![screencapture-localhost-8079-react-native-blog-2016-08-12-react-native-meetup-san-francisco-html-1471905997923](https://cloud.githubusercontent.com/assets/165856/17874407/52af9e7a-6880-11e6-99f0-91f90331aced.png)
Closes https://github.com/facebook/react-native/pull/9532
Differential Revision: D3758524
Pulled By: bestander
fbshipit-source-id: 6385a3e98a3a44343c3b1d3105a32023b748c2c6
Summary:
We've been getting a lot of documentation PRs opened against `0.29-stable`, `0.30-stable`, and so on, instead of `master`. This is because our doc site is also based on RN release cuts, so clicking on the "Edit on GitHub" links on a document will take you to the markdown source for that release branch instead of the latest doc on `master`.
See #9095 for an example of such a PR.
In this PR we edit the link to say View on GitHub. Though it may not prevent PRs from being opened against a release branch, removing the "Edit" CTA may help in this regard.
Closes https://github.com/facebook/react-native/pull/9149
Differential Revision: D3664368
Pulled By: vjeux
fbshipit-source-id: 395c0813f736bfbe1be4b4fb1182f9060169365d
Summary:
The link to `'ShadowPropTypesIOS'` in `View` and `Image` docs is broken since RN0.29
Closes https://github.com/facebook/react-native/pull/8814
Differential Revision: D3628978
Pulled By: lacker
fbshipit-source-id: b233e191d1e1e0731cd5b2fe33287d68aa12e041
Summary:
We did a survey prior to the doc lockdown to get an idea of what we should focus on. Now we have a yes/no style survey to ensure that we met the user needs when it came to our start of improving the docs.
This diff adds the survey link to the bottom of each page. And we will cherry-pick it into 0.29 as well, which will be the first official release with the new doc content
> **NOTE**: The content via the links in this survey will not be valid until 0.29 is actually released. So I have not enabled the questions for the survey until then.
**Test Plan:**
http://localhost:8079/react-native/docs/getting-started.html
<img width="753" alt="screenshot 2016-07-01 17 35 17" src="https://cloud.githubusercontent.com/assets/3757713/16535354/987dd3a8-3fb4-11e6-81b7-1a1fcffd3bb2.png">
Closes https://github.com/facebook/react-native/pull/8530
Differential Revision: D3515242
Pulled By: JoelMarcey
fbshipit-source-id: c2d241d472853dfb3f9e7d3ae9560b318aacb866
Summary:
And more delineated from other parts of the method
information.
Hopefully this makes it easier to parse through.
Closes https://github.com/facebook/react-native/pull/8421
Differential Revision: D3488251
Pulled By: JoelMarcey
fbshipit-source-id: 44f2ed00b16849396cac94fd46567eaab48c50f3
Summary:
Relates to #8203 for AsyncStorage API update.
- Added a small example to the intro section.
- Added jsdoc format tags to show up class description, parameter descriptions.
- Word-smithed many of the method descriptions.
I also made a bug fix to the autogen. It wasn't handling the scenario where a method may have no parameters.
**Test plan (required)**
Wrote a small sample app to test the snippet added to the intro section.
Ran website locally: http://localhost:8079/react-native/docs/asyncstorage.html
![api_asyncstorage](https://cloud.githubusercontent.com/assets/691109/16329457/84f9d69c-3997-11e6-9e68-3a475df90377.png)
Ran changed files through the linter.
Closes https://github.com/facebook/react-native/pull/8396
Differential Revision: D3481783
Pulled By: JoelMarcey
fbshipit-source-id: ebc4b9695482ada8a3455e621534d2a7fb11edf4
Summary:
Right now the embedded simulator is always at the top right corner.
This can be confusing as to what code is associated with the simulation.
So, move the simulator next to its actual code.
This has the added benefit of allowing us to use the React Native
Web Player for the simpler examples in the components.
Closes https://github.com/facebook/react-native/pull/8384
Differential Revision: D3479056
Pulled By: bestander
fbshipit-source-id: f400d8387ec771b94d5e798c1e955b25f9a0f1bf
Summary:
As part of improving the API and Component reference docs #8154 this pull request adds the following:
- jsdoc support for API docs. See the AlertIOS changes as an example.
- type definitions support and added to both API and Component docs. This is supported via react-docgen and jsdoc.
- better formatting of method properties (now shown in a table).
FYI, API and Component docs were previously generated in two different ways. Components were using react-docgen and that basically remains as-is. APIs were using custom parsing code and that's been switched to use a jsdoc parser + react-docgen as an option for typedefs (it could also use the jsdoc parser).
Two docs have been updated to showcase how we'd like the new docs to look:
- AlertIOS (API): showing method parameters, examples, typedefs, more details overall.
- Statusbar (Component): showing method parameters, typedefs, more details overall.
**Note**: To convert new API docs to use the new format, add `jsdoc` to the initial file comment. C
Closes https://github.com/facebook/react-native/pull/8196
Differential Revision: D3465037
Pulled By: lacker
fbshipit-source-id: 78415d44bc5be02db802f5b1f7a0b249689abdf7
Summary:
We have enough responses now and we are in the lockdown for improving the documentation.
We can add another "did we improve?" survey after lockdown sometime.
Closes https://github.com/facebook/react-native/pull/8260
Differential Revision: D3463284
Pulled By: JoelMarcey
fbshipit-source-id: f2d585a8aa6308de0cce0bea3974b1e7f14d5a6f
Summary:Appetize asked for this so they can better support us, since they will usually have more simulators available for the latest versions.
Closes https://github.com/facebook/react-native/pull/7061
Differential Revision: D3196110
Pulled By: mkonicek
fb-gh-sync-id: 2406ab6e1ee352f0148957e851d7f483a2182f90
fbshipit-source-id: 2406ab6e1ee352f0148957e851d7f483a2182f90
Summary:The website now displays public methods on components. This was implemented mostly in react-docgen via #66. This adds a <Method> component that is used by the component and API doc pages to display documentation for a method.
It also adds some missing documentation and tweak some existing one to integrate with this feature. I also prefixed some component methods with an '_' so they don't show up in the doc.
**Test plan (required)**
Tested every component page locally to make sure the methods doc was displayed properly.
Tested an API page to make sure it still worked properly.
Closes https://github.com/facebook/react-native/pull/6890
Differential Revision: D3159911
Pulled By: vjeux
fb-gh-sync-id: 1e6a4640cda6794496d9844c1af6a1451c017dcc
fbshipit-source-id: 1e6a4640cda6794496d9844c1af6a1451c017dcc
Summary:Current docs show an Appetize.io example for AlertIOS doc. This pull request adds that feature across all applicable iOS and Android docs. So if a doc has an example in UIExplorer, it shows up in the top right and clicking to Play should navigate to the relevant example.
The changes here also touched NavigationExperimental to fix a typo that prevented iOS deep link from working. Code was also added to help support Android deep links but there's an outstanding issue (a race condition) around how Android deep links trigger getInitialURL in NavigationRootContainer that prevents this from fully working.
For adding the docs, a few things were done outside this pull request:
1/ Release builds for UIExplorer Android and iOS apps were uploaded to Appetize.io. The Appetize.io info (public key to run the build) is embedded in the docs.
2/ The iOS build was generated by making a few changes to get a local bundle. The current UIExplorer set up doesn't support "react-native run-ios".
Regarding the Appetize bu
Closes https://github.com/facebook/react-native/pull/6306
Differential Revision: D3129651
Pulled By: bestander
fb-gh-sync-id: d296d64db8236faa36f35484bb6b362990caf934
fbshipit-source-id: d296d64db8236faa36f35484bb6b362990caf934
Summary:This makes the `refreshing` prop more 'controlled'. Before forgetting to set the refreshing prop in the onRefresh callback would make the js and native `refreshing` prop get out of sync and make the RefreshControl stop refreshing properly (see #5839).
I also added a simple usage example and a note about the refreshing prop in the doc.
There was also a small bug in the doc generation code that made the array of color show as [[object Object]] instead of [color] so I fixed that too.
** Test plan**
Tested using the UIExplorer example on iOS and Android. Not setting the `refreshing` prop to true in the `onRefresh` function should cause the RefreshControl to stop refreshing immediately and continue working properly after.
Closes#5839
Closes https://github.com/facebook/react-native/pull/6434
Differential Revision: D3046279
Pulled By: nicklockwood
fb-gh-sync-id: ebda04c659a10f0b9d468473c8d5c659256ca1b5
shipit-source-id: ebda04c659a10f0b9d468473c8d5c659256ca1b5
Summary:Relative links did not have 'docs/' prefix, so all of them lead to 404 page.
Fixes#5964
Closes https://github.com/facebook/react-native/pull/5975
Differential Revision: D2943886
Pulled By: androidtrunkagent
fb-gh-sync-id: dbc2355ecf7ea4f1dea0f8f6a5ef50e5f324dfda
shipit-source-id: dbc2355ecf7ea4f1dea0f8f6a5ef50e5f324dfda
Summary:
- Now using a table layout. While having the link inside of the header worked well in the browser, the search API would put "Edit in GitHub" as part of the title -_-
- Instead of putting the link inside of every section like Props, put it on the page header. This makes it less repetetitive and also works on API pages where the link was absent before
- Remove "Run this example" link as there's a giant Run this example sidebar already.
Closes https://github.com/facebook/react-native/pull/5643
Reviewed By: svcscm
Differential Revision: D2883989
Pulled By: vjeux
fb-gh-sync-id: e810e1677d5130692997dd301d6d59cfe04b948f
Summary:
To allow smoother API changes for users we often deprecate props and keep them around for a while before removing them. Right now it is all done manually, this adds a consistent way to show a warning when using a deprecated prop.
This also adds a deprecation warning of the website generated from the deprecatedPropType.
<img width="643" alt="screen shot 2016-01-26 at 7 43 08 pm" src="https://cloud.githubusercontent.com/assets/2677334/12600172/7af28fb0-c465-11e5-85e5-3786852bf522.png">
It also changes places where we added the warnings manually to use deprecatedPropType instead.
Closes https://github.com/facebook/react-native/pull/5566
Reviewed By: svcscm
Differential Revision: D2874629
Pulled By: nicklockwood
fb-gh-sync-id: c3c63bae7bbec26cc146029abd9aa5efbe73f795
Summary:
This was driving me crazy :p Turns out that if the value is `'auto' /* default */`, then the docparser will not only trim the comment but also normalize the quote to double quote.
This is not pretty but does the job.
Closes https://github.com/facebook/react-native/pull/5509
Reviewed By: svcscm
Differential Revision: D2872482
Pulled By: vjeux
fb-gh-sync-id: 8ba5dad695f747f82b7680ee26bdc0792e21ea8f