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 email@example.com:datacamp/mobile-courses-example-course.git
The suite of development tools available for authoring mobile content on DataCamp is provided as an NPM package. If you don't have NPM yet, you will need to download and install it.
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 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
http://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
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.
Merge your content branch into the development branch on GitHub.
Check that the build passes on CircleCI. This should take a few minutes or less.
Download the latest development build of DataCamp for Mobile.
Check out your new content on the development app, make sure everything looks good.
When you are ready for a full release, open a pull request with your content branch into the master branch on GitHub.
DataCamp will review and approve the pull request, and tag the
masterbranch in GitHub for release.
Your content is now live to the world!