Summary: Remove gists in code blocks. This also made it easier to fix the iOS sample app instructions in the getting started. >Note: I also needed to update my gems as I was having problems running `bundle install`. The errors were around installing json v1.8.3. It was resolved by creating a new Gemfile.lock. 1. Build website and check changed pages (see attached Getting Started for an example) 2. Also check how it would look for mobile site (see attached index page) Verified that the code snippets matched previous snippets and styling acceptable.   Closes https://github.com/facebook/yoga/pull/500 Differential Revision: D4834356 Pulled By: emilsjolander fbshipit-source-id: f47dca4b7518822b195f0bd5076fbf852904372b
2.2 KiB
docid, title, layout, permalink
docid | title | layout | permalink |
---|---|---|---|
getting-started | Getting Started | docs | /docs/getting-started/ |
Installation
Installation of Yoga is currently a manual process. We have plans on bringing Yoga to the many available package management systems (e.g., Yarn, Gradle, Cocoapods), but we do not have a target date at this time. We would greatly appreciate community contributions here.
Getting the Code
For now we recommend including Yoga as a git submodule in your project. Once done, you can either build Yoga using Buck (detailed below) or integrate it into your existing build system by including the C library from the root yoga
directory as well as the language bindings (e.g., Java, C#) you wish to use.
Running the Examples
iOS
Yoga ships with an iOS example. To get it running:
$ git clone https://github.com/facebook/yoga.git
$ cd open yoga/YogaKit/YogaKitSample/
$ pod install
$ open YogaKitSample.xcworkspace
Android
Yoga ships with an Android example too. To get it running on an attached device (or emulator):
$ git clone https://github.com/facebook/yoga.git
$ cd yoga
$ buck install -r android/sample
Actually, this is more than just an example, and more a layout system for Android using Yoga in general (see YogaLayout
). For more information see the Android API section.
Building with Buck
Yoga uses Buck as its build system. Buck is not required for using Yoga, but, if you already use Buck, then integrating Yoga is very simple.
If you are using Buck all you need to do is reference the language bindings you want to use in your BUCK
file.
deps = [
# C
'//path/to/submodule/yoga:yoga',
# Java
'//path/to/submodule/yoga/java:jni',
# Objective-C
'//path/to/submodule/yoga/YogaKit:YogaKit',
]