Each mobile courses is a GitHub repo under the DataCamp GitHub organization. You will be given full write access to the repository for your course. First clone the repository:
git clone firstname.lastname@example.org:datacamp/mobile-courses-example-course.git
npm cache clean -f # update node npm install -g n sudo n stable # update npm npm install -g npm # install DataCamp mobile development tools npm install -g @datacamp/mobile-teach
This will create the
mobile-teach executable, which you will use to lint and
preview your content.
You may periodically need to update the
mobile-teach package in the
future. You can achieve this by simply running the installation command again:
npm install -g @datacamp/mobile-teach
Before pushing (or - preferably - committing) updates to your content, you should run the mobile-teach linter. The linter does two things:
- It validates your YAML's schema to ensure that there are no errors break the build.
- It supplies a warning when your content exceeds guideline recommendations and errors when it exceeds hard limits.
The linter will provide exercise UUIDs to mark where problems are occurring and explicit messages about what is wrong. You can either specify the path to a course directory...
mobile-teach check /path/to/mobile-courses-example-course
...or simply run the check from within a course directory:
cd /path/to/mobile-courses-example-course mobile-teach check
If you want to exclude warnings:
mobile-teach check | grep -v warning
If you want to run only the schema validation:
mobile-teach check --exclude content-guidelines-validator
Often it's useful to see how your content will render on a phone screen. The
mobile-teach preview subcommand will serve your content on port 8080:
mobile-teach preview /path/to/lesson-file.yml
You can then open a web browser (we recommend Firefox version 58 or later) to
localhost:8080. Open the browser tools
Command-Option-i for Firefox) and click the phone icon to simulate a phone
view port. You can even specify which phone you want to simulate (eg iPhone,
Nexus, Galaxy, etc) by clicking the bar at the top of the viewport and selecting
a device model. We recommend previewing on the smallest phone supported by
DataCamp for Mobile - the iPhone SE.
The simulator preview will update in real time as you make changes to your content, so try setting it up side by side with your content and editing in real-time! Note that although the real mobile app will randomize possible answers in every exercise, the preview will always place the correct answer(s) first, so that it's easy to power through a lesson for testing purposes.
A known upstream bug in the React framework prevents datasets from rendering in tabs on the mobile preview. Don't worry - these will render properly on a real mobile device.
At any point, you can preview your content on the development version of the
DataCamp for Mobile app. This is a second app that you can install alongside the
real production version of the app. It displays the content that you push to the
development (dev) branch. Only you and DataCamp will be able to see what you
push to dev. Email email@example.com for an invite to the iOS/Android dev
When you want to push to dev:
Download the development app. Contact firstname.lastname@example.org if you don't already have it; you will receive an email with download instructions.
Create a new account through the dev app. You won't be able to log in with your existing DataCamp account because this app runs off DataCamp's development server. Instead, make a new account through the dev app and log in with that.
First, check that everything is in good shape:
developmentbranch to the content you want to test.
## Checkout the development branch git checkout -b development ## Reset the development branch to your content git reset --hard chapter-2 ## Force push development git push origin development --force-with-lease
This wipes out changes that you've committed directly to
developmentso you should never work directly on the
developmentbranch! You should operate under the assumption that commits you make directly to
developmentcould disappear at any time.
Check out your new content on the development app, make sure everything looks good.
Unlike desktop courses, courses on DataCamp for Mobile are typically released one chapter at a time. When your chapter branch is ready to be released to the world:
Do one last check!
Open a pull request (PR) for your chapter branch into the
masterbranch on GitHub.
DataCamp will review the PR and make suggestions for revisions.
After one or more reviews & revisions, the PR will be approved and DataCamp will generate a new release.
Your content is now live to the world!
Start a new branch for the next chapter. For example, if you just merged
chapter-1, create and check out a new branch for
git checkout -b chapter-2