Permalink
Please sign in to comment.
Browse files
Documentation updates (#92)
* Rewrite Basic Usage, move to basic-usage.md * add .vscode to git/npmignore * update docs * update titles in profile-cards gql/primitives * add images to examples.md * update docs URLs in TOC * gitbook doesn't like emoji shortcodes * add allcontributors - closes #90 * add gitter to README - closes #89 * Sketch 43 is out of beta * typos * fix broken links to docs * typos * Ignore gh-pages branch on circle * fix code of conduct link * add 'What Can I Do With It?' to homepage * add Contributing link to homepage * resolve extra merge conflict * suggested doc changes * replace references to onRun * remove Core Concepts doc page * update styling docs * quicker quickstart * fix broken Style.md tables * typo in README * update TextStyles docs * update universal rendering guide * fix proptypes in basic-skpm example * update example docs * move react-primitives -> profile-cards-primitives * Revert "add allcontributors - closes #90" This reverts commit 5e2ec8a6bfb4bfcf5cae79ce8e30c49b931b1617. * Use arrow functions for examples' main exports * merge FAQ & Troubleshooting, rewrite some of FAQ * remove Is It Stable from FAQ and table from README * fix typos in data-fetching section * remove comments in API.md
- Loading branch information...
Showing
with
282 additions
and 385 deletions.
- +1 −1 CONTRIBUTING.md
- +48 −79 README.md
- +5 −0 circle.yml
- +13 −8 docs/API.md
- +27 −53 docs/FAQ.md
- +11 −12 docs/README.md
- BIN docs/assets/README-intro.png
- BIN docs/assets/examples-colors.png
- BIN docs/assets/examples-primitives.png
- BIN docs/assets/examples-profile-cards-gql.png
- BIN docs/assets/examples-profile-cards.png
- BIN docs/assets/examples-skpm.png
- BIN docs/assets/examples-styleguide.png
- +13 −10 docs/examples.md
- +3 −3 docs/guides/README.md
- +0 −3 docs/guides/basic-usage.md
- +5 −5 docs/guides/data-fetching.md
- +18 −54 docs/guides/universal-rendering.md
- +84 −87 docs/styling.md
- +0 −33 docs/troubleshooting.md
- +4 −4 examples/{basic-skpm → basic-setup}/README.md
- +2 −2 examples/{basic-skpm → basic-setup}/package.json
- +1 −1 examples/{basic-skpm → basic-setup}/src/manifest.json
- +2 −2 examples/{basic-skpm → basic-setup}/src/my-command.js
- 0 examples/{basic-skpm → basic-setup}/yarn.lock
- +1 −1 examples/colors/README.md
- +14 −5 examples/foursquare-maps/README.md
- +1 −1 examples/foursquare-maps/src/main.js
- +1 −1 examples/profile-cards-graphql/README.md
- +2 −2 examples/profile-cards-graphql/src/main.js
- +17 −9 examples/{react-primitives → profile-cards-primitives}/README.md
- +2 −2 examples/{react-primitives → profile-cards-primitives}/package.json
- 0 examples/{react-primitives → profile-cards-primitives}/src/components/Profile.js
- 0 examples/{react-primitives → profile-cards-primitives}/src/components/Space.js
- 0 examples/{react-primitives → profile-cards-primitives}/src/data.js
- 0 examples/{react-primitives → profile-cards-primitives}/src/designSystem.js
- +2 −2 examples/{react-primitives → profile-cards-primitives}/src/main.js
- +1 −1 examples/{react-primitives → profile-cards-primitives}/src/manifest.json
- 0 examples/{react-primitives → profile-cards-primitives}/src/types.js
- 0 examples/{react-primitives → profile-cards-primitives}/src/web.js
- 0 examples/{react-primitives → profile-cards-primitives}/yarn.lock
- +1 −1 examples/profile-cards/README.md
- +1 −1 examples/profile-cards/src/main.js
- +1 −1 examples/styleguide/README.md
- +1 −1 examples/styleguide/src/main.js
| @@ -1,95 +1,64 @@ | ||
| -> **requires [Sketch 43 Beta](https://sketchapp.com/beta/) or higher** | ||
| -> This project is currently in **alpha and APIs are subject to change**. If you found the repo on npm — the source (& docs, oops) is private for now; it will be announced on <a href="jon.gold/txt">my mailing list</a> and <a href="http://twitter.com/jongold">Twitter</a> very soon :) | ||
| +> This project is currently in **beta and APIs are subject to change**. | ||
| -<img alt="react-sketchapp" src="https://cloud.githubusercontent.com/assets/591643/22898688/146aea8e-f1dd-11e6-934c-cdbd29b82a0e.png" height="72px" /> | ||
| +<div align="center"> | ||
| + <img alt="react-sketchapp" src="https://cloud.githubusercontent.com/assets/591643/22898688/146aea8e-f1dd-11e6-934c-cdbd29b82a0e.png" height="72px" /> | ||
| +</div> | ||
| -A React renderer for [Sketch.app](https://www.sketchapp.com/) :atom_symbol: :gem: | ||
| +<div align="center"> | ||
| + <strong>render React components to Sketch; tailor-made for design systems</strong> | ||
| +</div> | ||
| -[](https://www.npmjs.com/package/react-sketchapp) | ||
| -[](https://circleci.com/gh/airbnb/react-sketchapp) | ||
| - | ||
| - | ||
| -## Features | ||
| - | ||
| -* **Declarative.** All the lessons we've learnt from the React model of programming. A comfortable layer over Sketch’s API. | ||
| -* **Familiar.** Flexbox layouts. `react-native` components. You already know how to use `react-sketchapp`. | ||
| -* **Data-based.** Pipe in real data from JSON files, APIs, and databases. | ||
| -* **Universal.** Start from scratch, or use your existing component libraries | ||
| - | ||
| -## Documentation | ||
| - | ||
| -* [Usage](#usage) | ||
| -* [Examples](/docs/examples.md) | ||
| -* [Styling](/docs/styling.md) | ||
| -* [API Reference](/docs/API.md) | ||
| -* [Universal Rendering](/docs/guides/universal-rendering.md) | ||
| -* [Data Fetching](/docs/guides/data-fetching.md) | ||
| -* [Troubleshooting](/docs/troubleshooting.md) | ||
| -* [FAQ](/docs/FAQ.md) | ||
| - | ||
| -## Usage | ||
| -`react-sketchapp` projects are implemented as [Sketch plugins](http://developer.sketchapp.com/). | ||
| - | ||
| -There are several ways to build Sketch plugins: | ||
| - | ||
| -### Using a template | ||
| -The simplest way to build Sketch plugins with modern JavaScript is [`skpm`](https://github.com/sketch-pm/skpm) 💎📦 with the `react-sketchapp-skpm-example` template. Feel free to remove anything you're not using. | ||
| - | ||
| -Install `skpm`, if you don't have it already: | ||
| +## Quickstart 🏃 | ||
| +First, make sure you have installed [Sketch](http://sketchapp.com) version 43+, & a recent [npm](https://nodejs.org/en/download/). | ||
| ```bash | ||
| -npm install -g skpm | ||
| -``` | ||
| +curl -L https://github.com/jongold/react-sketchapp-example/archive/master.zip | tar -xz | ||
| +cd react-sketchapp-example-master && npm install | ||
| -Create a new project: | ||
| -```bash | ||
| -mkdir my-rad-sketch-plugin | ||
| -cd my-rad-sketch-plugin | ||
| -# Initialize this plugin with the template | ||
| -skpm init git+ssh://git@github.com:jongold/react-sketchapp-skpm-example.git | ||
| -# Install dependencies | ||
| -npm install | ||
| -# Setup an alias from the .sketchplugin to the sketch plugins folder | ||
| -skpm link . | ||
| +npm run render | ||
| ``` | ||
| -Then, to build your plugin (will auto update when you change the code) | ||
| -```bash | ||
| -npm run watch | ||
| -``` | ||
| - | ||
| -Write your plugin in `src/my-command.js` | ||
| -```js | ||
| -import React from 'react'; | ||
| -import { render, Text, View } from 'react-sketchapp'; | ||
| - | ||
| -const Document = props => | ||
| - <View> | ||
| - <Text>Hello world!</Text> | ||
| - </View>; | ||
| - | ||
| -export default function (context) { | ||
| - render(<Document />, context.document.currentPage()); | ||
| -} | ||
| -``` | ||
| + | ||
| -Run your plugin in Sketch via `Plugins → [plugin name] → my-command`. The plugin name is determined by `src/manifest.json` | ||
| +[](https://www.npmjs.com/package/react-sketchapp) | ||
| +[](https://circleci.com/gh/airbnb/react-sketchapp) | ||
| + | ||
| +[](https://gitter.im/react-sketchapp/Lobby) | ||
| -Refer to the [skpm docs](https://github.com/sketch-pm/skpm) for more information about skpm. | ||
| +## Why?! | ||
| -### The manual way | ||
| +Managing the assets of design systems in Sketch is complex, error-prone and time consuming. Sketch is scriptable, but the API often changes. React provides the perfect wrapper to build reusable documents in a way already familiar to JavaScript developers. | ||
| -Feel free to use whatever build process you're comfortable with — just [disable CocoaScript](http://developer.sketchapp.com/introduction/plugin-bundles/#disablecocoascriptpreprocessor) and disabled [Sketch's caching mechanism](http://developer.sketchapp.com/introduction/preferences#always-reload-scripts-before-running) | ||
| -``` | ||
| -defaults write ~/Library/Preferences/com.bohemiancoding.sketch3.plist AlwaysReloadScript -bool YES | ||
| +## What does the code look like? | ||
| +```js | ||
| +import { render, Text, Artboard } from 'react-sketchapp'; | ||
| + | ||
| +const App = props => ( | ||
| + <Artboard> | ||
| + <Text style={{ fontFamily: 'Comic Sans MS', color: 'hotPink' }}> | ||
| + { props.message } | ||
| + </Text> | ||
| + </Artboard> | ||
| +); | ||
| + | ||
| +export default (context) => { | ||
| + render(<App message="Hello world!" />, context); | ||
| +} | ||
| ``` | ||
| -You can then use [react-native-packager](https://github.com/facebook/react-native/tree/master/packager), [rollup](http://rollupjs.org/), [webpack](https://webpack.github.io/) etc. | ||
| +## What can I do with it? | ||
| +* **Manage design systems—** `react-sketchapp` was built for [Airbnb’s design system](http://airbnb.design/building-a-visual-language/); this is the easiest way to manage Sketch assets in a large design system | ||
| +* **Use real components for designs—** Implement your designs in code as React components and render them into Sketch | ||
| +* **Design with real data—** Designing with data is important but challenging; `react-sketchapp` makes it simple to fetch and incorporate real data into your Sketch files | ||
| +* **Build new tools on top of Sketch—** the easiest way to use Sketch as a canvas for custom design tooling | ||
| -### Examples | ||
| -`react-sketchapp` includes [several examples](examples/) showing how you might use it — including GraphQL data fetching and multi-platform universal rendering. | ||
| +Found a novel use? We'd love to hear about it! | ||
| -### Contributing | ||
| -Contributions are more than welcome. Just submit a PR with a description of your changes. Please attach screenshots and Sketch files (if relevant) to your Pull Requests for review. | ||
| +## Documentation | ||
| -### Issues, bugs, or feature requests | ||
| -File GitHub issues for anything that is unexpectedly broken. If there are issues with generated Sketch files please attach them to the issue. If you have ideas or feature requests you should also file a GitHub issue. | ||
| +* [Examples](http://airbnb.io/react-sketchapp/docs/examples.html) | ||
| +* [API Reference](http://airbnb.io/react-sketchapp/docs/API.html) | ||
| +* [Styling](http://airbnb.io/react-sketchapp/docs/styling.html) | ||
| +* [Universal Rendering](http://airbnb.io/react-sketchapp/docs/guides/universal-rendering.html) | ||
| +* [Data Fetching](http://airbnb.io/react-sketchapp/docs/guides/data-fetching.html) | ||
| +* [FAQ](http://airbnb.io/react-sketchapp/docs/FAQ.html) | ||
| +* [Contributing](http://airbnb.io/react-sketchapp/CONTRIBUTING.html) |
21
docs/API.md
80
docs/FAQ.md
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
0 comments on commit
8aae123