Skip to content

Latest commit

 

History

History
142 lines (91 loc) · 7.13 KB

File metadata and controls

142 lines (91 loc) · 7.13 KB

How to Update Sphero Docs

Main Layouts

There are two main layouts that can be updated in the docs, src/layouts/docs.hbs and src/layouts/static.hbs. The first one you see with the Sphero and Ollie pictures is static.hbs, this is the landing page with the options to select which platform docs you want to visit, it looks like this:

Static Layout

The other layout is the docs content layout, which is divided into three main sections, the main navigation menu and the secondary content navigation menu to the left, the content section to the right and center occupying most of the screen real state. The docs layout looks like this:

Docs Layout

How to update

The two layouts are where all the styles and js files are included, they also define the overall wireframe of the docs and where the navigation menus are located. If we want to update where the header, body, footer or navigation, the layouts are the place to do it.

Updating is fairly easy since we're using Handlebars; .hbs files are pretty much just html files that include some partials. The partials included in static.hbs are footer, header and mobile-nav, all of them can be found in src/content/partials/ and are just html files.

The remaining layout file (docs.hbs) can be updated in the same manner, and both layouts are pretty similar in how they are updated, with the exception that the main content layout also contains the navigation of the docs, this is where you would update the placement and position of said navigation. The navigation menus themselves are auto-generated with Assemble and the TOC plugin for the content navigation submenu.

Navigation Menus

There are two navigation menus in the docs, the Main menu that displays all the available sections of the docs for each platform (Sphero, Ollie), and the content navigation sub-menu which works as a easy way to move quickly or go to specific part inside the content of a docs section.

Main Navigation Menu

This menu is the one on the top left and is our main way of getting around between sections like 'Getting Started', 'SDK', or 'Macrolab'. It is auto-generated based in the contents of the folder src/content/sphero for Sphero and src/content/ollie for Ollie, it loos like this:

Main Navigation Menu

Adding a new section to the Main Navigation Menu

All .md files inside the content folders for each platform will be parsed and added to the menu based on a few config lines at the top of each .md file. What this means is that if you wish to add a new section you need only to create a new .md file inside one of the two platform folders (/src/content/\<platform\>) with the following lines at the beginning of the file, let's see an example using the src/content/sphero/start.md file.

---
word: Home
title: Home
order: 0
---
# Home

## Welcome!

Here you will find all the information you need applications or games with Sphero.

## Feedback

If you have any issues, you can search for answers, or ask a question on [StackOverflow][].

The documentation is hosted in our [DeveloperDocumentation][repo] repository.

Let us know how we can improve it by [creating an issue][issue].

Alternatively, you can click on the "Edit this page" button in the top right corner.
This will let you fork [DeveloperDocumentation][repo], edit the content, and submit a pull request.

[StackOverflow]: http://stackoverflow.com/questions/tagged/sphero-api?sort=newest
[repo]: https://github.com/orbotix/DeveloperDocumentation
[issue]: https://github.com/orbotix/DeveloperDocumentation/issues/new

The first word and title primitives define the title of the page and the wording for the navigation menu. The third one, as the name describes, defines the position it would have in the aforementioned menu.

There is a fourth commonly used primitive published, this is true by default and describes whether you want that file to be included in the menus or not. So if you wish to only remove a section from the navigation menu instead of deleting it, you can pass it false and it would be removed and no longer appear in the menu, but it will still exist in the docs folder.

Content Navigation Sub-Menu

This sub-menu contains links to the headers defined in the .md files for each platform. The Content Navigation Sub-Menu looks as follows:

Content Menu

The content sub-menu is generated by parsing the headers of the docs sections inside of the content files. What this means is, if we want to add a new section to this sub-menu, it's as easy as adding that section in the contents file with a header; that header would be then be detected and automatically added to the menu. This only works with h1, h2 and h3 elements.

To see an example of this in action, we'll use a fragment of the Getting Started contents file (src/content/sphero/getting-started.md) shown in the screenshot above.

# IDE Setup

## Android

*Note: The Sphero Android SDK works with Android 3.1+ and Java Compiler Level 6.0(1.6)+*

### Installing an IDE and the Android SDK

Before you begin to develop applications that interface with robots on Android, you will need to install the Android developer tools and an IDE. In this guide we will use Android Studio since Eclipse is no longer supported for Android development. There are many other well written Android IDEs out there and these configuration steps are most often still applicable.

*Note: You must have JDK 1.7 for Android Studio to work, even though the Robot SDK supports down to 1.6*

 - Install [JDK 1.7](http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html)
 - Install [Android Studio and Android SDK](http://developer.android.com/sdk/index.html)

### Installing the Robot SDK

 - Download the latest version of the [Robot SDK](https://github.com/orbotix/Sphero-Android-SDK/zipball/master)

**You can always keep up to date by watching our [GitHub Repository](https://github.com/orbotix/Sphero-Android-SDK)**

## Objective-C

*Note: The Robot SDK works with iOS 7.0+*

### Installing Xcode

Before you begin to develop applications that interface with robots on iOS, you will need to install Xcode. As of writing this, there are no other supported IDEs for iOS developement.

 - Install [Xcode](https://macappsto.re/us/Bk9QD.m)

### Installing the Robot SDK

 - Download the latest version of the [Robot SDK](https://github.com/orbotix/Sphero-iOS-SDK/zipball/master)

**You can always keep up to date by watching our [GitHub Repository](https://github.com/orbotix/Sphero-iOS-SDK)**

As we can see in the example, there is nothing special about the contents of the .md file, it is just the contents of each sub-section with their respective titles (headers). In the screenshot above the submenu is automatically generated and we have an IDE Setup item with three levels in the hierarchy of the navigation.