GithubHelp home page GithubHelp logo

itrelease / react-native-website Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/react-native-website

0.0 1.0 0.0 71.25 MB

The site and docs for React Native

Home Page: https://facebook.github.io/react-native/

License: MIT License

JavaScript 62.77% CSS 32.94% HTML 4.29%

react-native-website's Introduction

This repo contains the website configuration and documentation powering the React Native website.

Getting started

Prerequisites

  1. Git
  2. Node: install version 8 or greater.
  3. Yarn: See Yarn website for installation instructions. (needs 1.5 or greater).
  4. A fork of the repo (for any contributions).
  5. A clone of the react-native-website repo.

Installation

  1. cd react-native-website to go into the project root.
  2. cd website to go into the website portion of the project.
  3. yarn to install the website's npm dependencies (or npm install, if not using Yarn).

Running locally

  1. yarn start to start the development server (powered by Docusaurus) (or npm start, if not using Yarn).
  2. open http://localhost:3000/ to open the site in your favorite browser.

Overview

If you would like to contribute an edit or addition to the docs, read through our style guide before you write anything. All our content is generated from markdown files you can find in the 'docs/' directory.

To edit the internals of how the site is built, you may want to get familiarized with how the site is built. The React Native website is a static site generated using Docusaurus. The website configuration can be found in the 'website/' directory. Visit the Docusaurus website to learn more about all the available configuration options.

Directory Structure

The following is a high-level overview of relevant files and folders.

react-native-website/
├── docs/
│   ├── assets/
│   ├── accessibility.md
│   └── ...
└── website/
    ├── blog/
    │   ├── assets/
    │   ├── 2015-03-26-react-native-bringing-modern-web-techniques-to-mobile.md
    │   └── ...
    ├── core/
    ├── pages/
    │   └── en/
    │       ├── ...
    │       ├── index.js
    │       └── ...
    ├── static/
    │   ├── css/
    │   ├── img/
    │   └── js/
    ├── versioned_docs/
    │   ├── version-0.5/
    │   └── ...
    ├── versioned_sidebars/
    │   ├── version-0.5-sidebars.json
    │   └── ...
    ├── showcase.json
    ├── sidebars.json
    ├── siteConfig.js
    └── versions.json

Documentation sources

As mentioned above, the 'docs/' folder contains the source files for all of the docs in the React Native website. In most cases, you will want to edit the files within this directory. If you're adding a new doc or you need to alter the order the docs appear in the sidebar, take a look at the 'sidebars.json' file in the 'website/' directory. The sidebars file contains a list of document ids that should match those defined in the header metadata (aka frontmatter) of the docs markdown files.

Versioned docs

The React Native website is versioned as to allow users to go back and see the API reference docs for any given release. A new version of the website is generally made whenever there is a new React Native release. When this happens, any changes made to the 'docs/' and 'website/sidebars.json' files will be copied over to the corresponding location within 'website/versioned_docs/' and 'website/versioned_sidebars/'.

Do not edit the auto-generated files within 'versioned_docs/' or 'versioned_sidebars/' unless you are sure it is necessary. Edits made to older versions will not be propagated to newer versions of the docs.

Docusaurus keeps track of the list of versions for the site in the 'website/versions.json' file. The ordering of the versions in this file should be in reverse chronological order.

Cutting a new version

  1. cd react-native-website to go into the project root.
  2. cd website to go into the website portion of the project.
  3. Run yarn run version <newVersion> where <newVersion> is the new version being released.

Website configuration

The main config file for the website can be found at 'website/siteConfig.js'. This file tells Docusaurus how to build the website. Edits to this file are rarely necessary.

The 'pages/' subdirectory contains the React components that make up the non-documentation pages of the site, such as the homepage.

The 'showcase.json' file contains the list of users that are highlighted in the React Native showcase.

Contributing

Create a branch

  1. git checkout master from any folder in your local react-native-website repository.
  2. git pull origin master to ensure you have the latest main code.
  3. git checkout -b the-name-of-my-branch (replacing the-name-of-my-branch with a suitable name) to create a branch.

Make the change

  1. Follow the "Running locally" instructions.
  2. Save the files and check in the browser. Some changes may require a server restart.
  3. Changes to /docs will only be visible in the latest version of the documentation (master).

open http://localhost:3000/react-native/versions.html to see other versions.

Test the change

If possible, test any visual changes in all latest versions of Firefox and Chrome on desktop and Safari and Chrome on mobile.

Push it

  1. Run yarn prettier to ensure your changes are consistent with other files in the repo.
  2. git add -A && git commit -m "My message" (replacing My message with a commit message, such as Fixed header logo on Android) to stage and commit your changes.
  3. git push my-fork-name the-name-of-my-branch
  4. Go to the react-native-website repo and you should see recently pushed branches.
  5. Follow GitHub's instructions.
  6. If possible, include screenshots of visual changes.

License

React Native is MIT licensed.

React Native documentation is Creative Commons licensed.

react-native-website's People

Contributors

abhinavsagar avatar bolah2009 avatar brentvatne avatar charpeni avatar cpojer avatar ecreeth avatar hramos avatar jamonholmgren avatar kelset avatar liamsheppard avatar lucasbento avatar lwinkyawmyat avatar mkonicek avatar orta avatar raajnadar avatar rachelnabors avatar raghav710 avatar rickhanlonii avatar salakar avatar salvariable avatar sarachicad avatar skn0tt avatar tesseralis avatar thesavior avatar thib92 avatar turnrye avatar vitorverasm avatar vonovak avatar yangshun avatar ziqichen6 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.