Skip to content

Commit

Permalink
docs make all link start with /react/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglou committed Dec 19, 2013
1 parent 039124b commit 3067265
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions docs/docs/02-displaying-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ We've found that the best solution for this problem is to generate markup direct

**JSX lets you write JavaScript function calls with HTML syntax.** To generate a link in React using pure JavaScript you'd write: `React.DOM.a({href: 'http://facebook.github.io/react/'}, 'Hello React!')`. With JSX this becomes `<a href="http://facebook.github.io/react/">Hello React!</a>`. We've found this has made building React apps easier and designers tend to prefer the syntax, but everyone has their own workflow, so **JSX is not required to use React.**

JSX is very small; the "hello, world" example above uses every feature of JSX. To learn more about it, see [JSX in depth](./jsx-in-depth.html). Or see the transform in action in [our live JSX compiler](/react/jsx-compiler.html).
JSX is very small; the "hello, world" example above uses every feature of JSX. To learn more about it, see [JSX in depth](/react/docs/jsx-in-depth.html). Or see the transform in action in [our live JSX compiler](/react/jsx-compiler.html).

JSX is similar to HTML, but not exactly the same. See [JSX gotchas](./jsx-gotchas.html) for some key differences.
JSX is similar to HTML, but not exactly the same. See [JSX gotchas](/react/docs/jsx-gotchas.html) for some key differences.

The easiest way to get started with JSX is to use the in-browser `JSXTransformer`. We strongly recommend that you don't use this in production. You can precompile your code using our command-line [react-tools](http://npmjs.org/package/react-tools) package.
6 changes: 3 additions & 3 deletions docs/docs/02.1-jsx-in-depth.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var app = Nav({color:"blue"}, Profile(null, "click"));
Use the [JSX Compiler](/react/jsx-compiler.html) to try out JSX and see how it
desugars into native JavaScript.

If you want to use JSX, the [Getting Started](getting-started.html) guide shows
If you want to use JSX, the [Getting Started](/react/docs/getting-started.html) guide shows
how to setup compilation.

> Note:
Expand Down Expand Up @@ -92,7 +92,7 @@ var MyComponent = React.createClass({/*...*/});
var app = <MyComponent someProperty={true} />;
```

See [Multiple Components](multiple-components.html) to learn more about using composite components.
See [Multiple Components](/react/docs/multiple-components.html) to learn more about using composite components.

> Note:
>
Expand Down Expand Up @@ -168,4 +168,4 @@ efforts include:
* JSX neither provides nor requires a runtime library.
* JSX does not alter or add to the semantics of JavaScript.

JSX is similar to HTML, but not exactly the same. See [JSX gotchas](./jsx-gotchas.html) for some key differences.
JSX is similar to HTML, but not exactly the same. See [JSX gotchas](/react/docs/jsx-gotchas.html) for some key differences.
2 changes: 1 addition & 1 deletion docs/docs/02.2-jsx-gotchas.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ JSX looks like HTML but there are some important differences you may run into.

> Note:
>
> For DOM differences, such as the inline `style` attribute, check [here](dom-differences.html).
> For DOM differences, such as the inline `style` attribute, check [here](/react/docs/dom-differences.html).
## Whitespace Removal

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/03-interactivity-and-dynamic-uis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ prev: jsx-gotchas.html
next: multiple-components.html
---

You've already [learned how to display data](./displaying-data.html) with React. Now let's look at how to make our UIs interactive.
You've already [learned how to display data](/react/docs/displaying-data.html) with React. Now let's look at how to make our UIs interactive.


## A Simple Example
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/04-multiple-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ In React, data flows from owner to owned component through `props` as discussed

You may be thinking that it's expensive to react to changing data if there are a large number of nodes under an owner. The good news is that JavaScript is fast and `render()` methods tend to be quite simple, so in most applications this is extremely fast. Additionally, the bottleneck is almost always the DOM mutation and not JS execution and React will optimize this for you using batching and change detection.

However, sometimes you really want to have fine-grained control over your performance. In that case, simply override `shouldComponentUpdate()` to return false when you want React to skip processing of a subtree. See [the React reference docs](component-specs.html) for more information.
However, sometimes you really want to have fine-grained control over your performance. In that case, simply override `shouldComponentUpdate()` to return false when you want React to skip processing of a subtree. See [the React reference docs](/react/docs/component-specs.html) for more information.

> Note:
>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/05-reusable-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ React.renderComponent(

Components are the best way to reuse code in React, but sometimes very different components may share some common functionality. These are sometimes called [cross-cutting concerns](http://en.wikipedia.org/wiki/Cross-cutting_concern). React provides `mixins` to solve this problem.

One common use case is a component wanting to update itself on a time interval. It's easy to use `setInterval()`, but it's important to cancel your interval when you don't need it anymore to save memory. React provides [lifecycle methods](./working-with-the-browser.html) that let you know when a component is about to be created or destroyed. Let's create a simple mixin that uses these methods to provide an easy `setInterval()` function that will automatically get cleaned up when your component is destroyed.
One common use case is a component wanting to update itself on a time interval. It's easy to use `setInterval()`, but it's important to cancel your interval when you don't need it anymore to save memory. React provides [lifecycle methods](/react/docs/working-with-the-browser.html) that let you know when a component is about to be created or destroyed. Let's create a simple mixin that uses these methods to provide an easy `setInterval()` function that will automatically get cleaned up when your component is destroyed.

```javascript
/** @jsx React.DOM */
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/07-working-with-the-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ React.renderComponent(

## More About Refs

To learn more about refs, including ways to use them effectively, see our [more about refs](./more-about-refs.html) documentation.
To learn more about refs, including ways to use them effectively, see our [more about refs](/react/docs/more-about-refs.html) documentation.


## Component Lifecycle
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/09.2-form-input-binding-sugar.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In React, data flows one way: from owner to child. This is because data only flo

However, there are lots of applications that require you to read some data and flow it back into your program. For example, when developing forms, you'll often want to update some React `state` when you receive user input. Or perhaps you want to perform layout in JavaScript and react to changes in some DOM element size.

In React, you would implement this by listening to a "change" event, read from your data source (usually the DOM) and call `setState()` on one of your components. "Closing the data flow loop" explicitly leads to more understandable and easier-to-maintain programs. See [our forms documentation](./forms.html) for more information.
In React, you would implement this by listening to a "change" event, read from your data source (usually the DOM) and call `setState()` on one of your components. "Closing the data flow loop" explicitly leads to more understandable and easier-to-maintain programs. See [our forms documentation](/react/docs/forms.html) for more information.

Two-way binding -- implicitly enforcing that some value in the DOM is always consistent with some React `state` -- is concise and supports a wide variety of applications. We've provided `ReactLink`: syntactic sugar for setting up the common data flow loop pattern described above, or "linking" some data source to React `state`.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/10-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ prev: addons.html

### Sample Code

* We've included [a step-by-step comment box tutorial](./tutorial.html).
* We've included [a step-by-step comment box tutorial](/react/docs/tutorial.html).
* [The React starter kit](/react/downloads.html) includes several examples which you can [view online in our GitHub repository](https://github.com/facebook/react/tree/master/examples/).
* [React Page](https://github.com/facebook/react-page) is a simple React project creator to get you up-and-running quickly with React. It supports both server-side and client-side rendering, source transform and packaging JSX files using CommonJS modules, and instant reload.
* [React one-hour email](https://github.com/petehunt/react-one-hour-email/commits/master) goes step-by-step from a static HTML mock to an interactive email reader (written in just one hour!)
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ In the root directory of the starter kit, create a `helloworld.html` with the fo
</html>
```

The XML syntax inside of JavaScript is called JSX; check out the [JSX syntax](jsx-in-depth.html) to learn more about it. In order to translate it to vanilla JavaScript we use `<script type="text/jsx">` and include `JSXTransformer.js` to actually perform the transformation in the browser.
The XML syntax inside of JavaScript is called JSX; check out the [JSX syntax](/react/docs/jsx-in-depth.html) to learn more about it. In order to translate it to vanilla JavaScript we use `<script type="text/jsx">` and include `JSXTransformer.js` to actually perform the transformation in the browser.

### Separate File

Expand Down Expand Up @@ -115,4 +115,4 @@ If you want to use React within a module system, [fork our repo](http://github.c

## Next Steps

Check out [the tutorial](tutorial.html) and the other examples in the `/examples` directory to learn more. Good luck, and welcome!
Check out [the tutorial](/react/docs/tutorial.html) and the other examples in the `/examples` directory to learn more. Good luck, and welcome!
2 changes: 1 addition & 1 deletion docs/docs/ref-01-top-level-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function createClass(object specification)

Creates a component given a specification. A component implements a `render` method which returns **one single** child. That child may have an arbitrarily deep child structure. One thing that makes components different than standard prototypal classes is that you don't need to call new on them. They are convenience wrappers that construct backing instances (via new) for you.

For more information about the specification object, see [Component Specs and Lifecycle](component-specs.html).
For more information about the specification object, see [Component Specs and Lifecycle](/react/docs/component-specs.html).


### React.renderComponent
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/ref-03-component-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This method is invoked before `getInitialState` and therefore cannot rely on `th
object propTypes
```

The `propTypes` object allows you to validate props being passed to your components. For more information about `propTypes`, see [Reusable Components](reusable-components.html).
The `propTypes` object allows you to validate props being passed to your components. For more information about `propTypes`, see [Reusable Components](/react/docs/reusable-components.html).

<!-- TODO: Document propTypes here directly. -->

Expand All @@ -62,7 +62,7 @@ The `propTypes` object allows you to validate props being passed to your compone
array mixins
```

The `mixins` array allows you to use mixins to share behavior among multiple components. For more information about mixins, see [Reusable Components](reusable-components.html).
The `mixins` array allows you to use mixins to share behavior among multiple components. For more information about mixins, see [Reusable Components](/react/docs/reusable-components.html).

<!-- TODO: Document mixins here directly. -->

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/ref-04-tags-and-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ React supports all `data-*` and `aria-*` attributes as well as every attribute i
>
> All attributes are camel-cased and the attributes `class` and `for` are `className` and `htmlFor`, respectively, to match the DOM API specification.
For a list of events, see [Supported Events](events.html).
For a list of events, see [Supported Events](/react/docs/events.html).

### HTML Attributes

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/ref-05-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Event names:
onChange onInput onSubmit
```

For more information about the onChange event, see [Forms](forms.html).
For more information about the onChange event, see [Forms](/react/docs/forms.html).


### Mouse Events
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/ref-06-dom-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ React has implemented a browser-independent events and DOM system for performanc

* All DOM properties and attributes (including event handlers) should be camelCased to be consistent with standard JavaScript style. We intentionally break with the spec here since the spec is inconsistent. **However**, `data-*` and `aria-*` attributes [conform to the specs](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#data-*) and should be lower-cased only.
* The `style` attribute accepts a JavaScript object with camelCased properties rather than a CSS string. This is consistent with the DOM `style` JavaScript property, is more efficient, and prevents XSS security holes.
* All event objects conform to the W3C spec, and all events (including submit) bubble correctly per the W3C spec. See [Event System](events.html) for more details.
* The `onChange` event behaves as you would expect it to: whenever a form field is changed this event is fired rather than inconsistently on blur. We intentionally break from existing browser behavior because `onChange` is a misnomer for its behavior and React relies on this event to react to user input in real time. See [Forms](forms.html) for more details.
* All event objects conform to the W3C spec, and all events (including submit) bubble correctly per the W3C spec. See [Event System](/react/docs/events.html) for more details.
* The `onChange` event behaves as you would expect it to: whenever a form field is changed this event is fired rather than inconsistently on blur. We intentionally break from existing browser behavior because `onChange` is a misnomer for its behavior and React relies on this event to react to user input in real time. See [Forms](/react/docs/forms.html) for more details.
* Form input attributes such as `value` and `checked`, as well as `textarea`. [More here](/react/docs/forms.html).
4 changes: 2 additions & 2 deletions docs/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ React.renderComponent(
);
```

Its use is optional but we've found JSX syntax easier to use than plain JavaScript. Read more on the [JSX Syntax article](jsx-in-depth.html).
Its use is optional but we've found JSX syntax easier to use than plain JavaScript. Read more on the [JSX Syntax article](/react/docs/jsx-in-depth.html).

#### What's going on

Expand Down Expand Up @@ -664,4 +664,4 @@ var CommentBox = React.createClass({

### Congrats!

You have just built a comment box in a few simple steps. Learn more about [why to use React](why-react.html), or dive into the [API reference](top-level-api.html) and start hacking! Good luck!
You have just built a comment box in a few simple steps. Learn more about [why to use React](/react/docs/why-react.html), or dive into the [API reference](/react/docs/top-level-api.html) and start hacking! Good luck!
2 changes: 1 addition & 1 deletion docs/tips/11-dom-event-listeners.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ React.renderComponent(<Box />, mountNode);

`componentDidMount` is called after the component is mounted and has a DOM representation. This is often a place where you would attach generic DOM events.

Notice that the event callback is bound to the react component and not the original element. React automatically binds methods to the current component instance for you through a process of [autobinding](../docs/interactivity-and-dynamic-uis.html#under-the-hood-autobinding-and-event-delegation).
Notice that the event callback is bound to the react component and not the original element. React automatically binds methods to the current component instance for you through a process of [autobinding](/react/docs/interactivity-and-dynamic-uis.html#under-the-hood-autobinding-and-event-delegation).

0 comments on commit 3067265

Please sign in to comment.